double q_ppi(int i, double xi, double *q, double *qL, double *qR) {
  double Dq = qL[i] - qR[i];
  double Dq6 = 6 * (q[i] - 0.5 * (qL[i] + qR[i]));
  double qx = qR[i] + xi * (Dq + Dq6 * (1. - xi));
  return qx;
}


x86 assembly (clang, -O0):
<q_ppi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x4(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x28(%rbp),%rax
movslq -0x4(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm1
movsd  0xeaa(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe92(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm3
movsd  -0x38(%rbp),%xmm2
movsd  0xe5d(%rip),%xmm4
subsd  -0x10(%rbp),%xmm4
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<q_ppi>:
movslq %edi,%rax
movsd  (%rdx,%rax,8),%xmm1
movsd  (%rcx,%rax,8),%xmm2
movapd %xmm1,%xmm3
subsd  %xmm2,%xmm3
addsd  %xmm2,%xmm1
mulsd  0xedf(%rip),%xmm1
addsd  (%rsi,%rax,8),%xmm1
mulsd  0xeda(%rip),%xmm1
movsd  0xeda(%rip),%xmm4
subsd  %xmm0,%xmm4
mulsd  %xmm1,%xmm4
addsd  %xmm3,%xmm4
mulsd  %xmm4,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @q_ppi(i32 %0, double %1, double* %2, double* %3, double* %4) {
%6 = alloca i32
%7 = alloca double
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double
%12 = alloca double
%13 = alloca double
store i32 %0, i32* %6
store double %1, double* %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%14 = load double*, double** %9
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %14, i64 %16
%18 = load double, double* %17
%19 = load double*, double** %10
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %19, i64 %21
%23 = load double, double* %22
%24 = fsub double %18, %23
store double %24, double* %11
%25 = load double*, double** %8
%26 = load i32, i32* %6
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds double, double* %25, i64 %27
%29 = load double, double* %28
%30 = load double*, double** %9
%31 = load i32, i32* %6
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds double, double* %30, i64 %32
%34 = load double, double* %33
%35 = load double*, double** %10
%36 = load i32, i32* %6
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double, double* %35, i64 %37
%39 = load double, double* %38
%40 = fadd double %34, %39
%41 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %40, double %29)
%42 = fmul double 6.000000e+00, %41
store double %42, double* %12
%43 = load double*, double** %10
%44 = load i32, i32* %6
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double, double* %43, i64 %45
%47 = load double, double* %46
%48 = load double, double* %7
%49 = load double, double* %11
%50 = load double, double* %12
%51 = load double, double* %7
%52 = fsub double 1.000000e+00, %51
%53 = call double @llvm.fmuladd.f64(double %50, double %52, double %49)
%54 = call double @llvm.fmuladd.f64(double %48, double %53, double %47)
store double %54, double* %13
%55 = load double, double* %13
ret double %55
}

LLVM IR (-O2):
define double @q_ppi(i32 %0, double %1, double* nocapture %2, double* nocapture %3, double* nocapture %4) {
%6 = sext i32 %0 to i64
%7 = getelementptr inbounds double, double* %3, i64 %6
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %4, i64 %6
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = getelementptr inbounds double, double* %2, i64 %6
%13 = load double, double* %12
%14 = fadd double %8, %10
%15 = tail call double @llvm.fmuladd.f64(double %14, double -5.000000e-01, double %13)
%16 = fmul double %15, 6.000000e+00
%17 = fsub double 1.000000e+00, %1
%18 = tail call double @llvm.fmuladd.f64(double %16, double %17, double %11)
%19 = tail call double @llvm.fmuladd.f64(double %1, double %18, double %10)
ret double %19
}