// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x598, %rsp            # imm = 0x598
movl %r8d, %ebp
movl %ecx, %r15d
movl %edx, %r12d
movl %esi, %ebx
movl %edi, 0x8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x30(%rsp)
movl $0x1, %eax
movl %eax, 0x20(%rsp)
movl %eax, 0x30(%rsp)
movl %eax, 0x40(%rsp)
movl (%r9), %r13d
movl 0x4(%r9), %r14d
movl %edx, %edi
movl %ecx, %esi
movl %r8d, %edx
movl %r14d, %ecx
movl %r13d, %r8d
callq 0x7ea3
movl %eax, 0x4(%rsp)
movslq %ebx, %rbx
leaq (%rbx,%rbx,2), %rax
movl 0x28(%rsp,%rax,4), %edi
movl %r12d, 0x14(%rsp)
addl %r12d, %edi
movl 0x24(%rsp,%rax,4), %esi
movl %r15d, 0x18(%rsp)
addl %r15d, %esi
movq %rax, %r15
movl 0x20(%rsp,%rax,4), %edx
movl %ebp, 0x1c(%rsp)
addl %ebp, %edx
movl %r14d, 0xc(%rsp)
movl %r14d, %ecx
movl %r13d, 0x10(%rsp)
movl %r13d, %r8d
callq 0x7ea3
movq 0x5d8(%rsp), %r14
movl 0x14(%r14), %edi
movsd 0x40(%r14), %xmm0
movslq 0x4(%rsp), %rcx
movslq 0x8(%rsp), %r12
movq %rcx, %rdx
shlq $0x7, %rdx
leaq (%rdx,%rcx,8), %rcx
movq 0x5d0(%rsp), %r8
addq %r8, %rcx
leaq (,%r12,8), %rdx
leaq (%rdx,%rdx,4), %rdx
leaq (%rcx,%rdx), %rsi
addq $0x10, %rsi
cltq
movq %rax, %rcx
shlq $0x7, %rcx
leaq (%rcx,%rax,8), %rax
addq %r8, %rax
addq %rax, %rdx
addq $0x10, %rdx
leaq 0x210(%rsp), %rbp
movq %rbp, %rcx
callq 0x78bc
leaq 0x1e0(%rsp), %rdx
movq %rbx, %r13
movl %r13d, %edi
movq %rbp, %rsi
callq 0x7b54
movsd 0x40(%r14), %xmm0
leaq 0x400(%rsp), %rdx
movl %r13d, %edi
movq %rbp, %rsi
callq 0x7b9e
leaq 0x4d0(%rsp), %rbx
movl %r13d, %edi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x7c15
movl 0x18(%r14), %edi
leaq 0x1b0(%rsp), %rdx
leaq 0x180(%rsp), %rcx
leaq 0x1e0(%rsp), %rsi
callq 0x7b87
movl 0x8(%r14), %ebp
movl 0xc(%r14), %r14d
xorpd %xmm0, %xmm0
movapd %xmm0, 0xb0(%rsp)
movapd %xmm0, 0xc0(%rsp)
movl $0x1, %eax
movl %eax, 0xb0(%rsp)
movl %eax, 0xc0(%rsp)
movl %eax, 0xd0(%rsp)
subl %ebp, %r14d
jl 0xbde1
movl 0xb8(%rsp,%r15,4), %eax
movl %eax, 0x8(%rsp)
movl 0xb0(%rsp,%r15,4), %eax
movl %eax, 0x4(%rsp)
movl 0xb4(%rsp,%r15,4), %r13d
incl %r14d
xorl %r15d, %r15d
leaq (%r12,%r12,4), %r12
movl %ebp, %edi
imull 0x8(%rsp), %edi
addl 0x14(%rsp), %edi
movl %ebp, %esi
imull %r13d, %esi
addl 0x18(%rsp), %esi
movl %ebp, %edx
imull 0x4(%rsp), %edx
addl 0x1c(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x10(%rsp), %r8d
callq 0x7ea3
cltq
movq %rax, %rcx
shlq $0x7, %rcx
leaq (%rcx,%rax,8), %rax
addq 0x5d0(%rsp), %rax
leaq (%rax,%r12,8), %rax
addq $0x10, %rax
leaq 0x400(%rsp), %rcx
xorl %edx, %edx
leaq (%r15,%r15,4), %rsi
leaq (%rsp,%rsi,8), %rsi
addq $0x240, %rsi            # imm = 0x240
leaq (%rsi,%rdx,8), %rsi
movq $0x0, (%rsi)
xorpd %xmm0, %xmm0
xorl %edi, %edi
movsd (%rcx,%rdi,8), %xmm1
mulsd (%rax,%rdi,8), %xmm1
addsd %xmm1, %xmm0
incq %rdi
cmpq $0x5, %rdi
jne 0xbdab
movsd %xmm0, (%rsi)
incq %rdx
addq $0x28, %rcx
cmpq $0x5, %rdx
jne 0xbd8b
incl %ebp
incq %r15
cmpq %r14, %r15
jne 0xbd36
movq 0x5d8(%rsp), %r12
movl 0xc(%r12), %ecx
subl 0x8(%r12), %ecx
jle 0xbe8a
leaq 0xb0(%rsp), %rdx
movl %ecx, %eax
leaq 0x240(%rsp), %rsi
xorl %edi, %edi
xorl %r8d, %r8d
movsd 0x1b0(%rsp,%r8,8), %xmm0
mulsd (%rsi,%r8,8), %xmm0
movsd %xmm0, (%rdx,%r8,8)
incq %r8
cmpq $0x5, %r8
jne 0xbe10
incq %rdi
addq $0x28, %rdx
addq $0x28, %rsi
cmpq %rax, %rdi
jne 0xbe0d
testl %ecx, %ecx
jle 0xbe8a
leaq (%rax,%rax,4), %rcx
leaq (%rsp,%rcx,8), %rcx
addq $0x240, %rcx            # imm = 0x240
leaq 0x330(%rsp), %rdx
xorl %esi, %esi
xorl %edi, %edi
movsd 0x180(%rsp,%rdi,8), %xmm0
mulsd (%rcx,%rdi,8), %xmm0
movsd %xmm0, (%rdx,%rdi,8)
incq %rdi
cmpq $0x5, %rdi
jne 0xbe5e
incq %rsi
addq $0x28, %rdx
addq $-0x28, %rcx
cmpq %rax, %rsi
jne 0xbe5c
movq 0x5e0(%rsp), %r14
movslq 0x4(%r12), %rax
leaq 0x18e52(%rip), %r15     # 0x24cf0
leaq 0xb0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq *(%r15,%rax,8)
movslq 0x4(%r12), %rax
leaq 0x330(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq *(%r15,%rax,8)
xorl %eax, %eax
movq $0x0, (%r14,%rax,8)
xorpd %xmm0, %xmm0
xorl %ecx, %ecx
movsd 0x80(%rsp,%rcx,8), %xmm1
addsd 0x50(%rsp,%rcx,8), %xmm1
mulsd (%rbx,%rcx,8), %xmm1
addsd %xmm1, %xmm0
incq %rcx
cmpq $0x5, %rcx
jne 0xbed8
movsd %xmm0, (%r14,%rax,8)
incq %rax
addq $0x28, %rbx
cmpq $0x5, %rax
jne 0xbeca
addq $0x598, %rsp            # imm = 0x598
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop