double LIMO3_Reconstruct(double *v, double dx, int i) {
  double dvp, dvm, r = 1.;
  double a, b, c, q, th, lim;
  double eta, psi, eps = 1.e-12;
  dvp = v[i + 1] - v[i];
  dvm = v[i] - v[i - 1];
  th = dvm / (dvp + 1.e-16);
  q = (2.0 + th) / 3.0;
  a = ((1.5) <= (2.0 * th) ? (1.5) : (2.0 * th));
  a = ((q) <= (a) ? (q) : (a));
  b = ((-0.5 * th) >= (a) ? (-0.5 * th) : (a));
  c = ((q) <= (b) ? (q) : (b));
  psi = ((0.0) >= (c) ? (0.0) : (c));
  eta = r * dx;
  eta = (dvm * dvm + dvp * dvp) / (eta * eta);
  if (eta <= 1.0 - eps) {
    lim = q;
  } else if (eta >= 1.0 + eps) {
    lim = psi;
  } else {
    psi = (1.0 - (eta - 1.0) / eps) * q + (1.0 + (eta - 1.0) / eps) * psi;
    lim = 0.5 * psi;
  }
  return (v[i] + 0.5 * dvp * lim);
}


x86 assembly (clang, -O0):
<LIMO3_Reconstruct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movsd  0xf0c(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xef7(%rip),%xmm0
movsd  %xmm0,-0x78(%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,-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)
movsd  -0x28(%rbp),%xmm0
movsd  0xe95(%rip),%xmm1
addsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe6f(%rip),%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  0xe6a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe51(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  0xe3c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11e0 <LIMO3_Reconstruct+0xe0>
movsd  0xe2a(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    11f2 <LIMO3_Reconstruct+0xf2>
movsd  0xe20(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x50(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1222 <LIMO3_Reconstruct+0x122>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
jmp    122f <LIMO3_Reconstruct+0x12f>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x38(%rbp)
movsd  0xdec(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
ucomisd -0x38(%rbp),%xmm0
jb     126e <LIMO3_Reconstruct+0x16e>
movsd  0xdd4(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
jmp    127b <LIMO3_Reconstruct+0x17b>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x40(%rbp)
movsd  -0x50(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     12ae <LIMO3_Reconstruct+0x1ae>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
jmp    12bb <LIMO3_Reconstruct+0x1bb>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x48(%rbp),%xmm0
jb     12e6 <LIMO3_Reconstruct+0x1e6>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
jmp    12f3 <LIMO3_Reconstruct+0x1f3>
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x70(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x68(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm1
movsd  0xcdd(%rip),%xmm0
subsd  -0x78(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1369 <LIMO3_Reconstruct+0x269>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1406 <LIMO3_Reconstruct+0x306>
movsd  -0x68(%rbp),%xmm0
movsd  0xcb2(%rip),%xmm1
addsd  -0x78(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jb     1394 <LIMO3_Reconstruct+0x294>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1401 <LIMO3_Reconstruct+0x301>
movsd  -0x68(%rbp),%xmm1
movsd  0xc87(%rip),%xmm0
subsd  %xmm0,%xmm1
divsd  -0x78(%rbp),%xmm1
movsd  0xc76(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm3
movsd  0xc60(%rip),%xmm1
subsd  %xmm1,%xmm3
divsd  -0x78(%rbp),%xmm3
movsd  0xc4f(%rip),%xmm1
addsd  %xmm3,%xmm1
mulsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xc41(%rip),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1406 <LIMO3_Reconstruct+0x306>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xc1d(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LIMO3_Reconstruct>:
movslq %esi,%rax
movupd (%rdi,%rax,8),%xmm1
movsd  -0x8(%rdi,%rax,8),%xmm2
unpcklpd %xmm1,%xmm2
movapd %xmm1,%xmm3
subpd  %xmm2,%xmm3
movapd %xmm3,%xmm2
unpckhpd %xmm3,%xmm2
movsd  0xed6(%rip),%xmm4
addsd  %xmm2,%xmm4
movapd %xmm3,%xmm5
divsd  %xmm4,%xmm5
movsd  0xeca(%rip),%xmm4
addsd  %xmm5,%xmm4
divsd  0xec6(%rip),%xmm4
movapd %xmm2,%xmm6
mulsd  %xmm2,%xmm6
mulsd  %xmm3,%xmm3
addsd  %xmm6,%xmm3
mulsd  %xmm0,%xmm0
divsd  %xmm0,%xmm3
movsd  0xebe(%rip),%xmm0
ucomisd %xmm3,%xmm0
jae    1234 <LIMO3_Reconstruct+0x134>
movapd %xmm5,%xmm0
addsd  %xmm5,%xmm0
movsd  0xe94(%rip),%xmm6
minsd  %xmm0,%xmm6
movapd %xmm4,%xmm0
cmplesd %xmm6,%xmm0
movapd %xmm0,%xmm7
andpd  %xmm4,%xmm7
andnpd %xmm6,%xmm0
orpd   %xmm7,%xmm0
mulsd  0xe77(%rip),%xmm5
movapd %xmm0,%xmm6
cmplesd %xmm5,%xmm6
movapd %xmm6,%xmm7
andnpd %xmm0,%xmm7
andpd  %xmm5,%xmm6
orpd   %xmm7,%xmm6
movapd %xmm4,%xmm0
cmplesd %xmm6,%xmm0
movapd %xmm0,%xmm5
andnpd %xmm6,%xmm5
andpd  %xmm4,%xmm0
orpd   %xmm5,%xmm0
xorpd  %xmm6,%xmm6
movapd %xmm0,%xmm5
cmplesd %xmm6,%xmm5
andnpd %xmm0,%xmm5
ucomisd 0xe3c(%rip),%xmm3
jae    1238 <LIMO3_Reconstruct+0x138>
addsd  0xe3a(%rip),%xmm3
divsd  0xe3a(%rip),%xmm3
movsd  0xe3a(%rip),%xmm0
movapd %xmm0,%xmm6
subsd  %xmm3,%xmm6
addsd  %xmm0,%xmm3
mulsd  %xmm5,%xmm3
mulsd  %xmm4,%xmm6
addsd  %xmm3,%xmm6
mulsd  0xe22(%rip),%xmm6
movapd %xmm6,%xmm5
jmp    1238 <LIMO3_Reconstruct+0x138>
movapd %xmm4,%xmm5
movsd  0xe10(%rip),%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm5,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @LIMO3_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
store double* %0, double** %4
store double %1, double* %5
store i32 %2, i32* %6
store double 1.000000e+00, double* %9
store double 0x3D719799812DEA11, double* %18
%19 = load double*, double** %4
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds double, double* %19, i64 %22
%24 = load double, double* %23
%25 = load double*, double** %4
%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 = fsub double %24, %29
store double %30, double* %7
%31 = load double*, double** %4
%32 = load i32, i32* %6
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double, double* %31, i64 %33
%35 = load double, double* %34
%36 = load double*, double** %4
%37 = load i32, i32* %6
%38 = sub nsw i32 %37, 1
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %36, i64 %39
%41 = load double, double* %40
%42 = fsub double %35, %41
store double %42, double* %8
%43 = load double, double* %8
%44 = load double, double* %7
%45 = fadd double %44, 0x3C9CD2B297D889BC
%46 = fdiv double %43, %45
store double %46, double* %14
%47 = load double, double* %14
%48 = fadd double 2.000000e+00, %47
%49 = fdiv double %48, 3.000000e+00
store double %49, double* %13
%50 = load double, double* %14
%51 = fmul double 2.000000e+00, %50
%52 = fcmp ole double 1.500000e+00, %51
br i1 %52, label %53, label %54
53: ; preds = %3
br label %57
54: ; preds = %3
%55 = load double, double* %14
%56 = fmul double 2.000000e+00, %55
br label %57
57: ; preds = %54, %53
%58 = phi double [ 1.500000e+00, %53 ], [ %56, %54 ]
store double %58, double* %10
%59 = load double, double* %13
%60 = load double, double* %10
%61 = fcmp ole double %59, %60
br i1 %61, label %62, label %64
62: ; preds = %57
%63 = load double, double* %13
br label %66
64: ; preds = %57
%65 = load double, double* %10
br label %66
66: ; preds = %64, %62
%67 = phi double [ %63, %62 ], [ %65, %64 ]
store double %67, double* %10
%68 = load double, double* %14
%69 = fmul double -5.000000e-01, %68
%70 = load double, double* %10
%71 = fcmp oge double %69, %70
br i1 %71, label %72, label %75
72: ; preds = %66
%73 = load double, double* %14
%74 = fmul double -5.000000e-01, %73
br label %77
75: ; preds = %66
%76 = load double, double* %10
br label %77
77: ; preds = %75, %72
%78 = phi double [ %74, %72 ], [ %76, %75 ]
store double %78, double* %11
%79 = load double, double* %13
%80 = load double, double* %11
%81 = fcmp ole double %79, %80
br i1 %81, label %82, label %84
82: ; preds = %77
%83 = load double, double* %13
br label %86
84: ; preds = %77
%85 = load double, double* %11
br label %86
86: ; preds = %84, %82
%87 = phi double [ %83, %82 ], [ %85, %84 ]
store double %87, double* %12
%88 = load double, double* %12
%89 = fcmp oge double 0.000000e+00, %88
br i1 %89, label %90, label %91
90: ; preds = %86
br label %93
91: ; preds = %86
%92 = load double, double* %12
br label %93
93: ; preds = %91, %90
%94 = phi double [ 0.000000e+00, %90 ], [ %92, %91 ]
store double %94, double* %17
%95 = load double, double* %9
%96 = load double, double* %5
%97 = fmul double %95, %96
store double %97, double* %16
%98 = load double, double* %8
%99 = load double, double* %8
%100 = load double, double* %7
%101 = load double, double* %7
%102 = fmul double %100, %101
%103 = call double @llvm.fmuladd.f64(double %98, double %99, double %102)
%104 = load double, double* %16
%105 = load double, double* %16
%106 = fmul double %104, %105
%107 = fdiv double %103, %106
store double %107, double* %16
%108 = load double, double* %16
%109 = load double, double* %18
%110 = fsub double 1.000000e+00, %109
%111 = fcmp ole double %108, %110
br i1 %111, label %112, label %114
112: ; preds = %93
%113 = load double, double* %13
store double %113, double* %15
br label %139
114: ; preds = %93
%115 = load double, double* %16
%116 = load double, double* %18
%117 = fadd double 1.000000e+00, %116
%118 = fcmp oge double %115, %117
br i1 %118, label %119, label %121
119: ; preds = %114
%120 = load double, double* %17
store double %120, double* %15
br label %138
121: ; preds = %114
%122 = load double, double* %16
%123 = fsub double %122, 1.000000e+00
%124 = load double, double* %18
%125 = fdiv double %123, %124
%126 = fsub double 1.000000e+00, %125
%127 = load double, double* %13
%128 = load double, double* %16
%129 = fsub double %128, 1.000000e+00
%130 = load double, double* %18
%131 = fdiv double %129, %130
%132 = fadd double 1.000000e+00, %131
%133 = load double, double* %17
%134 = fmul double %132, %133
%135 = call double @llvm.fmuladd.f64(double %126, double %127, double %134)
store double %135, double* %17
%136 = load double, double* %17
%137 = fmul double 5.000000e-01, %136
store double %137, double* %15
br label %138
138: ; preds = %121, %119
br label %139
139: ; preds = %138, %112
%140 = load double*, double** %4
%141 = load i32, i32* %6
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds double, double* %140, i64 %142
%144 = load double, double* %143
%145 = load double, double* %7
%146 = fmul double 5.000000e-01, %145
%147 = load double, double* %15
%148 = call double @llvm.fmuladd.f64(double %146, double %147, double %144)
ret double %148
}

LLVM IR (-O2):
define double @LIMO3_Reconstruct(double* nocapture %0, double %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds double, double* %0, i64 %4
%6 = bitcast double* %5 to <2 x double>*
%7 = load <2 x double>, <2 x double>* %6
%8 = add nsw i32 %2, -1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds double, double* %0, i64 %9
%11 = load double, double* %10
%12 = insertelement <2 x double> poison, double %11, i64 0
%13 = shufflevector <2 x double> %12, <2 x double> %7, <2 x i32> <i32 0, i32 2>
%14 = fsub <2 x double> %7, %13
%15 = extractelement <2 x double> %14, i64 1
%16 = fadd double %15, 0x3C9CD2B297D889BC
%17 = extractelement <2 x double> %14, i64 0
%18 = fdiv double %17, %16
%19 = fadd double %18, 2.000000e+00
%20 = fdiv double %19, 3.000000e+00
%21 = fmul double %18, 2.000000e+00
%22 = fcmp oge double %21, 1.500000e+00
%23 = select i1 %22, double 1.500000e+00, double %21
%24 = fcmp ole double %20, %23
%25 = select i1 %24, double %20, double %23
%26 = fmul double %18, -5.000000e-01
%27 = fcmp oge double %26, %25
%28 = select i1 %27, double %26, double %25
%29 = fcmp ole double %20, %28
%30 = select i1 %29, double %20, double %28
%31 = fcmp ole double %30, 0.000000e+00
%32 = select i1 %31, double 0.000000e+00, double %30
%33 = fmul double %15, %15
%34 = tail call double @llvm.fmuladd.f64(double %17, double %17, double %33)
%35 = fmul double %1, %1
%36 = fdiv double %34, %35
%37 = fcmp ugt double %36, 0x3FEFFFFFFFFFDCD1
br i1 %37, label %38, label %48
38: ; preds = %3
%39 = fcmp ult double %36, 0x3FF0000000001198
br i1 %39, label %40, label %48
40: ; preds = %38
%41 = fadd double %36, -1.000000e+00
%42 = fdiv double %41, 0x3D719799812DEA11
%43 = fsub double 1.000000e+00, %42
%44 = fadd double %42, 1.000000e+00
%45 = fmul double %44, %32
%46 = tail call double @llvm.fmuladd.f64(double %43, double %20, double %45)
%47 = fmul double %46, 5.000000e-01
br label %48
48: ; preds = %38, %3, %40
%49 = phi double [ %47, %40 ], [ %20, %3 ], [ %32, %38 ]
%50 = extractelement <2 x double> %7, i64 0
%51 = fmul double %15, 5.000000e-01
%52 = tail call double @llvm.fmuladd.f64(double %51, double %49, double %50)
ret double %52
}