// File: /workspace/github_c_makefile_star2_O3/mohuangrui[P]ArtraCFD/diffusive_flux.c
// Function: ComputeFvhatZ
static void ComputeFvhatZ(const int tn, const int k, const int j, const int i,
        const int partn[restrict], const Real dd[restrict], const Node *const node,
        const Model *model, Real Fvhat[restrict])
{
    const int idx = IndexNode(k, j, i, partn[Y], partn[X]);
    const int idxW = IndexNode(k, j, i - 1, partn[Y], partn[X]);
    const int idxE = IndexNode(k, j, i + 1, partn[Y], partn[X]);
    const int idxS = IndexNode(k, j - 1, i, partn[Y], partn[X]);
    const int idxN = IndexNode(k, j + 1, i, partn[Y], partn[X]);

    const int idxB = IndexNode(k + 1, j, i, partn[Y], partn[X]);
    const int idxWB = IndexNode(k + 1, j, i - 1, partn[Y], partn[X]);
    const int idxEB = IndexNode(k + 1, j, i + 1, partn[Y], partn[X]);
    const int idxSB = IndexNode(k + 1, j - 1, i, partn[Y], partn[X]);
    const int idxNB = IndexNode(k + 1, j + 1, i, partn[Y], partn[X]);

    const Real *restrict U = node[idx].U[tn];
    const Real u = U[1] / U[0];
    const Real v = U[2] / U[0];
    const Real w = U[3] / U[0];
    const Real T = ComputeTemperature(model->cv, U);

    U = node[idxW].U[tn];
    const Real uW = U[1] / U[0];
    const Real wW = U[3] / U[0];

    U = node[idxE].U[tn];
    const Real uE = U[1] / U[0];
    const Real wE = U[3] / U[0];

    U = node[idxS].U[tn];
    const Real vS = U[2] / U[0];
    const Real wS = U[3] / U[0];

    U = node[idxN].U[tn];
    const Real vN = U[2] / U[0];
    const Real wN = U[3] / U[0];

    U = node[idxB].U[tn];
    const Real uB = U[1] / U[0];
    const Real vB = U[2] / U[0];
    const Real wB = U[3] / U[0];
    const Real TB = ComputeTemperature(model->cv, U);

    U = node[idxWB].U[tn];
    const Real uWB = U[1] / U[0];
    const Real wWB = U[3] / U[0];

    U = node[idxEB].U[tn];
    const Real uEB = U[1] / U[0];
    const Real wEB = U[3] / U[0];

    U = node[idxSB].U[tn];
    const Real vSB = U[2] / U[0];
    const Real wSB = U[3] / U[0];

    U = node[idxNB].U[tn];
    const Real vNB = U[2] / U[0];
    const Real wNB = U[3] / U[0];

    const Real dw_dx = 0.25 * (wE + wEB - wW - wWB) * dd[X];
    const Real du_dz = (uB - u) * dd[Z];
    const Real dw_dy = 0.25 * (wN + wNB - wS - wSB) * dd[Y];
    const Real dv_dz = (vB - v) * dd[Z];
    const Real du_dx = 0.25 * (uE + uEB - uW - uWB) * dd[X];
    const Real dv_dy = 0.25 * (vN + vNB - vS - vSB) * dd[Y];
    const Real dw_dz = (wB - w) * dd[Z];
    const Real dT_dz = (TB - T) * dd[Z];

    /* calculate interfacial values */
    const Real uhat = 0.5 * (u + uB);
    const Real vhat = 0.5 * (v + vB);
    const Real what = 0.5 * (w + wB);
    const Real That = 0.5 * (T + TB);
    const Real mu = model->refMu * Viscosity(That * model->refT);
    const Real heatK = model->gamma * model->cv * mu / PrandtlNumber();
    const Real divV = du_dx + dv_dy + dw_dz;

    Fvhat[0] = 0.0;
    Fvhat[1] = mu * (dw_dx + du_dz);
    Fvhat[2] = mu * (dw_dy + dv_dz);
    Fvhat[3] = mu * (dw_dz + dw_dz - (2.0/3.0) * divV);
    Fvhat[4] = heatK * dT_dz + Fvhat[1] * uhat + Fvhat[2] * vhat + Fvhat[3] * what;
    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %r9, 0x48(%rsp)
movl %ecx, %r14d
movl %edx, %r13d
movl %esi, %r15d
movl %edi, 0x18(%rsp)
movl (%r8), %r12d
movl 0x4(%r8), %ebx
movl %esi, %edi
movl %edx, %esi
movl %ecx, %edx
movl %ebx, %ecx
movl %r12d, %r8d
callq 0x7d53
movl %eax, 0x30(%rsp)
leal -0x1(%r14), %edx
movl %edx, 0x20(%rsp)
movl %r15d, %edi
movl %r13d, %esi
movl %ebx, %ecx
movl %r12d, %r8d
callq 0x7d53
movl %eax, 0x80(%rsp)
leal 0x1(%r14), %edx
movl %edx, 0x50(%rsp)
movl %r15d, %edi
movl %r13d, %esi
movl %ebx, %ecx
movl %r12d, %r8d
callq 0x7d53
movl %eax, 0x10(%rsp)
leal -0x1(%r13), %esi
movl %esi, 0x40(%rsp)
movl %r15d, %edi
movl %r14d, %edx
movl %ebx, %ecx
movl %r12d, %r8d
callq 0x7d53
movl %eax, 0x70(%rsp)
leal 0x1(%r13), %ebp
movl %r15d, %edi
movl %ebp, %esi
movl %r14d, %edx
movl %ebx, %ecx
movl %r12d, %r8d
callq 0x7d53
movl %eax, 0x60(%rsp)
incl %r15d
movl %r15d, %edi
movl %r13d, %esi
movl %r14d, %edx
movl %ebx, %ecx
movl %r12d, %r8d
callq 0x7d53
movl %eax, 0x8(%rsp)
movl %r15d, %edi
movl %r13d, %esi
movl 0x20(%rsp), %edx
movl %ebx, %ecx
movl %r12d, %r8d
callq 0x7d53
movl %eax, 0x20(%rsp)
movl %r15d, %edi
movl %r13d, %esi
movl 0x50(%rsp), %edx
movl %ebx, %ecx
movl %r12d, %r8d
callq 0x7d53
movl %eax, 0x50(%rsp)
movl %r15d, %edi
movl 0x40(%rsp), %esi
movl %r14d, %edx
movl %ebx, %ecx
movl %r12d, %r8d
callq 0x7d53
movl %eax, %r13d
movl %r15d, %edi
movl %ebp, %esi
movl %r14d, %edx
movl %ebx, %ecx
movl %r12d, %r8d
callq 0x7d53
movslq 0x30(%rsp), %rcx
movslq 0x18(%rsp), %rdx
movq %rcx, %rsi
shlq $0x7, %rsi
leaq (%rsi,%rcx,8), %rcx
movq 0x100(%rsp), %rsi
addq %rsi, %rcx
shlq $0x3, %rdx
leaq (%rdx,%rdx,4), %r14
leaq (%rcx,%r14), %rdi
addq $0x10, %rdi
movsd (%rdi), %xmm1
movsd 0x18(%rdi), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x30(%rsp)
movq 0x108(%rsp), %rcx
movsd 0x50(%rcx), %xmm0
movslq 0x80(%rsp), %rcx
movq %rcx, %rdx
shlq $0x7, %rdx
leaq (%rdx,%rcx,8), %rbx
addq %rsi, %rbx
movslq 0x10(%rsp), %rcx
movq %rcx, %rdx
shlq $0x7, %rdx
leaq (%rdx,%rcx,8), %r15
addq %rsi, %r15
movslq 0x70(%rsp), %rcx
movq %rcx, %rdx
shlq $0x7, %rdx
leaq (%rdx,%rcx,8), %rbp
addq %rsi, %rbp
movslq 0x60(%rsp), %rcx
movq %rcx, %rdx
shlq $0x7, %rdx
leaq (%rdx,%rcx,8), %r12
addq %rsi, %r12
movslq 0x8(%rsp), %rcx
movq %rcx, %rdx
shlq $0x7, %rdx
leaq (%rdx,%rcx,8), %rcx
addq %rsi, %rcx
addq %r14, %rcx
addq $0x10, %rcx
movq %rcx, 0xa8(%rsp)
movslq 0x20(%rsp), %rcx
movq %rcx, %rdx
shlq $0x7, %rdx
leaq (%rdx,%rcx,8), %rcx
addq %rsi, %rcx
movq %rcx, 0x8(%rsp)
movslq 0x50(%rsp), %rcx
movq %rcx, %rdx
shlq $0x7, %rdx
leaq (%rdx,%rcx,8), %rcx
addq %rsi, %rcx
movq %rcx, 0x20(%rsp)
movslq %r13d, %rcx
movq %rcx, %rdx
shlq $0x7, %rdx
leaq (%rdx,%rcx,8), %r13
addq %rsi, %r13
cltq
movq %rax, %rcx
shlq $0x7, %rcx
leaq (%rcx,%rax,8), %rax
addq %rsi, %rax
movq %rax, 0x60(%rsp)
movupd 0x8(%rdi), %xmm2
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
divpd %xmm1, %xmm2
movapd %xmm2, 0x70(%rsp)
callq 0x7c92
movsd %xmm0, 0x10(%rsp)
movsd 0x10(%rbx,%r14), %xmm0
movsd 0x18(%rbx,%r14), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0xa0(%rsp)
movsd 0x10(%r15,%r14), %xmm1
movsd 0x18(%r15,%r14), %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, 0x90(%rsp)
movsd 0x10(%rbp,%r14), %xmm2
movsd 0x20(%rbp,%r14), %xmm3
divsd %xmm2, %xmm3
movsd %xmm3, 0x40(%rsp)
movsd 0x28(%rbx,%r14), %xmm3
movhpd 0x28(%rbp,%r14), %xmm3  # xmm3 = xmm3[0],mem[0]
unpcklpd %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0]
divpd %xmm0, %xmm3
movapd %xmm3, 0x50(%rsp)
movsd 0x10(%r12,%r14), %xmm0
movsd 0x20(%r12,%r14), %xmm2
divsd %xmm0, %xmm2
movsd %xmm2, 0x98(%rsp)
movsd 0x28(%r15,%r14), %xmm2
movhpd 0x28(%r12,%r14), %xmm2  # xmm2 = xmm2[0],mem[0]
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
divpd %xmm1, %xmm2
movapd %xmm2, 0xb0(%rsp)
movq 0xa8(%rsp), %rdi
movsd (%rdi), %xmm0
movupd 0x8(%rdi), %xmm2
movsd 0x18(%rdi), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x18(%rsp)
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
divpd %xmm0, %xmm2
movapd %xmm2, 0x80(%rsp)
movq 0x108(%rsp), %rbx
movsd 0x50(%rbx), %xmm0
callq 0x7c92
movq 0x8(%rsp), %rax
movsd 0x10(%rax,%r14), %xmm2
movsd 0x18(%rax,%r14), %xmm3
movq %rax, %rcx
divsd %xmm2, %xmm3
movq 0x20(%rsp), %rax
movsd 0x10(%rax,%r14), %xmm4
movsd 0x18(%rax,%r14), %xmm1
divsd %xmm4, %xmm1
addsd 0x90(%rsp), %xmm1
subsd 0xa0(%rsp), %xmm1
subsd %xmm3, %xmm1
movsd 0x10(%r13,%r14), %xmm3
movsd 0x20(%r13,%r14), %xmm5
divsd %xmm3, %xmm5
movsd 0x28(%rcx,%r14), %xmm6
movhpd 0x28(%r13,%r14), %xmm6  # xmm6 = xmm6[0],mem[0]
unpcklpd %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0]
divpd %xmm2, %xmm6
movq 0x60(%rsp), %rcx
movsd 0x10(%rcx,%r14), %xmm7
movsd 0x20(%rcx,%r14), %xmm2
divsd %xmm7, %xmm2
addsd 0x98(%rsp), %xmm2
subsd 0x40(%rsp), %xmm2
subsd %xmm5, %xmm2
movsd 0x28(%rax,%r14), %xmm3
movhpd 0x28(%rcx,%r14), %xmm3  # xmm3 = xmm3[0],mem[0]
unpcklpd %xmm7, %xmm4            # xmm4 = xmm4[0],xmm7[0]
divpd %xmm4, %xmm3
addpd 0xb0(%rsp), %xmm3
subpd 0x50(%rsp), %xmm3
subpd %xmm6, %xmm3
movq 0x48(%rsp), %rax
movsd 0x10(%rax), %xmm4
mulpd 0xebf1(%rip), %xmm3     # 0x1cb60
movupd (%rax), %xmm9
mulpd %xmm9, %xmm3
movapd 0x80(%rsp), %xmm11
movapd %xmm11, %xmm5
movapd 0x70(%rsp), %xmm8
subpd %xmm8, %xmm5
movsd 0x18(%rsp), %xmm10
movapd %xmm10, %xmm7
movsd 0x30(%rsp), %xmm6
subsd %xmm6, %xmm7
mulsd %xmm4, %xmm7
movsd %xmm7, 0x48(%rsp)
movapd %xmm0, %xmm12
movsd 0x10(%rsp), %xmm7
subsd %xmm7, %xmm12
mulsd %xmm4, %xmm12
movsd %xmm12, 0x8(%rsp)
unpcklpd %xmm4, %xmm4            # xmm4 = xmm4[0,0]
mulpd %xmm5, %xmm4
addpd %xmm3, %xmm4
movapd %xmm4, 0x60(%rsp)
movsd 0xeb5e(%rip), %xmm3     # 0x1cb48
mulsd %xmm3, %xmm1
mulsd %xmm9, %xmm1
mulsd %xmm3, %xmm2
unpckhpd %xmm9, %xmm9            # xmm9 = xmm9[1,1]
mulsd %xmm2, %xmm9
addsd %xmm1, %xmm9
movapd %xmm9, 0x20(%rsp)
movapd %xmm11, %xmm2
addpd %xmm8, %xmm2
movsd 0xe5a1(%rip), %xmm1     # 0x1c5c0
movapd %xmm2, %xmm3
mulsd %xmm1, %xmm3
movapd %xmm3, 0x70(%rsp)
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
mulsd %xmm1, %xmm2
movapd %xmm2, 0x80(%rsp)
movapd %xmm10, %xmm2
addsd %xmm6, %xmm2
mulsd %xmm1, %xmm2
movsd %xmm2, 0x18(%rsp)
addsd %xmm7, %xmm0
mulsd %xmm1, %xmm0
movsd 0x38(%rbx), %xmm1
movsd %xmm1, 0x30(%rsp)
mulsd 0x70(%rbx), %xmm0
callq 0x7bdf
mulsd 0x30(%rsp), %xmm0
movapd %xmm0, 0x30(%rsp)
movsd 0x40(%rbx), %xmm1
mulsd 0x50(%rbx), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
callq 0x7c0d
movsd 0x10(%rsp), %xmm1
divsd %xmm0, %xmm1
mulsd 0x8(%rsp), %xmm1
movapd %xmm1, %xmm3
movapd 0x20(%rsp), %xmm1
movsd 0x48(%rsp), %xmm2
addsd %xmm2, %xmm1
movq 0x110(%rsp), %rax
movq $0x0, (%rax)
movapd 0x30(%rsp), %xmm4
movapd %xmm4, %xmm0
unpcklpd %xmm4, %xmm0            # xmm0 = xmm0[0],xmm4[0]
mulpd 0x60(%rsp), %xmm0
movupd %xmm0, 0x8(%rax)
mulsd 0xea69(%rip), %xmm1     # 0x1cb50
addsd %xmm2, %xmm2
addsd %xmm2, %xmm1
mulsd %xmm4, %xmm1
movsd %xmm1, 0x18(%rax)
movapd 0x70(%rsp), %xmm2
mulsd %xmm0, %xmm2
addsd %xmm3, %xmm2
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
mulsd 0x80(%rsp), %xmm0
addsd %xmm2, %xmm0
mulsd 0x18(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x20(%rax)
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq