// File: /workspace/github_c_makefile_star2_O2/mohuangrui[P]ArtraCFD/weno5.c
// Function: WENO5
void WENO5(Real F[restrict][DIMU], Real Fhat[restrict])
{
    Real omega[R]; /* weights */
    Real q[R]; /* q vectors */
    Real IS[R]; /* smoothness measurements */
    Real alpha[R];
    const Real C[R] = {1.0 / 10.0, 6.0 / 10.0, 3.0 / 10.0};
    const Real epsilon = 1.0e-6;
    for (int r = 0; r < DIMU; ++r) {
        IS[0] = (13.0 / 12.0) * Square(F[CN-2][r] - 2.0 * F[CN-1][r] + F[CN][r]) +
            (1.0 / 4.0) * Square(F[CN-2][r] - 4.0 * F[CN-1][r] + 3.0 * F[CN][r]);
        IS[1] = (13.0 / 12.0) * Square(F[CN-1][r] - 2.0 * F[CN][r] + F[CN+1][r]) +
            (1.0 / 4.0) * Square(F[CN-1][r] - F[CN+1][r]);
        IS[2] = (13.0 / 12.0) * Square(F[CN][r] - 2.0 * F[CN+1][r] + F[CN+2][r]) +
            (1.0 / 4.0) * Square(3.0 * F[CN][r] - 4.0 * F[CN+1][r] + F[CN+2][r]);
        alpha[0] = C[0] / Square(epsilon + IS[0]);
        alpha[1] = C[1] / Square(epsilon + IS[1]);
        alpha[2] = C[2] / Square(epsilon + IS[2]);
        omega[0] = alpha[0] / (alpha[0] + alpha[1] + alpha[2]);
        omega[1] = alpha[1] / (alpha[0] + alpha[1] + alpha[2]);
        omega[2] = alpha[2] / (alpha[0] + alpha[1] + alpha[2]);
        q[0] = (1.0 / 6.0) * (2.0 * F[CN-2][r] - 7.0 * F[CN-1][r] + 11.0 * F[CN][r]);
        q[1] = (1.0 / 6.0) * (-F[CN-1][r] + 5.0 * F[CN][r] + 2.0 * F[CN+1][r]);
        q[2] = (1.0 / 6.0) * (2.0 * F[CN][r] + 5.0 * F[CN+1][r] - F[CN+2][r]);
        Fhat[r] = omega[0] * q[0] + omega[1] * q[1] + omega[2] * q[2];
    }
    return;
}

// Assembly:
xorl %eax, %eax
movsd 0x7806(%rip), %xmm0     # 0x1ef68
movapd 0x7845(%rip), %xmm9     # 0x1efb0
movsd 0x7814(%rip), %xmm11    # 0x1ef88
movsd 0x7813(%rip), %xmm12    # 0x1ef90
movsd 0x7812(%rip), %xmm13    # 0x1ef98
cmpq $0x5, %rax
je 0x17935
movsd (%rdi,%rax,8), %xmm15
movsd 0x28(%rdi,%rax,8), %xmm8
movsd 0x50(%rdi,%rax,8), %xmm14
movapd %xmm8, %xmm1
movapd %xmm8, %xmm4
movapd %xmm8, %xmm6
movapd %xmm8, %xmm7
mulsd %xmm0, %xmm7
addsd %xmm15, %xmm7
movapd %xmm14, %xmm5
mulsd 0x7792(%rip), %xmm5     # 0x1ef60
addsd %xmm5, %xmm7
movapd %xmm14, %xmm3
addsd %xmm14, %xmm3
subsd %xmm3, %xmm1
movsd 0x78(%rdi,%rax,8), %xmm10
addsd %xmm10, %xmm1
mulsd %xmm1, %xmm1
subsd %xmm10, %xmm4
mulsd %xmm4, %xmm4
mulsd 0x422f(%rip), %xmm4     # 0x1ba30
mulsd 0x7767(%rip), %xmm1     # 0x1ef70
addsd %xmm4, %xmm1
movapd %xmm10, %xmm2
mulsd %xmm0, %xmm2
addsd %xmm5, %xmm2
movsd 0xa0(%rdi,%rax,8), %xmm4
addsd %xmm4, %xmm2
unpcklpd %xmm2, %xmm7            # xmm7 = xmm7[0],xmm2[0]
addsd 0x3cb5(%rip), %xmm1     # 0x1b4e8
mulsd %xmm1, %xmm1
movsd 0x7739(%rip), %xmm5     # 0x1ef78
divsd %xmm1, %xmm5
unpcklpd %xmm10, %xmm6           # xmm6 = xmm6[0],xmm10[0]
movapd %xmm15, %xmm1
unpcklpd %xmm14, %xmm1           # xmm1 = xmm1[0],xmm14[0]
addpd %xmm6, %xmm6
subpd %xmm6, %xmm1
movapd %xmm14, %xmm2
unpcklpd %xmm4, %xmm2            # xmm2 = xmm2[0],xmm4[0]
addpd %xmm1, %xmm2
mulpd %xmm2, %xmm2
mulpd %xmm7, %xmm7
mulpd 0x41c9(%rip), %xmm7     # 0x1ba40
mulpd 0x7721(%rip), %xmm2     # 0x1efa0
addpd %xmm7, %xmm2
addpd 0x76b5(%rip), %xmm2     # 0x1ef40
mulpd %xmm2, %xmm2
movapd %xmm9, %xmm7
divpd %xmm2, %xmm7
movapd %xmm7, %xmm2
addsd %xmm5, %xmm2
movapd %xmm7, %xmm1
unpckhpd %xmm7, %xmm1            # xmm1 = xmm1[1],xmm7[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm7
divsd %xmm2, %xmm5
divsd %xmm2, %xmm1
movapd %xmm14, %xmm2
mulsd %xmm13, %xmm14
subsd %xmm8, %xmm14
mulsd 0x76b0(%rip), %xmm8     # 0x1ef80
addsd %xmm15, %xmm15
addsd %xmm8, %xmm15
mulsd %xmm11, %xmm2
addsd %xmm15, %xmm2
mulsd %xmm12, %xmm2
mulsd %xmm7, %xmm2
movapd %xmm10, %xmm6
addsd %xmm10, %xmm6
addsd %xmm14, %xmm6
mulsd %xmm12, %xmm6
mulsd %xmm5, %xmm6
addsd %xmm2, %xmm6
mulsd %xmm13, %xmm10
addsd %xmm3, %xmm10
subsd %xmm4, %xmm10
mulsd %xmm12, %xmm10
mulsd %xmm1, %xmm10
addsd %xmm6, %xmm10
movsd %xmm10, (%rsi,%rax,8)
incq %rax
jmp 0x17786
retq