double PhiF(double R, double *phi0, double *MRV, int Grid_Num) {
  int mp_min, mp_max, m, po;
  double h1, h2, h3, f1, f2, f3, f4;
  double g1, g2, x1, x2, y1, y2, f, df;
  double a, b, rm, y12, y22, result;
  mp_min = 0;
  mp_max = Grid_Num - 1;
  po = 0;
  if (MRV[Grid_Num - 1] < R) {
    result = 0.0;
    po = 1;
  } else if (R < MRV[0]) {
    po = 1;
    m = 4;
    rm = MRV[m];
    h1 = MRV[m - 1] - MRV[m - 2];
    h2 = MRV[m] - MRV[m - 1];
    h3 = MRV[m + 1] - MRV[m];
    f1 = phi0[m - 2];
    f2 = phi0[m - 1];
    f3 = phi0[m];
    f4 = phi0[m + 1];
    g1 = ((f3 - f2) * h1 / h2 + (f2 - f1) * h2 / h1) / (h1 + h2);
    g2 = ((f4 - f3) * h2 / h3 + (f3 - f2) * h3 / h2) / (h2 + h3);
    x1 = rm - MRV[m - 1];
    x2 = rm - MRV[m];
    y1 = x1 / h2;
    y2 = x2 / h2;
    y12 = y1 * y1;
    y22 = y2 * y2;
    f = y22 * (3.0 * f2 + h2 * g1 + (2.0 * f2 + h2 * g1) * y2) +
        y12 * (3.0 * f3 - h2 * g2 - (2.0 * f3 - h2 * g2) * y1);
    df = 2.0 * y2 / h2 * (3.0 * f2 + h2 * g1 + (2.0 * f2 + h2 * g1) * y2) +
         y22 * (2.0 * f2 + h2 * g1) / h2 +
         2.0 * y1 / h2 * (3.0 * f3 - h2 * g2 - (2.0 * f3 - h2 * g2) * y1) -
         y12 * (2.0 * f3 - h2 * g2) / h2;
    a = 0.5 * df / rm;
    b = f - a * rm * rm;
    result = a * R * R + b;
  } else {
    do {
      m = (mp_min + mp_max) / 2;
      if (MRV[m] < R)
        mp_min = m;
      else
        mp_max = m;
    } while ((mp_max - mp_min) != 1);
    m = mp_max;
    if (m < 2)
      m = 2;
    else if (Grid_Num <= m)
      m = Grid_Num - 2;
  }
  if (po == 0) {
    h1 = MRV[m - 1] - MRV[m - 2];
    h2 = MRV[m] - MRV[m - 1];
    h3 = MRV[m + 1] - MRV[m];
    f1 = phi0[m - 2];
    f2 = phi0[m - 1];
    f3 = phi0[m];
    f4 = phi0[m + 1];
    if (m == 1) {
      h1 = -(h2 + h3);
      f1 = f4;
    }
    if (m == (Grid_Num - 1)) {
      h3 = -(h1 + h2);
      f4 = f1;
    }
    g1 = ((f3 - f2) * h1 / h2 + (f2 - f1) * h2 / h1) / (h1 + h2);
    g2 = ((f4 - f3) * h2 / h3 + (f3 - f2) * h3 / h2) / (h2 + h3);
    x1 = R - MRV[m - 1];
    x2 = R - MRV[m];
    y1 = x1 / h2;
    y2 = x2 / h2;
    f = y2 * y2 * (3.0 * f2 + h2 * g1 + (2.0 * f2 + h2 * g1) * y2) +
        y1 * y1 * (3.0 * f3 - h2 * g2 - (2.0 * f3 - h2 * g2) * y1);
    result = f;
  }
  return result;
}


x86 assembly (clang, -O0):
<PhiF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x58,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x24(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1167 <PhiF+0x67>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movl   $0x1,-0x2c(%rbp)
jmp    171a <PhiF+0x61a>
movsd  -0x8(%rbp),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1683 <PhiF+0x583>
movl   $0x1,-0x2c(%rbp)
movl   $0x4,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
subsd  -0x50(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
divsd  -0x38(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x38(%rbp),%xmm1
addsd  -0x40(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
subsd  -0x58(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
divsd  -0x40(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm1
addsd  -0x48(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0xc0(%rbp),%xmm0
ff
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0xc0(%rbp),%xmm0
ff
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
movsd  -0x58(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
mulsd  -0x70(%rbp),%xmm2
movsd  0xc6f(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm3
mulsd  -0x70(%rbp),%xmm3
addsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
movsd  -0x98(%rbp),%xmm3
ff
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0xc8(%rbp),%xmm1
ff
movsd  -0x60(%rbp),%xmm4
movsd  -0x40(%rbp),%xmm3
mulsd  -0x78(%rbp),%xmm3
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
movsd  0xc0a(%rip),%xmm5
mulsd  %xmm5,%xmm4
addsd  %xmm3,%xmm4
movsd  -0x60(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm5
mulsd  -0x78(%rbp),%xmm5
movq   %xmm5,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm5
addsd  %xmm3,%xmm3
addsd  %xmm5,%xmm3
movsd  -0x90(%rbp),%xmm5
ff
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xb99(%rip),%xmm1
mulsd  -0x98(%rbp),%xmm1
ff
divsd  -0x40(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
mulsd  -0x70(%rbp),%xmm2
movsd  0xb6d(%rip),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm3
mulsd  -0x70(%rbp),%xmm3
addsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
movsd  -0x98(%rbp),%xmm3
ff
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0xd0(%rbp),%xmm0
ff
movsd  -0x58(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm4
mulsd  -0x70(%rbp),%xmm4
addsd  %xmm3,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm0
divsd  -0x40(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xb0e(%rip),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
divsd  -0x40(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm2
mulsd  -0x78(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
movsd  0xacb(%rip),%xmm4
mulsd  %xmm4,%xmm3
addsd  %xmm2,%xmm3
movsd  -0x60(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm4
mulsd  -0x78(%rbp),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
addsd  %xmm2,%xmm2
addsd  %xmm4,%xmm2
movsd  -0x90(%rbp),%xmm4
ff
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0xc8(%rbp),%xmm1
ff
movsd  -0x60(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm3
mulsd  -0x78(%rbp),%xmm3
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
addsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
divsd  -0x40(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0xa0b(%rip),%xmm0
mulsd  -0xa8(%rbp),%xmm0
ff
divsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm1
ff
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  -0xc0(%rbp),%xmm0
ff
movsd  -0xc0(%rbp),%xmm2
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0xb8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
jmp    1715 <PhiF+0x615>
jmp    1688 <PhiF+0x588>
mov    -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    16c0 <PhiF+0x5c0>
mov    -0x28(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    16c6 <PhiF+0x5c6>
mov    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    16cb <PhiF+0x5cb>
mov    -0x24(%rbp),%eax
sub    -0x20(%rbp),%eax
cmp    $0x1,%eax
jne    1688 <PhiF+0x588>
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x2,-0x28(%rbp)
jge    16f6 <PhiF+0x5f6>
movl   $0x2,-0x28(%rbp)
jmp    1710 <PhiF+0x610>
mov    -0x1c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jg     170b <PhiF+0x60b>
mov    -0x1c(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x28(%rbp)
jmp    1710 <PhiF+0x610>
jmp    1715 <PhiF+0x615>
jmp    171a <PhiF+0x61a>
cmpl   $0x0,-0x2c(%rbp)
jne    1a57 <PhiF+0x957>
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
cmpl   $0x1,-0x28(%rbp)
jne    1826 <PhiF+0x726>
movsd  -0x40(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    1867 <PhiF+0x767>
movsd  -0x38(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
subsd  -0x50(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
divsd  -0x38(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x38(%rbp),%xmm1
addsd  -0x40(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
subsd  -0x58(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
divsd  -0x40(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm1
addsd  -0x48(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
mulsd  -0x98(%rbp),%xmm0
ff
movsd  -0x58(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
mulsd  -0x70(%rbp),%xmm2
movsd  0x69f(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm3
mulsd  -0x70(%rbp),%xmm3
addsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
movsd  -0x98(%rbp),%xmm3
ff
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x90(%rbp),%xmm1
ff
mulsd  -0x90(%rbp),%xmm1
ff
movsd  -0x60(%rbp),%xmm4
movsd  -0x40(%rbp),%xmm3
mulsd  -0x78(%rbp),%xmm3
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
movsd  0x632(%rip),%xmm5
mulsd  %xmm5,%xmm4
addsd  %xmm3,%xmm4
movsd  -0x60(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm5
mulsd  -0x78(%rbp),%xmm5
movq   %xmm5,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm5
addsd  %xmm3,%xmm3
addsd  %xmm5,%xmm3
movsd  -0x90(%rbp),%xmm5
ff
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
add    $0x58,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PhiF>:
movslq %edx,%rax
ucomisd -0x8(%rsi,%rax,8),%xmm0
jbe    1110 <PhiF+0x10>
xorpd  %xmm0,%xmm0
ret
movsd  (%rsi),%xmm1
ucomisd %xmm0,%xmm1
jbe    12d6 <PhiF+0x1d6>
movsd  0x20(%rsi),%xmm8
movsd  0x18(%rdi),%xmm12
movsd  0x20(%rdi),%xmm11
movapd %xmm8,%xmm4
unpcklpd %xmm11,%xmm4
movsd  0x18(%rsi),%xmm1
movapd %xmm12,%xmm2
unpcklpd %xmm1,%xmm2
unpcklpd %xmm12,%xmm1
subpd  %xmm1,%xmm4
movsd  0x10(%rdi),%xmm1
movhpd 0x10(%rsi),%xmm1
subpd  %xmm1,%xmm2
movapd %xmm2,%xmm1
mulpd  %xmm4,%xmm1
movapd %xmm2,%xmm3
unpckhpd %xmm2,%xmm3
shufpd $0x1,%xmm4,%xmm2
divpd  %xmm2,%xmm1
movapd %xmm1,%xmm7
unpckhpd %xmm1,%xmm7
addsd  %xmm1,%xmm7
addsd  %xmm4,%xmm3
divsd  %xmm3,%xmm7
movsd  0x28(%rdi),%xmm1
movhpd 0x28(%rsi),%xmm1
movapd %xmm11,%xmm2
unpcklpd %xmm8,%xmm2
subpd  %xmm2,%xmm1
movapd %xmm1,%xmm2
mulpd  %xmm4,%xmm2
movapd %xmm1,%xmm6
unpckhpd %xmm1,%xmm6
shufpd $0x1,%xmm4,%xmm1
divpd  %xmm1,%xmm2
movapd %xmm2,%xmm3
unpckhpd %xmm2,%xmm3
addsd  %xmm2,%xmm3
addsd  %xmm4,%xmm6
divsd  %xmm6,%xmm3
movapd %xmm8,%xmm6
subsd  %xmm8,%xmm6
movapd %xmm4,%xmm1
divsd  %xmm4,%xmm1
divsd  %xmm4,%xmm6
movapd %xmm1,%xmm9
mulsd  %xmm1,%xmm9
movapd %xmm6,%xmm10
mulsd  %xmm6,%xmm10
mulsd  %xmm4,%xmm7
movsd  0xe09(%rip),%xmm2
movapd %xmm12,%xmm5
mulsd  %xmm2,%xmm5
addsd  %xmm7,%xmm5
addsd  %xmm12,%xmm12
addsd  %xmm7,%xmm12
movapd %xmm12,%xmm7
mulsd  %xmm6,%xmm7
addsd  %xmm5,%xmm7
movapd 0xdcd(%rip),%xmm5
xorpd  %xmm4,%xmm5
mulsd  %xmm3,%xmm5
mulsd  %xmm11,%xmm2
addsd  %xmm5,%xmm2
addsd  %xmm11,%xmm11
addsd  %xmm5,%xmm11
movapd %xmm11,%xmm3
mulsd  %xmm1,%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm9,%xmm11
mulsd  %xmm2,%xmm9
mulsd  %xmm10,%xmm12
mulsd  %xmm7,%xmm10
addsd  %xmm6,%xmm6
divsd  %xmm4,%xmm6
divsd  %xmm4,%xmm12
mulsd  %xmm7,%xmm6
addsd  %xmm12,%xmm6
addsd  %xmm1,%xmm1
divsd  %xmm4,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm6,%xmm1
divsd  %xmm4,%xmm11
subsd  %xmm11,%xmm1
mulsd  0xd71(%rip),%xmm1
addsd  %xmm9,%xmm10
divsd  %xmm8,%xmm1
movapd %xmm8,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm8,%xmm2
subsd  %xmm2,%xmm10
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm10,%xmm1
movapd %xmm1,%xmm0
ret
lea    -0x1(%rdx),%r8d
xor    %r10d,%r10d
mov    %r8d,%r9d
jmp    12fe <PhiF+0x1fe>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ecx,%r9d
mov    %r9d,%eax
sub    %r10d,%eax
cmp    $0x1,%eax
je     131a <PhiF+0x21a>
lea    (%r10,%r9,1),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
movslq %ecx,%rax
ucomisd (%rsi,%rax,8),%xmm0
jbe    12f0 <PhiF+0x1f0>
mov    %ecx,%r10d
jmp    12f3 <PhiF+0x1f3>
lea    -0x2(%rdx),%eax
cmp    %edx,%r9d
cmovl  %r9d,%eax
cmp    $0x2,%r9d
mov    $0x2,%ecx
cmovge %eax,%ecx
movslq %ecx,%rax
movsd  -0x8(%rsi,%rax,8),%xmm8
movupd (%rsi,%rax,8),%xmm10
movapd %xmm8,%xmm1
unpcklpd %xmm10,%xmm1
movapd %xmm10,%xmm4
subpd  %xmm1,%xmm4
movupd -0x8(%rdi,%rax,8),%xmm12
movsd  0x8(%rdi,%rax,8),%xmm11
movapd %xmm4,%xmm1
unpckhpd %xmm4,%xmm1
movapd 0xc8e(%rip),%xmm9
cmp    $0x1,%eax
je     138a <PhiF+0x28a>
movapd %xmm8,%xmm7
subsd  -0x10(%rsi,%rax,8),%xmm7
movsd  -0x10(%rdi,%rax,8),%xmm5
jmp    139c <PhiF+0x29c>
movapd %xmm4,%xmm7
addsd  %xmm1,%xmm7
xorpd  %xmm9,%xmm7
movapd %xmm11,%xmm5
movapd %xmm12,%xmm2
shufpd $0x1,%xmm12,%xmm2
movapd %xmm4,%xmm6
addsd  %xmm7,%xmm6
cmp    %r8d,%ecx
jne    13c2 <PhiF+0x2c2>
movapd %xmm6,%xmm1
xorpd  %xmm9,%xmm1
movapd %xmm5,%xmm11
movapd %xmm12,%xmm3
unpcklpd %xmm5,%xmm3
subpd  %xmm3,%xmm2
movapd %xmm4,%xmm3
unpcklpd %xmm7,%xmm3
unpcklpd %xmm4,%xmm7
mulpd  %xmm2,%xmm7
divpd  %xmm3,%xmm7
movapd %xmm7,%xmm5
unpckhpd %xmm7,%xmm5
addsd  %xmm7,%xmm5
divsd  %xmm6,%xmm5
movapd %xmm12,%xmm7
unpckhpd %xmm12,%xmm7
subsd  %xmm7,%xmm11
unpcklpd %xmm4,%xmm2
movapd %xmm1,%xmm3
unpcklpd %xmm11,%xmm3
mulpd  %xmm2,%xmm3
movapd %xmm4,%xmm2
unpcklpd %xmm1,%xmm2
divpd  %xmm2,%xmm3
movapd %xmm3,%xmm6
unpckhpd %xmm3,%xmm6
addsd  %xmm3,%xmm6
addsd  %xmm4,%xmm1
divsd  %xmm1,%xmm6
movapd %xmm0,%xmm2
subsd  %xmm8,%xmm2
subsd  %xmm10,%xmm0
divsd  %xmm4,%xmm2
divsd  %xmm4,%xmm0
mulsd  %xmm4,%xmm5
movsd  0xbbb(%rip),%xmm1
movapd %xmm12,%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm5,%xmm3
addsd  %xmm12,%xmm12
addsd  %xmm5,%xmm12
mulsd  %xmm0,%xmm12
mulsd  %xmm0,%xmm0
addsd  %xmm3,%xmm12
mulsd  %xmm0,%xmm12
xorpd  %xmm4,%xmm9
mulsd  %xmm6,%xmm9
mulsd  %xmm7,%xmm1
addsd  %xmm9,%xmm1
addsd  %xmm7,%xmm7
addsd  %xmm9,%xmm7
mulsd  %xmm2,%xmm7
mulsd  %xmm2,%xmm2
subsd  %xmm7,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm12,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @PhiF(double %0, double* %1, double* %2, i32 %3) {
%5 = alloca double
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%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
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca double
store double %0, double* %5
store double* %1, double** %6
store double* %2, double** %7
store i32 %3, i32* %8
store i32 0, i32* %9
%34 = load i32, i32* %8
%35 = sub nsw i32 %34, 1
store i32 %35, i32* %10
store i32 0, i32* %12
%36 = load double*, double** %7
%37 = load i32, i32* %8
%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 = load double, double* %5
%43 = fcmp olt double %41, %42
br i1 %43, label %44, label %45
44: ; preds = %4
store double 0.000000e+00, double* %33
store i32 1, i32* %12
br label %325
45: ; preds = %4
%46 = load double, double* %5
%47 = load double*, double** %7
%48 = getelementptr inbounds double, double* %47, i64 0
%49 = load double, double* %48
%50 = fcmp olt double %46, %49
br i1 %50, label %51, label %287
51: ; preds = %45
store i32 1, i32* %12
store i32 4, i32* %11
%52 = load double*, double** %7
%53 = load i32, i32* %11
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds double, double* %52, i64 %54
%56 = load double, double* %55
store double %56, double* %30
%57 = load double*, double** %7
%58 = load i32, i32* %11
%59 = sub nsw i32 %58, 1
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds double, double* %57, i64 %60
%62 = load double, double* %61
%63 = load double*, double** %7
%64 = load i32, i32* %11
%65 = sub nsw i32 %64, 2
%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* %13
%70 = load double*, double** %7
%71 = load i32, i32* %11
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double, double* %70, i64 %72
%74 = load double, double* %73
%75 = load double*, double** %7
%76 = load i32, i32* %11
%77 = sub nsw i32 %76, 1
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double, double* %75, i64 %78
%80 = load double, double* %79
%81 = fsub double %74, %80
store double %81, double* %14
%82 = load double*, double** %7
%83 = load i32, i32* %11
%84 = add nsw i32 %83, 1
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds double, double* %82, i64 %85
%87 = load double, double* %86
%88 = load double*, double** %7
%89 = load i32, i32* %11
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds double, double* %88, i64 %90
%92 = load double, double* %91
%93 = fsub double %87, %92
store double %93, double* %15
%94 = load double*, double** %6
%95 = load i32, i32* %11
%96 = sub nsw i32 %95, 2
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds double, double* %94, i64 %97
%99 = load double, double* %98
store double %99, double* %16
%100 = load double*, double** %6
%101 = load i32, i32* %11
%102 = sub nsw i32 %101, 1
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds double, double* %100, i64 %103
%105 = load double, double* %104
store double %105, double* %17
%106 = load double*, double** %6
%107 = load i32, i32* %11
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds double, double* %106, i64 %108
%110 = load double, double* %109
store double %110, double* %18
%111 = load double*, double** %6
%112 = load i32, i32* %11
%113 = add nsw i32 %112, 1
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds double, double* %111, i64 %114
%116 = load double, double* %115
store double %116, double* %19
%117 = load double, double* %18
%118 = load double, double* %17
%119 = fsub double %117, %118
%120 = load double, double* %13
%121 = fmul double %119, %120
%122 = load double, double* %14
%123 = fdiv double %121, %122
%124 = load double, double* %17
%125 = load double, double* %16
%126 = fsub double %124, %125
%127 = load double, double* %14
%128 = fmul double %126, %127
%129 = load double, double* %13
%130 = fdiv double %128, %129
%131 = fadd double %123, %130
%132 = load double, double* %13
%133 = load double, double* %14
%134 = fadd double %132, %133
%135 = fdiv double %131, %134
store double %135, double* %20
%136 = load double, double* %19
%137 = load double, double* %18
%138 = fsub double %136, %137
%139 = load double, double* %14
%140 = fmul double %138, %139
%141 = load double, double* %15
%142 = fdiv double %140, %141
%143 = load double, double* %18
%144 = load double, double* %17
%145 = fsub double %143, %144
%146 = load double, double* %15
%147 = fmul double %145, %146
%148 = load double, double* %14
%149 = fdiv double %147, %148
%150 = fadd double %142, %149
%151 = load double, double* %14
%152 = load double, double* %15
%153 = fadd double %151, %152
%154 = fdiv double %150, %153
store double %154, double* %21
%155 = load double, double* %30
%156 = load double*, double** %7
%157 = load i32, i32* %11
%158 = sub nsw i32 %157, 1
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds double, double* %156, i64 %159
%161 = load double, double* %160
%162 = fsub double %155, %161
store double %162, double* %22
%163 = load double, double* %30
%164 = load double*, double** %7
%165 = load i32, i32* %11
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds double, double* %164, i64 %166
%168 = load double, double* %167
%169 = fsub double %163, %168
store double %169, double* %23
%170 = load double, double* %22
%171 = load double, double* %14
%172 = fdiv double %170, %171
store double %172, double* %24
%173 = load double, double* %23
%174 = load double, double* %14
%175 = fdiv double %173, %174
store double %175, double* %25
%176 = load double, double* %24
%177 = load double, double* %24
%178 = fmul double %176, %177
store double %178, double* %31
%179 = load double, double* %25
%180 = load double, double* %25
%181 = fmul double %179, %180
store double %181, double* %32
%182 = load double, double* %32
%183 = load double, double* %17
%184 = load double, double* %14
%185 = load double, double* %20
%186 = fmul double %184, %185
%187 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %183, double %186)
%188 = load double, double* %17
%189 = load double, double* %14
%190 = load double, double* %20
%191 = fmul double %189, %190
%192 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %188, double %191)
%193 = load double, double* %25
%194 = call double @llvm.fmuladd.f64(double %192, double %193, double %187)
%195 = load double, double* %31
%196 = load double, double* %18
%197 = load double, double* %14
%198 = load double, double* %21
%199 = fmul double %197, %198
%200 = fneg double %199
%201 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %196, double %200)
%202 = load double, double* %18
%203 = load double, double* %14
%204 = load double, double* %21
%205 = fmul double %203, %204
%206 = fneg double %205
%207 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %202, double %206)
%208 = load double, double* %24
%209 = fneg double %207
%210 = call double @llvm.fmuladd.f64(double %209, double %208, double %201)
%211 = fmul double %195, %210
%212 = call double @llvm.fmuladd.f64(double %182, double %194, double %211)
store double %212, double* %26
%213 = load double, double* %25
%214 = fmul double 2.000000e+00, %213
%215 = load double, double* %14
%216 = fdiv double %214, %215
%217 = load double, double* %17
%218 = load double, double* %14
%219 = load double, double* %20
%220 = fmul double %218, %219
%221 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %217, double %220)
%222 = load double, double* %17
%223 = load double, double* %14
%224 = load double, double* %20
%225 = fmul double %223, %224
%226 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %222, double %225)
%227 = load double, double* %25
%228 = call double @llvm.fmuladd.f64(double %226, double %227, double %221)
%229 = load double, double* %32
%230 = load double, double* %17
%231 = load double, double* %14
%232 = load double, double* %20
%233 = fmul double %231, %232
%234 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %230, double %233)
%235 = fmul double %229, %234
%236 = load double, double* %14
%237 = fdiv double %235, %236
%238 = call double @llvm.fmuladd.f64(double %216, double %228, double %237)
%239 = load double, double* %24
%240 = fmul double 2.000000e+00, %239
%241 = load double, double* %14
%242 = fdiv double %240, %241
%243 = load double, double* %18
%244 = load double, double* %14
%245 = load double, double* %21
%246 = fmul double %244, %245
%247 = fneg double %246
%248 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %243, double %247)
%249 = load double, double* %18
%250 = load double, double* %14
%251 = load double, double* %21
%252 = fmul double %250, %251
%253 = fneg double %252
%254 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %249, double %253)
%255 = load double, double* %24
%256 = fneg double %254
%257 = call double @llvm.fmuladd.f64(double %256, double %255, double %248)
%258 = call double @llvm.fmuladd.f64(double %242, double %257, double %238)
%259 = load double, double* %31
%260 = load double, double* %18
%261 = load double, double* %14
%262 = load double, double* %21
%263 = fmul double %261, %262
%264 = fneg double %263
%265 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %260, double %264)
%266 = fmul double %259, %265
%267 = load double, double* %14
%268 = fdiv double %266, %267
%269 = fsub double %258, %268
store double %269, double* %27
%270 = load double, double* %27
%271 = fmul double 5.000000e-01, %270
%272 = load double, double* %30
%273 = fdiv double %271, %272
store double %273, double* %28
%274 = load double, double* %26
%275 = load double, double* %28
%276 = load double, double* %30
%277 = fmul double %275, %276
%278 = load double, double* %30
%279 = fneg double %277
%280 = call double @llvm.fmuladd.f64(double %279, double %278, double %274)
store double %280, double* %29
%281 = load double, double* %28
%282 = load double, double* %5
%283 = fmul double %281, %282
%284 = load double, double* %5
%285 = load double, double* %29
%286 = call double @llvm.fmuladd.f64(double %283, double %284, double %285)
store double %286, double* %33
br label %324
287: ; preds = %45
br label %288
288: ; preds = %305, %287
%289 = load i32, i32* %9
%290 = load i32, i32* %10
%291 = add nsw i32 %289, %290
%292 = sdiv i32 %291, 2
store i32 %292, i32* %11
%293 = load double*, double** %7
%294 = load i32, i32* %11
%295 = sext i32 %294 to i64
%296 = getelementptr inbounds double, double* %293, i64 %295
%297 = load double, double* %296
%298 = load double, double* %5
%299 = fcmp olt double %297, %298
br i1 %299, label %300, label %302
300: ; preds = %288
%301 = load i32, i32* %11
store i32 %301, i32* %9
br label %304
302: ; preds = %288
%303 = load i32, i32* %11
store i32 %303, i32* %10
br label %304
304: ; preds = %302, %300
br label %305
305: ; preds = %304
%306 = load i32, i32* %10
%307 = load i32, i32* %9
%308 = sub nsw i32 %306, %307
%309 = icmp ne i32 %308, 1
br i1 %309, label %288, label %310
310: ; preds = %305
%311 = load i32, i32* %10
store i32 %311, i32* %11
%312 = load i32, i32* %11
%313 = icmp slt i32 %312, 2
br i1 %313, label %314, label %315
314: ; preds = %310
store i32 2, i32* %11
br label %323
315: ; preds = %310
%316 = load i32, i32* %8
%317 = load i32, i32* %11
%318 = icmp sle i32 %316, %317
br i1 %318, label %319, label %322
319: ; preds = %315
%320 = load i32, i32* %8
%321 = sub nsw i32 %320, 2
store i32 %321, i32* %11
br label %322
322: ; preds = %319, %315
br label %323
323: ; preds = %322, %314
br label %324
324: ; preds = %323, %51
br label %325
325: ; preds = %324, %44
%326 = load i32, i32* %12
%327 = icmp eq i32 %326, 0
br i1 %327, label %328, label %504
328: ; preds = %325
%329 = load double*, double** %7
%330 = load i32, i32* %11
%331 = sub nsw i32 %330, 1
%332 = sext i32 %331 to i64
%333 = getelementptr inbounds double, double* %329, i64 %332
%334 = load double, double* %333
%335 = load double*, double** %7
%336 = load i32, i32* %11
%337 = sub nsw i32 %336, 2
%338 = sext i32 %337 to i64
%339 = getelementptr inbounds double, double* %335, i64 %338
%340 = load double, double* %339
%341 = fsub double %334, %340
store double %341, double* %13
%342 = load double*, double** %7
%343 = load i32, i32* %11
%344 = sext i32 %343 to i64
%345 = getelementptr inbounds double, double* %342, i64 %344
%346 = load double, double* %345
%347 = load double*, double** %7
%348 = load i32, i32* %11
%349 = sub nsw i32 %348, 1
%350 = sext i32 %349 to i64
%351 = getelementptr inbounds double, double* %347, i64 %350
%352 = load double, double* %351
%353 = fsub double %346, %352
store double %353, double* %14
%354 = load double*, double** %7
%355 = load i32, i32* %11
%356 = add nsw i32 %355, 1
%357 = sext i32 %356 to i64
%358 = getelementptr inbounds double, double* %354, i64 %357
%359 = load double, double* %358
%360 = load double*, double** %7
%361 = load i32, i32* %11
%362 = sext i32 %361 to i64
%363 = getelementptr inbounds double, double* %360, i64 %362
%364 = load double, double* %363
%365 = fsub double %359, %364
store double %365, double* %15
%366 = load double*, double** %6
%367 = load i32, i32* %11
%368 = sub nsw i32 %367, 2
%369 = sext i32 %368 to i64
%370 = getelementptr inbounds double, double* %366, i64 %369
%371 = load double, double* %370
store double %371, double* %16
%372 = load double*, double** %6
%373 = load i32, i32* %11
%374 = sub nsw i32 %373, 1
%375 = sext i32 %374 to i64
%376 = getelementptr inbounds double, double* %372, i64 %375
%377 = load double, double* %376
store double %377, double* %17
%378 = load double*, double** %6
%379 = load i32, i32* %11
%380 = sext i32 %379 to i64
%381 = getelementptr inbounds double, double* %378, i64 %380
%382 = load double, double* %381
store double %382, double* %18
%383 = load double*, double** %6
%384 = load i32, i32* %11
%385 = add nsw i32 %384, 1
%386 = sext i32 %385 to i64
%387 = getelementptr inbounds double, double* %383, i64 %386
%388 = load double, double* %387
store double %388, double* %19
%389 = load i32, i32* %11
%390 = icmp eq i32 %389, 1
br i1 %390, label %391, label %397
391: ; preds = %328
%392 = load double, double* %14
%393 = load double, double* %15
%394 = fadd double %392, %393
%395 = fneg double %394
store double %395, double* %13
%396 = load double, double* %19
store double %396, double* %16
br label %397
397: ; preds = %391, %328
%398 = load i32, i32* %11
%399 = load i32, i32* %8
%400 = sub nsw i32 %399, 1
%401 = icmp eq i32 %398, %400
br i1 %401, label %402, label %408
402: ; preds = %397
%403 = load double, double* %13
%404 = load double, double* %14
%405 = fadd double %403, %404
%406 = fneg double %405
store double %406, double* %15
%407 = load double, double* %16
store double %407, double* %19
br label %408
408: ; preds = %402, %397
%409 = load double, double* %18
%410 = load double, double* %17
%411 = fsub double %409, %410
%412 = load double, double* %13
%413 = fmul double %411, %412
%414 = load double, double* %14
%415 = fdiv double %413, %414
%416 = load double, double* %17
%417 = load double, double* %16
%418 = fsub double %416, %417
%419 = load double, double* %14
%420 = fmul double %418, %419
%421 = load double, double* %13
%422 = fdiv double %420, %421
%423 = fadd double %415, %422
%424 = load double, double* %13
%425 = load double, double* %14
%426 = fadd double %424, %425
%427 = fdiv double %423, %426
store double %427, double* %20
%428 = load double, double* %19
%429 = load double, double* %18
%430 = fsub double %428, %429
%431 = load double, double* %14
%432 = fmul double %430, %431
%433 = load double, double* %15
%434 = fdiv double %432, %433
%435 = load double, double* %18
%436 = load double, double* %17
%437 = fsub double %435, %436
%438 = load double, double* %15
%439 = fmul double %437, %438
%440 = load double, double* %14
%441 = fdiv double %439, %440
%442 = fadd double %434, %441
%443 = load double, double* %14
%444 = load double, double* %15
%445 = fadd double %443, %444
%446 = fdiv double %442, %445
store double %446, double* %21
%447 = load double, double* %5
%448 = load double*, double** %7
%449 = load i32, i32* %11
%450 = sub nsw i32 %449, 1
%451 = sext i32 %450 to i64
%452 = getelementptr inbounds double, double* %448, i64 %451
%453 = load double, double* %452
%454 = fsub double %447, %453
store double %454, double* %22
%455 = load double, double* %5
%456 = load double*, double** %7
%457 = load i32, i32* %11
%458 = sext i32 %457 to i64
%459 = getelementptr inbounds double, double* %456, i64 %458
%460 = load double, double* %459
%461 = fsub double %455, %460
store double %461, double* %23
%462 = load double, double* %22
%463 = load double, double* %14
%464 = fdiv double %462, %463
store double %464, double* %24
%465 = load double, double* %23
%466 = load double, double* %14
%467 = fdiv double %465, %466
store double %467, double* %25
%468 = load double, double* %25
%469 = load double, double* %25
%470 = fmul double %468, %469
%471 = load double, double* %17
%472 = load double, double* %14
%473 = load double, double* %20
%474 = fmul double %472, %473
%475 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %471, double %474)
%476 = load double, double* %17
%477 = load double, double* %14
%478 = load double, double* %20
%479 = fmul double %477, %478
%480 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %476, double %479)
%481 = load double, double* %25
%482 = call double @llvm.fmuladd.f64(double %480, double %481, double %475)
%483 = load double, double* %24
%484 = load double, double* %24
%485 = fmul double %483, %484
%486 = load double, double* %18
%487 = load double, double* %14
%488 = load double, double* %21
%489 = fmul double %487, %488
%490 = fneg double %489
%491 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %486, double %490)
%492 = load double, double* %18
%493 = load double, double* %14
%494 = load double, double* %21
%495 = fmul double %493, %494
%496 = fneg double %495
%497 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %492, double %496)
%498 = load double, double* %24
%499 = fneg double %497
%500 = call double @llvm.fmuladd.f64(double %499, double %498, double %491)
%501 = fmul double %485, %500
%502 = call double @llvm.fmuladd.f64(double %470, double %482, double %501)
store double %502, double* %26
%503 = load double, double* %26
store double %503, double* %33
br label %504
504: ; preds = %408, %325
%505 = load double, double* %33
ret double %505
}

LLVM IR (-O2):
define double @PhiF(double %0, double* nocapture %1, double* nocapture %2, i32 %3) {
%5 = add nsw i32 %3, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds double, double* %2, i64 %6
%8 = load double, double* %7
%9 = fcmp olt double %8, %0
br i1 %9, label %201, label %10
10: ; preds = %4
%11 = load double, double* %2
%12 = fcmp ogt double %11, %0
br i1 %12, label %13, label %99
13: ; preds = %10
%14 = getelementptr inbounds double, double* %2, i64 4
%15 = load double, double* %14
%16 = getelementptr inbounds double, double* %2, i64 3
%17 = load double, double* %16
%18 = getelementptr inbounds double, double* %2, i64 2
%19 = load double, double* %18
%20 = getelementptr inbounds double, double* %2, i64 5
%21 = load double, double* %20
%22 = getelementptr inbounds double, double* %1, i64 2
%23 = load double, double* %22
%24 = getelementptr inbounds double, double* %1, i64 3
%25 = load double, double* %24
%26 = getelementptr inbounds double, double* %1, i64 4
%27 = load double, double* %26
%28 = getelementptr inbounds double, double* %1, i64 5
%29 = load double, double* %28
%30 = insertelement <2 x double> poison, double %15, i64 0
%31 = insertelement <2 x double> %30, double %27, i64 1
%32 = insertelement <2 x double> poison, double %17, i64 0
%33 = insertelement <2 x double> %32, double %25, i64 1
%34 = fsub <2 x double> %31, %33
%35 = insertelement <2 x double> poison, double %25, i64 0
%36 = insertelement <2 x double> %35, double %17, i64 1
%37 = insertelement <2 x double> poison, double %23, i64 0
%38 = insertelement <2 x double> %37, double %19, i64 1
%39 = fsub <2 x double> %36, %38
%40 = fmul <2 x double> %39, %34
%41 = extractelement <2 x double> %39, i64 1
%42 = extractelement <2 x double> %34, i64 0
%43 = shufflevector <2 x double> %39, <2 x double> %34, <2 x i32> <i32 1, i32 2>
%44 = fdiv <2 x double> %40, %43
%45 = shufflevector <2 x double> %44, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%46 = fadd <2 x double> %44, %45
%47 = extractelement <2 x double> %46, i64 0
%48 = fadd double %42, %41
%49 = fdiv double %47, %48
%50 = insertelement <2 x double> poison, double %29, i64 0
%51 = insertelement <2 x double> %50, double %21, i64 1
%52 = insertelement <2 x double> poison, double %27, i64 0
%53 = insertelement <2 x double> %52, double %15, i64 1
%54 = fsub <2 x double> %51, %53
%55 = fmul <2 x double> %54, %34
%56 = extractelement <2 x double> %54, i64 1
%57 = shufflevector <2 x double> %54, <2 x double> %34, <2 x i32> <i32 1, i32 2>
%58 = fdiv <2 x double> %55, %57
%59 = shufflevector <2 x double> %58, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%60 = fadd <2 x double> %59, %58
%61 = extractelement <2 x double> %60, i64 0
%62 = fadd double %42, %56
%63 = fdiv double %61, %62
%64 = fsub double %15, %15
%65 = fdiv double %42, %42
%66 = fdiv double %64, %42
%67 = fmul double %65, %65
%68 = fmul double %66, %66
%69 = fmul double %42, %49
%70 = tail call double @llvm.fmuladd.f64(double %25, double 3.000000e+00, double %69)
%71 = tail call double @llvm.fmuladd.f64(double %25, double 2.000000e+00, double %69)
%72 = tail call double @llvm.fmuladd.f64(double %71, double %66, double %70)
%73 = fneg double %42
%74 = fmul double %63, %73
%75 = tail call double @llvm.fmuladd.f64(double %27, double 3.000000e+00, double %74)
%76 = tail call double @llvm.fmuladd.f64(double %27, double 2.000000e+00, double %74)
%77 = fneg double %76
%78 = tail call double @llvm.fmuladd.f64(double %77, double %65, double %75)
%79 = fmul double %67, %78
%80 = tail call double @llvm.fmuladd.f64(double %68, double %72, double %79)
%81 = fmul double %66, 2.000000e+00
%82 = fdiv double %81, %42
%83 = fmul double %68, %71
%84 = fdiv double %83, %42
%85 = tail call double @llvm.fmuladd.f64(double %82, double %72, double %84)
%86 = fmul double %65, 2.000000e+00
%87 = fdiv double %86, %42
%88 = tail call double @llvm.fmuladd.f64(double %87, double %78, double %85)
%89 = fmul double %67, %76
%90 = fdiv double %89, %42
%91 = fsub double %88, %90
%92 = fmul double %91, 5.000000e-01
%93 = fdiv double %92, %15
%94 = fneg double %93
%95 = fmul double %15, %94
%96 = tail call double @llvm.fmuladd.f64(double %95, double %15, double %80)
%97 = fmul double %93, %0
%98 = tail call double @llvm.fmuladd.f64(double %97, double %0, double %96)
br label %201
99: ; preds = %10, %99
%100 = phi i32 [ %108, %99 ], [ %5, %10 ]
%101 = phi i32 [ %109, %99 ], [ 0, %10 ]
%102 = add nsw i32 %101, %100
%103 = sdiv i32 %102, 2
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds double, double* %2, i64 %104
%106 = load double, double* %105
%107 = fcmp olt double %106, %0
%108 = select i1 %107, i32 %100, i32 %103
%109 = select i1 %107, i32 %103, i32 %101
%110 = sub nsw i32 %108, %109
%111 = icmp eq i32 %110, 1
br i1 %111, label %112, label %99
112: ; preds = %99
%113 = icmp slt i32 %108, 2
%114 = icmp slt i32 %108, %3
%115 = add nsw i32 %3, -2
%116 = select i1 %114, i32 %108, i32 %115
%117 = select i1 %113, i32 2, i32 %116
%118 = add nsw i32 %117, -1
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds double, double* %2, i64 %119
%121 = load double, double* %120
%122 = add nsw i32 %117, -2
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds double, double* %2, i64 %123
%125 = load double, double* %124
%126 = fsub double %121, %125
%127 = sext i32 %117 to i64
%128 = getelementptr inbounds double, double* %2, i64 %127
%129 = add nsw i32 %117, 1
%130 = sext i32 %129 to i64
%131 = bitcast double* %128 to <2 x double>*
%132 = load <2 x double>, <2 x double>* %131
%133 = insertelement <2 x double> poison, double %121, i64 0
%134 = extractelement <2 x double> %132, i64 0
%135 = shufflevector <2 x double> %133, <2 x double> %132, <2 x i32> <i32 0, i32 2>
%136 = fsub <2 x double> %132, %135
%137 = getelementptr inbounds double, double* %1, i64 %123
%138 = load double, double* %137
%139 = getelementptr inbounds double, double* %1, i64 %119
%140 = bitcast double* %139 to <2 x double>*
%141 = load <2 x double>, <2 x double>* %140
%142 = shufflevector <2 x double> %141, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%143 = getelementptr inbounds double, double* %1, i64 %130
%144 = load double, double* %143
%145 = icmp eq i32 %117, 1
%146 = extractelement <2 x double> %136, i64 0
%147 = extractelement <2 x double> %136, i64 1
%148 = fadd double %146, %147
%149 = fneg double %148
%150 = select i1 %145, double %144, double %138
%151 = select i1 %145, double %149, double %126
%152 = icmp eq i32 %117, %5
%153 = fadd double %146, %151
%154 = fneg double %153
%155 = select i1 %152, double %154, double %147
%156 = select i1 %152, double %150, double %144
%157 = extractelement <2 x double> %141, i64 0
%158 = insertelement <2 x double> %141, double %150, i64 1
%159 = fsub <2 x double> %142, %158
%160 = insertelement <2 x double> poison, double %151, i64 0
%161 = shufflevector <2 x double> %160, <2 x double> %136, <2 x i32> <i32 0, i32 2>
%162 = fmul <2 x double> %161, %159
%163 = shufflevector <2 x double> %136, <2 x double> undef, <2 x i32> <i32 0, i32 undef>
%164 = insertelement <2 x double> %163, double %151, i64 1
%165 = fdiv <2 x double> %162, %164
%166 = shufflevector <2 x double> %165, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%167 = fadd <2 x double> %165, %166
%168 = extractelement <2 x double> %167, i64 0
%169 = fdiv double %168, %153
%170 = extractelement <2 x double> %141, i64 1
%171 = fsub double %156, %170
%172 = shufflevector <2 x double> %159, <2 x double> %136, <2 x i32> <i32 0, i32 2>
%173 = insertelement <2 x double> poison, double %155, i64 0
%174 = insertelement <2 x double> %173, double %171, i64 1
%175 = fmul <2 x double> %172, %174
%176 = insertelement <2 x double> %163, double %155, i64 1
%177 = fdiv <2 x double> %175, %176
%178 = shufflevector <2 x double> %177, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%179 = fadd <2 x double> %177, %178
%180 = extractelement <2 x double> %179, i64 0
%181 = fadd double %146, %155
%182 = fdiv double %180, %181
%183 = fsub double %0, %121
%184 = fsub double %0, %134
%185 = fdiv double %183, %146
%186 = fdiv double %184, %146
%187 = fmul double %186, %186
%188 = fmul double %146, %169
%189 = tail call double @llvm.fmuladd.f64(double %157, double 3.000000e+00, double %188)
%190 = tail call double @llvm.fmuladd.f64(double %157, double 2.000000e+00, double %188)
%191 = tail call double @llvm.fmuladd.f64(double %190, double %186, double %189)
%192 = fmul double %185, %185
%193 = fneg double %146
%194 = fmul double %182, %193
%195 = tail call double @llvm.fmuladd.f64(double %170, double 3.000000e+00, double %194)
%196 = tail call double @llvm.fmuladd.f64(double %170, double 2.000000e+00, double %194)
%197 = fneg double %196
%198 = tail call double @llvm.fmuladd.f64(double %197, double %185, double %195)
%199 = fmul double %192, %198
%200 = tail call double @llvm.fmuladd.f64(double %187, double %191, double %199)
br label %201
201: ; preds = %13, %4, %112
%202 = phi double [ %200, %112 ], [ %98, %13 ], [ 0.000000e+00, %4 ]
ret double %202
}