void construct_ppi_B(int i, double *q, double *qL, double *qR, double *dq,
                     double *dqVL, double *qh, int n) {
  double qi = *q;
  double qimo = *(q - 1);
  double qipo = *(q + 1);
  double dqi;
  double dqip = qipo - qi;
  double dqim = qi - qimo;
  double dqiVL;
  int ipo = i + 1;
  int imo = i - 1;
  double ba, bb, bc;
  double osix = 1. / 6.;
  qh[i] = q[i] + 0.5 * (q[ipo] - q[i]) - osix * (dqVL[ipo] - dqVL[i]);
  qL[i] = qh[i];
  qR[ipo] = qh[i];
}


x86 assembly (clang, -O0):
<construct_ppi_B>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movsd  -0x8(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x70(%rbp)
movsd  0xe81(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm1
movsd  0xe42(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x30(%rbp),%rax
movslq -0x4(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<construct_ppi_B>:
movslq %edi,%rax
movsd  (%rsi,%rax,8),%xmm0
movsd  0x8(%rsi,%rax,8),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xee6(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0x8(%r9,%rax,8),%xmm0
subsd  (%r9,%rax,8),%xmm0
mov    0x8(%rsp),%rsi
mulsd  0xed0(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsi,%rax,8)
movsd  %xmm0,(%rdx,%rax,8)
movsd  (%rsi,%rax,8),%xmm0
movsd  %xmm0,0x8(%rcx,%rax,8)
ret

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

LLVM IR (-O2):
define void @construct_ppi_B(i32 %0, double* nocapture %1, double* nocapture writeonly %2, double* nocapture writeonly %3, double* nocapture readnone %4, double* nocapture %5, double* nocapture %6, i32 %7) {
%9 = add nsw i32 %0, 1
%10 = sext i32 %0 to i64
%11 = getelementptr inbounds double, double* %1, i64 %10
%12 = load double, double* %11
%13 = sext i32 %9 to i64
%14 = getelementptr inbounds double, double* %1, i64 %13
%15 = load double, double* %14
%16 = fsub double %15, %12
%17 = tail call double @llvm.fmuladd.f64(double %16, double 5.000000e-01, double %12)
%18 = getelementptr inbounds double, double* %5, i64 %13
%19 = load double, double* %18
%20 = getelementptr inbounds double, double* %5, i64 %10
%21 = load double, double* %20
%22 = fsub double %19, %21
%23 = tail call double @llvm.fmuladd.f64(double %22, double 0xBFC5555555555555, double %17)
%24 = getelementptr inbounds double, double* %6, i64 %10
store double %23, double* %24
%25 = getelementptr inbounds double, double* %2, i64 %10
store double %23, double* %25
%26 = load double, double* %24
%27 = getelementptr inbounds double, double* %3, i64 %13
store double %26, double* %27
ret void
}