double PPM_Reconstruct(double *v, double dx, int i) {
  double dvm2, dvm1, dvp1, dvp2;
  double dvc, Sm1, Sp1, Sp2, SM;
  double ap, am, vp, vm;
  dvm2 = v[i - 1] - v[i - 2];
  dvm1 = v[i] - v[i - 1];
  dvp1 = v[i + 1] - v[i];
  dvp2 = v[i + 2] - v[i + 1];
  dvc = 0.5 * (dvm2 + dvm1);
  SM =
      2.0 * ((dvm2) * (dvm1) > 0.0 ? (fabs(dvm2) < fabs(dvm1) ? (dvm2) : (dvm1))
                                   : 0.0);
  Sm1 = ((dvc) * (SM) > 0.0 ? (fabs(dvc) < fabs(SM) ? (dvc) : (SM)) : 0.0);
  dvc = 0.5 * (dvm1 + dvp1);
  SM =
      2.0 * ((dvm1) * (dvp1) > 0.0 ? (fabs(dvm1) < fabs(dvp1) ? (dvm1) : (dvp1))
                                   : 0.0);
  Sp1 = ((dvc) * (SM) > 0.0 ? (fabs(dvc) < fabs(SM) ? (dvc) : (SM)) : 0.0);
  dvc = 0.5 * (dvp2 + dvp1);
  SM =
      2.0 * ((dvp2) * (dvp1) > 0.0 ? (fabs(dvp2) < fabs(dvp1) ? (dvp2) : (dvp1))
                                   : 0.0);
  Sp2 = ((dvc) * (SM) > 0.0 ? (fabs(dvc) < fabs(SM) ? (dvc) : (SM)) : 0.0);
  vp = 0.5 * (v[i] + v[i + 1]) - (Sp2 - Sp1) / 6.0;
  vm = 0.5 * (v[i] + v[i - 1]) - (Sp1 - Sm1) / 6.0;
  ap = vp - v[i];
  am = vm - v[i];
  if (ap * am >= 0.0) {
    ap = am = 0.0;
  } else {
    if (fabs(ap) >= 2.0 * fabs(am))
      ap = -2.0 * am;
    if (fabs(am) >= 2.0 * fabs(ap))
      am = -2.0 * ap;
  }
  vp = v[i] + ap;
  return vp;
}


x86 assembly (clang, -O0):
<PPM_Reconstruct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm1
addsd  -0x28(%rbp),%xmm1
movsd  0xe40(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    123e <PPM_Reconstruct+0x13e>
movsd  -0x20(%rbp),%xmm1
movaps 0xe34(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
movaps 0xe24(%rip),%xmm2
pand   %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    121c <PPM_Reconstruct+0x11c>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
jmp    1229 <PPM_Reconstruct+0x129>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x90(%rbp)
ff
jmp    124e <PPM_Reconstruct+0x14e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
jmp    124e <PPM_Reconstruct+0x14e>
movsd  -0x90(%rbp),%xmm1
ff
movsd  0xdaa(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    12dc <PPM_Reconstruct+0x1dc>
movsd  -0x40(%rbp),%xmm1
movaps 0xd96(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
movaps 0xd86(%rip),%xmm2
pand   %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    12ba <PPM_Reconstruct+0x1ba>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
jmp    12c7 <PPM_Reconstruct+0x1c7>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
jmp    12ec <PPM_Reconstruct+0x1ec>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
jmp    12ec <PPM_Reconstruct+0x1ec>
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm1
addsd  -0x30(%rbp),%xmm1
movsd  0xcf5(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1389 <PPM_Reconstruct+0x289>
movsd  -0x28(%rbp),%xmm1
movaps 0xce9(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
movaps 0xcd9(%rip),%xmm2
pand   %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    1367 <PPM_Reconstruct+0x267>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
jmp    1374 <PPM_Reconstruct+0x274>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
jmp    1399 <PPM_Reconstruct+0x299>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
jmp    1399 <PPM_Reconstruct+0x299>
movsd  -0xb0(%rbp),%xmm1
ff
movsd  0xc5f(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1427 <PPM_Reconstruct+0x327>
movsd  -0x40(%rbp),%xmm1
movaps 0xc4b(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
movaps 0xc3b(%rip),%xmm2
pand   %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    1405 <PPM_Reconstruct+0x305>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
jmp    1412 <PPM_Reconstruct+0x312>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
jmp    1437 <PPM_Reconstruct+0x337>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
jmp    1437 <PPM_Reconstruct+0x337>
movsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm1
addsd  -0x30(%rbp),%xmm1
movsd  0xbaa(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    14d4 <PPM_Reconstruct+0x3d4>
movsd  -0x38(%rbp),%xmm1
movaps 0xb9e(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
movaps 0xb8e(%rip),%xmm2
pand   %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    14b2 <PPM_Reconstruct+0x3b2>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
jmp    14bf <PPM_Reconstruct+0x3bf>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
jmp    14e4 <PPM_Reconstruct+0x3e4>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
jmp    14e4 <PPM_Reconstruct+0x3e4>
movsd  -0xd0(%rbp),%xmm1
ff
movsd  0xb14(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1572 <PPM_Reconstruct+0x472>
movsd  -0x40(%rbp),%xmm1
movaps 0xb00(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
movaps 0xaf0(%rip),%xmm2
pand   %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    1550 <PPM_Reconstruct+0x450>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
jmp    155d <PPM_Reconstruct+0x45d>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
jmp    1582 <PPM_Reconstruct+0x482>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
jmp    1582 <PPM_Reconstruct+0x482>
movsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0x58(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  -0x58(%rbp),%xmm1
subsd  -0x50(%rbp),%xmm1
movsd  0xa50(%rip),%xmm2
divsd  %xmm2,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xa1d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  -0x50(%rbp),%xmm1
subsd  -0x48(%rbp),%xmm1
movsd  0x9ef(%rip),%xmm2
divsd  %xmm2,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0x9bc(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x78(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x80(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     16ab <PPM_Reconstruct+0x5ab>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    1740 <PPM_Reconstruct+0x640>
movsd  -0x68(%rbp),%xmm0
movaps 0x969(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0x70(%rbp),%xmm2
movaps 0x959(%rip),%xmm1
pand   %xmm1,%xmm2
movsd  0x935(%rip),%xmm1
mulsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jb     16f3 <PPM_Reconstruct+0x5f3>
movsd  0x92f(%rip),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x70(%rbp),%xmm0
movaps 0x921(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0x68(%rbp),%xmm2
movaps 0x911(%rip),%xmm1
pand   %xmm1,%xmm2
movsd  0x8ed(%rip),%xmm1
mulsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jb     173b <PPM_Reconstruct+0x63b>
movsd  0x8e7(%rip),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    1740 <PPM_Reconstruct+0x640>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PPM_Reconstruct>:
movslq %esi,%rax
movupd -0x8(%rdi,%rax,8),%xmm0
movsd  -0x10(%rdi,%rax,8),%xmm1
unpcklpd %xmm0,%xmm1
movapd %xmm0,%xmm5
subpd  %xmm1,%xmm5
movupd 0x8(%rdi,%rax,8),%xmm8
movapd %xmm8,%xmm9
shufpd $0x1,%xmm8,%xmm9
movapd %xmm0,%xmm7
movsd  %xmm8,%xmm7
movapd %xmm5,%xmm1
unpckhpd %xmm5,%xmm1
movapd %xmm5,%xmm4
addsd  %xmm1,%xmm4
mulsd  0xeb2(%rip),%xmm4
movapd %xmm1,%xmm6
mulsd  %xmm5,%xmm6
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm6
xorpd  %xmm6,%xmm6
jbe    118e <PPM_Reconstruct+0x8e>
movapd %xmm5,%xmm6
andpd  0xea0(%rip),%xmm6
pshufd $0xee,%xmm6,%xmm3
cmpltsd %xmm3,%xmm6
movapd %xmm6,%xmm3
andpd  %xmm5,%xmm3
andnpd %xmm1,%xmm6
orpd   %xmm3,%xmm6
addsd  %xmm6,%xmm6
subpd  %xmm7,%xmm9
movapd %xmm4,%xmm3
mulsd  %xmm6,%xmm3
ucomisd %xmm2,%xmm3
jbe    11c6 <PPM_Reconstruct+0xc6>
movapd 0xe67(%rip),%xmm3
movapd %xmm4,%xmm2
andpd  %xmm3,%xmm2
andpd  %xmm6,%xmm3
cmpltsd %xmm3,%xmm2
andpd  %xmm2,%xmm4
andnpd %xmm6,%xmm2
orpd   %xmm4,%xmm2
movapd %xmm9,%xmm6
unpckhpd %xmm9,%xmm6
movapd %xmm1,%xmm7
addsd  %xmm6,%xmm7
mulsd  0xe20(%rip),%xmm7
movapd %xmm6,%xmm3
mulsd  %xmm1,%xmm3
xorpd  %xmm4,%xmm4
ucomisd %xmm4,%xmm3
xorpd  %xmm5,%xmm5
jbe    1223 <PPM_Reconstruct+0x123>
movapd 0xe12(%rip),%xmm3
movapd %xmm1,%xmm5
andpd  %xmm3,%xmm5
andpd  %xmm6,%xmm3
cmpltsd %xmm3,%xmm5
movapd %xmm5,%xmm3
andpd  %xmm1,%xmm3
andnpd %xmm6,%xmm5
orpd   %xmm3,%xmm5
addsd  %xmm5,%xmm5
movapd %xmm7,%xmm1
mulsd  %xmm5,%xmm1
ucomisd %xmm4,%xmm1
jbe    1256 <PPM_Reconstruct+0x156>
movapd 0xdd7(%rip),%xmm1
movapd %xmm7,%xmm4
andpd  %xmm1,%xmm4
andpd  %xmm5,%xmm1
cmpltsd %xmm1,%xmm4
andpd  %xmm4,%xmm7
andnpd %xmm5,%xmm4
orpd   %xmm7,%xmm4
movapd %xmm6,%xmm7
addsd  %xmm9,%xmm7
mulsd  0xd99(%rip),%xmm7
movapd %xmm6,%xmm1
mulsd  %xmm9,%xmm1
xorpd  %xmm5,%xmm5
ucomisd %xmm5,%xmm1
xorpd  %xmm1,%xmm1
jbe    12aa <PPM_Reconstruct+0x1aa>
movapd %xmm9,%xmm1
andpd  0xd85(%rip),%xmm1
pshufd $0xee,%xmm1,%xmm3
cmpltsd %xmm3,%xmm1
movapd %xmm1,%xmm3
andpd  %xmm9,%xmm3
andnpd %xmm6,%xmm1
orpd   %xmm3,%xmm1
addsd  %xmm1,%xmm1
movapd %xmm7,%xmm3
mulsd  %xmm1,%xmm3
ucomisd %xmm5,%xmm3
jbe    12dd <PPM_Reconstruct+0x1dd>
movapd 0xd50(%rip),%xmm3
movapd %xmm7,%xmm5
andpd  %xmm3,%xmm5
andpd  %xmm1,%xmm3
cmpltsd %xmm3,%xmm5
andpd  %xmm5,%xmm7
andnpd %xmm1,%xmm5
orpd   %xmm7,%xmm5
movapd %xmm0,%xmm3
shufpd $0x1,%xmm8,%xmm3
addpd  %xmm0,%xmm3
unpcklpd %xmm4,%xmm2
unpcklpd %xmm5,%xmm4
subpd  %xmm2,%xmm4
divpd  0xd21(%rip),%xmm4
mulpd  0xd29(%rip),%xmm3
addpd  %xmm4,%xmm3
unpckhpd %xmm0,%xmm0
subpd  %xmm0,%xmm3
movapd %xmm3,%xmm1
unpckhpd %xmm3,%xmm1
movapd %xmm3,%xmm4
mulsd  %xmm1,%xmm4
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm4
jae    135e <PPM_Reconstruct+0x25e>
movapd 0xcdb(%rip),%xmm2
movapd %xmm1,%xmm4
andpd  %xmm2,%xmm4
andpd  %xmm3,%xmm2
addsd  %xmm2,%xmm2
mulsd  0xcbb(%rip),%xmm3
cmpnlesd %xmm4,%xmm2
andpd  %xmm2,%xmm1
andnpd %xmm3,%xmm2
orpd   %xmm1,%xmm2
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @PPM_Reconstruct(double* %0, double %1, i32 %2) {
%4 = alloca double*
%5 = alloca double
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
%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
store double* %0, double** %4
store double %1, double* %5
store i32 %2, i32* %6
%20 = load double*, double** %4
%21 = load i32, i32* %6
%22 = sub nsw i32 %21, 1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds double, double* %20, i64 %23
%25 = load double, double* %24
%26 = load double*, double** %4
%27 = load i32, i32* %6
%28 = sub nsw i32 %27, 2
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %26, i64 %29
%31 = load double, double* %30
%32 = fsub double %25, %31
store double %32, double* %7
%33 = load double*, double** %4
%34 = load i32, i32* %6
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double, double* %33, i64 %35
%37 = load double, double* %36
%38 = load double*, double** %4
%39 = load i32, i32* %6
%40 = sub nsw i32 %39, 1
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds double, double* %38, i64 %41
%43 = load double, double* %42
%44 = fsub double %37, %43
store double %44, double* %8
%45 = load double*, double** %4
%46 = load i32, i32* %6
%47 = add nsw i32 %46, 1
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds double, double* %45, i64 %48
%50 = load double, double* %49
%51 = load double*, double** %4
%52 = load i32, i32* %6
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds double, double* %51, i64 %53
%55 = load double, double* %54
%56 = fsub double %50, %55
store double %56, double* %9
%57 = load double*, double** %4
%58 = load i32, i32* %6
%59 = add nsw i32 %58, 2
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds double, double* %57, i64 %60
%62 = load double, double* %61
%63 = load double*, double** %4
%64 = load i32, i32* %6
%65 = add nsw i32 %64, 1
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds double, double* %63, i64 %66
%68 = load double, double* %67
%69 = fsub double %62, %68
store double %69, double* %10
%70 = load double, double* %7
%71 = load double, double* %8
%72 = fadd double %70, %71
%73 = fmul double 5.000000e-01, %72
store double %73, double* %11
%74 = load double, double* %7
%75 = load double, double* %8
%76 = fmul double %74, %75
%77 = fcmp ogt double %76, 0.000000e+00
br i1 %77, label %78, label %90
78: ; preds = %3
%79 = load double, double* %7
%80 = call double @llvm.fabs.f64(double %79)
%81 = load double, double* %8
%82 = call double @llvm.fabs.f64(double %81)
%83 = fcmp olt double %80, %82
br i1 %83, label %84, label %86
84: ; preds = %78
%85 = load double, double* %7
br label %88
86: ; preds = %78
%87 = load double, double* %8
br label %88
88: ; preds = %86, %84
%89 = phi double [ %85, %84 ], [ %87, %86 ]
br label %91
90: ; preds = %3
br label %91
91: ; preds = %90, %88
%92 = phi double [ %89, %88 ], [ 0.000000e+00, %90 ]
%93 = fmul double 2.000000e+00, %92
store double %93, double* %15
%94 = load double, double* %11
%95 = load double, double* %15
%96 = fmul double %94, %95
%97 = fcmp ogt double %96, 0.000000e+00
br i1 %97, label %98, label %110
98: ; preds = %91
%99 = load double, double* %11
%100 = call double @llvm.fabs.f64(double %99)
%101 = load double, double* %15
%102 = call double @llvm.fabs.f64(double %101)
%103 = fcmp olt double %100, %102
br i1 %103, label %104, label %106
104: ; preds = %98
%105 = load double, double* %11
br label %108
106: ; preds = %98
%107 = load double, double* %15
br label %108
108: ; preds = %106, %104
%109 = phi double [ %105, %104 ], [ %107, %106 ]
br label %111
110: ; preds = %91
br label %111
111: ; preds = %110, %108
%112 = phi double [ %109, %108 ], [ 0.000000e+00, %110 ]
store double %112, double* %12
%113 = load double, double* %8
%114 = load double, double* %9
%115 = fadd double %113, %114
%116 = fmul double 5.000000e-01, %115
store double %116, double* %11
%117 = load double, double* %8
%118 = load double, double* %9
%119 = fmul double %117, %118
%120 = fcmp ogt double %119, 0.000000e+00
br i1 %120, label %121, label %133
121: ; preds = %111
%122 = load double, double* %8
%123 = call double @llvm.fabs.f64(double %122)
%124 = load double, double* %9
%125 = call double @llvm.fabs.f64(double %124)
%126 = fcmp olt double %123, %125
br i1 %126, label %127, label %129
127: ; preds = %121
%128 = load double, double* %8
br label %131
129: ; preds = %121
%130 = load double, double* %9
br label %131
131: ; preds = %129, %127
%132 = phi double [ %128, %127 ], [ %130, %129 ]
br label %134
133: ; preds = %111
br label %134
134: ; preds = %133, %131
%135 = phi double [ %132, %131 ], [ 0.000000e+00, %133 ]
%136 = fmul double 2.000000e+00, %135
store double %136, double* %15
%137 = load double, double* %11
%138 = load double, double* %15
%139 = fmul double %137, %138
%140 = fcmp ogt double %139, 0.000000e+00
br i1 %140, label %141, label %153
141: ; preds = %134
%142 = load double, double* %11
%143 = call double @llvm.fabs.f64(double %142)
%144 = load double, double* %15
%145 = call double @llvm.fabs.f64(double %144)
%146 = fcmp olt double %143, %145
br i1 %146, label %147, label %149
147: ; preds = %141
%148 = load double, double* %11
br label %151
149: ; preds = %141
%150 = load double, double* %15
br label %151
151: ; preds = %149, %147
%152 = phi double [ %148, %147 ], [ %150, %149 ]
br label %154
153: ; preds = %134
br label %154
154: ; preds = %153, %151
%155 = phi double [ %152, %151 ], [ 0.000000e+00, %153 ]
store double %155, double* %13
%156 = load double, double* %10
%157 = load double, double* %9
%158 = fadd double %156, %157
%159 = fmul double 5.000000e-01, %158
store double %159, double* %11
%160 = load double, double* %10
%161 = load double, double* %9
%162 = fmul double %160, %161
%163 = fcmp ogt double %162, 0.000000e+00
br i1 %163, label %164, label %176
164: ; preds = %154
%165 = load double, double* %10
%166 = call double @llvm.fabs.f64(double %165)
%167 = load double, double* %9
%168 = call double @llvm.fabs.f64(double %167)
%169 = fcmp olt double %166, %168
br i1 %169, label %170, label %172
170: ; preds = %164
%171 = load double, double* %10
br label %174
172: ; preds = %164
%173 = load double, double* %9
br label %174
174: ; preds = %172, %170
%175 = phi double [ %171, %170 ], [ %173, %172 ]
br label %177
176: ; preds = %154
br label %177
177: ; preds = %176, %174
%178 = phi double [ %175, %174 ], [ 0.000000e+00, %176 ]
%179 = fmul double 2.000000e+00, %178
store double %179, double* %15
%180 = load double, double* %11
%181 = load double, double* %15
%182 = fmul double %180, %181
%183 = fcmp ogt double %182, 0.000000e+00
br i1 %183, label %184, label %196
184: ; preds = %177
%185 = load double, double* %11
%186 = call double @llvm.fabs.f64(double %185)
%187 = load double, double* %15
%188 = call double @llvm.fabs.f64(double %187)
%189 = fcmp olt double %186, %188
br i1 %189, label %190, label %192
190: ; preds = %184
%191 = load double, double* %11
br label %194
192: ; preds = %184
%193 = load double, double* %15
br label %194
194: ; preds = %192, %190
%195 = phi double [ %191, %190 ], [ %193, %192 ]
br label %197
196: ; preds = %177
br label %197
197: ; preds = %196, %194
%198 = phi double [ %195, %194 ], [ 0.000000e+00, %196 ]
store double %198, double* %14
%199 = load double*, double** %4
%200 = load i32, i32* %6
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds double, double* %199, i64 %201
%203 = load double, double* %202
%204 = load double*, double** %4
%205 = load i32, i32* %6
%206 = add nsw i32 %205, 1
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds double, double* %204, i64 %207
%209 = load double, double* %208
%210 = fadd double %203, %209
%211 = load double, double* %14
%212 = load double, double* %13
%213 = fsub double %211, %212
%214 = fdiv double %213, 6.000000e+00
%215 = fneg double %214
%216 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %210, double %215)
store double %216, double* %18
%217 = load double*, double** %4
%218 = load i32, i32* %6
%219 = sext i32 %218 to i64
%220 = getelementptr inbounds double, double* %217, i64 %219
%221 = load double, double* %220
%222 = load double*, double** %4
%223 = load i32, i32* %6
%224 = sub nsw i32 %223, 1
%225 = sext i32 %224 to i64
%226 = getelementptr inbounds double, double* %222, i64 %225
%227 = load double, double* %226
%228 = fadd double %221, %227
%229 = load double, double* %13
%230 = load double, double* %12
%231 = fsub double %229, %230
%232 = fdiv double %231, 6.000000e+00
%233 = fneg double %232
%234 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %228, double %233)
store double %234, double* %19
%235 = load double, double* %18
%236 = load double*, double** %4
%237 = load i32, i32* %6
%238 = sext i32 %237 to i64
%239 = getelementptr inbounds double, double* %236, i64 %238
%240 = load double, double* %239
%241 = fsub double %235, %240
store double %241, double* %16
%242 = load double, double* %19
%243 = load double*, double** %4
%244 = load i32, i32* %6
%245 = sext i32 %244 to i64
%246 = getelementptr inbounds double, double* %243, i64 %245
%247 = load double, double* %246
%248 = fsub double %242, %247
store double %248, double* %17
%249 = load double, double* %16
%250 = load double, double* %17
%251 = fmul double %249, %250
%252 = fcmp oge double %251, 0.000000e+00
br i1 %252, label %253, label %254
253: ; preds = %197
store double 0.000000e+00, double* %17
store double 0.000000e+00, double* %16
br label %275
254: ; preds = %197
%255 = load double, double* %16
%256 = call double @llvm.fabs.f64(double %255)
%257 = load double, double* %17
%258 = call double @llvm.fabs.f64(double %257)
%259 = fmul double 2.000000e+00, %258
%260 = fcmp oge double %256, %259
br i1 %260, label %261, label %264
261: ; preds = %254
%262 = load double, double* %17
%263 = fmul double -2.000000e+00, %262
store double %263, double* %16
br label %264
264: ; preds = %261, %254
%265 = load double, double* %17
%266 = call double @llvm.fabs.f64(double %265)
%267 = load double, double* %16
%268 = call double @llvm.fabs.f64(double %267)
%269 = fmul double 2.000000e+00, %268
%270 = fcmp oge double %266, %269
br i1 %270, label %271, label %274
271: ; preds = %264
%272 = load double, double* %16
%273 = fmul double -2.000000e+00, %272
store double %273, double* %17
br label %274
274: ; preds = %271, %264
br label %275
275: ; preds = %274, %253
%276 = load double*, double** %4
%277 = load i32, i32* %6
%278 = sext i32 %277 to i64
%279 = getelementptr inbounds double, double* %276, i64 %278
%280 = load double, double* %279
%281 = load double, double* %16
%282 = fadd double %280, %281
store double %282, double* %18
%283 = load double, double* %18
ret double %283
}

LLVM IR (-O2):
define double @PPM_Reconstruct(double* nocapture %0, double %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds double, double* %0, i64 %5
%7 = add nsw i32 %2, -2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds double, double* %0, i64 %8
%10 = load double, double* %9
%11 = bitcast double* %6 to <2 x double>*
%12 = load <2 x double>, <2 x double>* %11
%13 = insertelement <2 x double> poison, double %10, i64 0
%14 = shufflevector <2 x double> %13, <2 x double> %12, <2 x i32> <i32 0, i32 2>
%15 = fsub <2 x double> %12, %14
%16 = add nsw i32 %2, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %0, i64 %17
%19 = bitcast double* %18 to <2 x double>*
%20 = load <2 x double>, <2 x double>* %19
%21 = shufflevector <2 x double> %20, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%22 = shufflevector <2 x double> %20, <2 x double> %12, <2 x i32> <i32 0, i32 3>
%23 = fsub <2 x double> %21, %22
%24 = extractelement <2 x double> %15, i64 0
%25 = extractelement <2 x double> %15, i64 1
%26 = fadd double %24, %25
%27 = fmul double %26, 5.000000e-01
%28 = fmul double %24, %25
%29 = fcmp ogt double %28, 0.000000e+00
br i1 %29, label %30, label %37
30: ; preds = %3
%31 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %15)
%32 = extractelement <2 x double> %31, i64 0
%33 = extractelement <2 x double> %31, i64 1
%34 = fcmp olt double %32, %33
%35 = select i1 %34, double %24, double %25
%36 = fmul double %35, 2.000000e+00
br label %37
37: ; preds = %3, %30
%38 = phi double [ %36, %30 ], [ 0.000000e+00, %3 ]
%39 = fmul double %27, %38
%40 = fcmp ogt double %39, 0.000000e+00
br i1 %40, label %41, label %46
41: ; preds = %37
%42 = tail call double @llvm.fabs.f64(double %27)
%43 = tail call double @llvm.fabs.f64(double %38)
%44 = fcmp olt double %42, %43
%45 = select i1 %44, double %27, double %38
br label %46
46: ; preds = %37, %41
%47 = phi double [ %45, %41 ], [ 0.000000e+00, %37 ]
%48 = extractelement <2 x double> %23, i64 1
%49 = fadd double %25, %48
%50 = fmul double %49, 5.000000e-01
%51 = fmul double %25, %48
%52 = fcmp ogt double %51, 0.000000e+00
br i1 %52, label %53, label %59
53: ; preds = %46
%54 = tail call double @llvm.fabs.f64(double %25)
%55 = tail call double @llvm.fabs.f64(double %48)
%56 = fcmp olt double %54, %55
%57 = select i1 %56, double %25, double %48
%58 = fmul double %57, 2.000000e+00
br label %59
59: ; preds = %46, %53
%60 = phi double [ %58, %53 ], [ 0.000000e+00, %46 ]
%61 = fmul double %50, %60
%62 = fcmp ogt double %61, 0.000000e+00
br i1 %62, label %63, label %68
63: ; preds = %59
%64 = tail call double @llvm.fabs.f64(double %50)
%65 = tail call double @llvm.fabs.f64(double %60)
%66 = fcmp olt double %64, %65
%67 = select i1 %66, double %50, double %60
br label %68
68: ; preds = %59, %63
%69 = phi double [ %67, %63 ], [ 0.000000e+00, %59 ]
%70 = extractelement <2 x double> %23, i64 0
%71 = fadd double %48, %70
%72 = fmul double %71, 5.000000e-01
%73 = fmul double %48, %70
%74 = fcmp ogt double %73, 0.000000e+00
br i1 %74, label %75, label %82
75: ; preds = %68
%76 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %23)
%77 = extractelement <2 x double> %76, i64 0
%78 = extractelement <2 x double> %76, i64 1
%79 = fcmp olt double %77, %78
%80 = select i1 %79, double %70, double %48
%81 = fmul double %80, 2.000000e+00
br label %82
82: ; preds = %68, %75
%83 = phi double [ %81, %75 ], [ 0.000000e+00, %68 ]
%84 = fmul double %72, %83
%85 = fcmp ogt double %84, 0.000000e+00
br i1 %85, label %86, label %91
86: ; preds = %82
%87 = tail call double @llvm.fabs.f64(double %72)
%88 = tail call double @llvm.fabs.f64(double %83)
%89 = fcmp olt double %87, %88
%90 = select i1 %89, double %72, double %83
br label %91
91: ; preds = %82, %86
%92 = phi double [ %90, %86 ], [ 0.000000e+00, %82 ]
%93 = shufflevector <2 x double> %20, <2 x double> %12, <2 x i32> <i32 3, i32 0>
%94 = fadd <2 x double> %12, %93
%95 = insertelement <2 x double> poison, double %69, i64 0
%96 = insertelement <2 x double> %95, double %92, i64 1
%97 = insertelement <2 x double> poison, double %47, i64 0
%98 = insertelement <2 x double> %97, double %69, i64 1
%99 = fsub <2 x double> %96, %98
%100 = fdiv <2 x double> %99, <double -6.000000e+00, double -6.000000e+00>
%101 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %94, <2 x double> <double 5.000000e-01, double 5.000000e-01>, <2 x double> %100)
%102 = shufflevector <2 x double> %12, <2 x double> undef, <2 x i32> <i32 1, i32 1>
%103 = fsub <2 x double> %101, %102
%104 = extractelement <2 x double> %103, i64 0
%105 = extractelement <2 x double> %103, i64 1
%106 = fmul double %104, %105
%107 = fcmp ult double %106, 0.000000e+00
br i1 %107, label %108, label %115
108: ; preds = %91
%109 = tail call double @llvm.fabs.f64(double %105)
%110 = tail call double @llvm.fabs.f64(double %104)
%111 = fmul double %110, 2.000000e+00
%112 = fcmp ult double %109, %111
%113 = fmul double %104, -2.000000e+00
%114 = select i1 %112, double %105, double %113
br label %115
115: ; preds = %108, %91
%116 = phi double [ 0.000000e+00, %91 ], [ %114, %108 ]
%117 = extractelement <2 x double> %12, i64 1
%118 = fadd double %117, %116
ret double %118
}