// File: /workspace/github_c_makefile_star2_O0/mohuangrui[P]ArtraCFD/convective_flux.c
// Function: ComputeFhat
void ComputeFhat(const int tn, const int s, const int k, const int j, const int i,
        const int partn[restrict], const Node *const node, const Model *model, Real Fhat[restrict])
{
    const int h[DIMS][DIMS] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}; /* direction indicator */
    const int idxL = IndexNode(k, j, i, partn[Y], partn[X]);
    const int idxR = IndexNode(k + h[s][Z], j + h[s][Y], i + h[s][X], partn[Y], partn[X]);
    /* evaluate interface values by averaging */
    Real Uo[DIMUo]; /* store averaged primitives */
    SymmetricAverage(model->jacobMean, model->gamma, node[idxL].U[tn], node[idxR].U[tn], Uo);
    /* decompose Jacobian matrix */
    Real Lambda[DIMU]; /* eigenvalues */
    Real L[DIMU][DIMU]; /* vector space {Ln} */
    Real R[DIMU][DIMU]; /* vector space {Rn} */
    Eigenvalue(s, Uo, Lambda);
    EigenvectorL(s, model->gamma, Uo, L);
    EigenvectorR(s, Uo, R);
    /* flux vector splitting */
    Real LambdaP[DIMU]; /* eigenvalues */
    Real LambdaN[DIMU]; /* eigenvalues */
    EigenvalueSplitting(model->fluxSplit, Lambda, LambdaP, LambdaN);
    /* construct local characteristic variables for all potential stencils */
    Real W[FTN][DIMU];
    CharacteristicVariable(tn, s, k, j, i, model->sL, model->sR, partn, node, L, W);
    /* construct local characteristic fluxes */
    Real HP[FDN][DIMU]; /* forward characteristic flux stencil */
    Real HN[FDN][DIMU]; /* backward characteristic flux stencil */
    CharacteristicFlux(LambdaP, W, 0, +1, model->sR - model->sL, HP);
    CharacteristicFlux(LambdaN, W, model->sR - model->sL, -1, model->sR - model->sL, HN);
    /* WENO reconstruction */
    Real HhatP[DIMU]; /* forward numerical flux of characteristic fields */
    Real HhatN[DIMU]; /* backward numerical flux of characteristic fields */
    ReconstructFhat[model->sScheme](HP, HhatP);
    ReconstructFhat[model->sScheme](HN, HhatN);
    /* inverse projection */
    InverseProjection(R, HhatP, HhatN, Fhat);
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x5e0, %rsp            # imm = 0x5E0
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movl %edi, -0x14(%rbp)
movl %esi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq %r9, -0x30(%rbp)
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x24, %edx
callq 0x20d0
movl $0x1, -0x60(%rbp)
movl $0x1, -0x50(%rbp)
movl $0x1, -0x40(%rbp)
movl -0x1c(%rbp), %edi
movl -0x20(%rbp), %esi
movl -0x24(%rbp), %edx
movq -0x30(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x30(%rbp), %rax
movl (%rax), %r8d
callq 0x9500
movl %eax, -0x64(%rbp)
movl -0x1c(%rbp), %edi
movslq -0x18(%rbp), %rcx
leaq -0x60(%rbp), %rax
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
addl 0x8(%rax), %edi
movl -0x20(%rbp), %esi
movslq -0x18(%rbp), %rcx
leaq -0x60(%rbp), %rax
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
addl 0x4(%rax), %esi
movl -0x24(%rbp), %edx
movslq -0x18(%rbp), %rcx
leaq -0x60(%rbp), %rax
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
addl (%rax), %edx
movq -0x30(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x30(%rbp), %rax
movl (%rax), %r8d
callq 0x9500
movl %eax, -0x68(%rbp)
movq 0x18(%rbp), %rax
movl 0x14(%rax), %edi
movq 0x18(%rbp), %rax
movsd 0x40(%rax), %xmm0
movq 0x10(%rbp), %rsi
movslq -0x64(%rbp), %rax
imulq $0x88, %rax, %rax
addq %rax, %rsi
addq $0x10, %rsi
movslq -0x14(%rbp), %rax
imulq $0x28, %rax, %rax
addq %rax, %rsi
movq 0x10(%rbp), %rdx
movslq -0x68(%rbp), %rax
imulq $0x88, %rax, %rax
addq %rax, %rdx
addq $0x10, %rdx
movslq -0x14(%rbp), %rax
imulq $0x28, %rax, %rax
addq %rax, %rdx
leaq -0xa0(%rbp), %rcx
callq 0x8a10
movl -0x18(%rbp), %edi
leaq -0xa0(%rbp), %rsi
leaq -0xd0(%rbp), %rdx
callq 0x8da0
movl -0x18(%rbp), %edi
movq 0x18(%rbp), %rax
movsd 0x40(%rax), %xmm0
leaq -0xa0(%rbp), %rsi
leaq -0x1a0(%rbp), %rdx
callq 0x8e90
movl -0x18(%rbp), %edi
leaq -0xa0(%rbp), %rsi
leaq -0x270(%rbp), %rdx
callq 0x8fb0
movq 0x18(%rbp), %rax
movl 0x18(%rax), %edi
leaq -0xd0(%rbp), %rsi
leaq -0x2a0(%rbp), %rdx
leaq -0x2d0(%rbp), %rcx
callq 0x8e50
movl -0x14(%rbp), %edi
movl -0x18(%rbp), %esi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movl -0x24(%rbp), %r8d
movq 0x18(%rbp), %rax
movl 0x8(%rax), %r9d
movq 0x18(%rbp), %rax
movl 0xc(%rax), %r14d
movq -0x30(%rbp), %rbx
movq 0x10(%rbp), %r11
leaq -0x1a0(%rbp), %r10
leaq -0x3c0(%rbp), %rax
movl %r14d, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x10970
leaq -0x2a0(%rbp), %rdi
leaq -0x3c0(%rbp), %rsi
movq 0x18(%rbp), %rax
movl 0xc(%rax), %r8d
movq 0x18(%rbp), %rax
subl 0x8(%rax), %r8d
leaq -0x490(%rbp), %r9
xorl %edx, %edx
movl $0x1, %ecx
callq 0x10b50
leaq -0x2d0(%rbp), %rdi
leaq -0x3c0(%rbp), %rsi
movq 0x18(%rbp), %rax
movl 0xc(%rax), %edx
movq 0x18(%rbp), %rax
subl 0x8(%rax), %edx
movq 0x18(%rbp), %rax
movl 0xc(%rax), %r8d
movq 0x18(%rbp), %rax
subl 0x8(%rax), %r8d
leaq -0x560(%rbp), %r9
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x10b50
movq 0x18(%rbp), %rax
movslq 0x4(%rax), %rcx
leaq 0x1e890(%rip), %rax     # 0x2f190
movq (%rax,%rcx,8), %rax
leaq -0x490(%rbp), %rdi
leaq -0x590(%rbp), %rsi
callq *%rax
movq 0x18(%rbp), %rax
movslq 0x4(%rax), %rcx
leaq 0x1e86d(%rip), %rax     # 0x2f190
movq (%rax,%rcx,8), %rax
leaq -0x560(%rbp), %rdi
leaq -0x5c0(%rbp), %rsi
callq *%rax
leaq -0x270(%rbp), %rdi
leaq -0x590(%rbp), %rsi
leaq -0x5c0(%rbp), %rdx
movq 0x20(%rbp), %rcx
callq 0x10bf0
addq $0x5e0, %rsp            # imm = 0x5E0
popq %rbx
popq %r14
popq %rbp
retq
nopw %cs:(%rax,%rax)