// File: /workspace/github_cpp_makefile_star2_O3/jamesliu516[P]amrdg2d/face_flux_all.cpp
// Function: kxrcf_relate()
void kxrcf_relate()
{
    Node *current;
    current = HeadListAllGrid;  
    OctCell *pcell0;
    double rtp, rtm;
    double uapp[4][3][3];
    double pre[3][3]={0.0};
    while(current != NULL)
    {		
        pcell0 = current->cell;
        if(pcell0->flag  == 0 && current->flg<=2 ) {
            pcell0->kxq=0.0;
            pcell0->inlen=0.0;
            rtp=1.0e-13;
            for(short j=0; j<4; j++) {
                for(short imm=0; imm<3;imm++) {
                    for(short jmm=0; jmm<3; jmm++) {
                        uapp[j][jmm][imm]=approx_sol(gspt[jmm],
                            gspt[imm], pcell0->dof[j], nDOF);  //u(x,y)
                       // if(rtp<uapp[jmm][imm]) rtp=uapp[0][jmm][imm];
                       // density
                    }
                }
            }
            //entropy
            for(short imm=0; imm<3;imm++) {
                for(short jmm=0; jmm<3; jmm++) {
                    pre[jmm][imm]=GAM11 *(uapp[3][jmm][imm]-0.5*(uapp[1][jmm][imm]*uapp[1][jmm][imm]/uapp[0][jmm][imm]
                            + uapp[2][jmm][imm]*uapp[2][jmm][imm]/uapp[0][jmm][imm]));	          
                    rtm=pre[jmm][imm]/pow(uapp[0][jmm][imm],GAMMA);
                    if(rtp<rtm) rtp=rtm;
                }
            }
            pcell0->maxqp=rtp;
        }
        current = current->next;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
leaq 0x1aca0(%rip), %rax     # 0x29610
movq (%rax), %rax
testq %rax, %rax
je 0xeb0a
leaq 0xee1d(%rip), %rbp      # 0x1d7a0
movq 0x8(%rax), %rcx
cmpw $0x0, 0x1b0(%rcx)
jne 0xeafd
cmpw $0x2, (%rax)
jg 0xeafd
movq %rax, 0x28(%rsp)
xorl %eax, %eax
movq %rax, 0x220(%rcx)
movq %rax, 0x230(%rcx)
movq %rcx, 0x20(%rsp)
leaq 0x30(%rcx), %rax
movq %rax, 0x30(%rsp)
leaq 0x40(%rsp), %r15
xorl %eax, %eax
movq %rax, 0x38(%rsp)
leaq (%rax,%rax,2), %rbx
shlq $0x4, %rbx
addq 0x30(%rsp), %rbx
movq %r15, 0x10(%rsp)
xorl %r13d, %r13d
movsd (%rbp,%r13,8), %xmm0
movsd %xmm0, 0x8(%rsp)
xorl %r14d, %r14d
movq %r15, %r12
movsd (%r14,%rbp), %xmm0
movsd 0x8(%rsp), %xmm1
movq %rbx, %rdi
movl $0x6, %esi
callq 0xd904
movsd %xmm0, (%r12)
addq $0x18, %r12
addq $0x8, %r14
cmpq $0x18, %r14
jne 0xe9f6
incq %r13
addq $0x8, %r15
cmpq $0x3, %r13
jne 0xe9e3
movq 0x38(%rsp), %rax
incq %rax
movq 0x10(%rsp), %r15
addq $0x48, %r15
cmpq $0x4, %rax
jne 0xe9c9
leaq 0x118(%rsp), %rbx
xorl %r12d, %r12d
movsd 0xed36(%rip), %xmm1     # 0x1d790
movq $-0x48, %r15
movsd %xmm1, 0x8(%rsp)
movsd -0x48(%rbx,%r15), %xmm1
movhpd (%rbx,%r15), %xmm1      # xmm1 = xmm1[0],mem[0]
movsd -0x90(%rbx,%r15), %xmm0
mulpd %xmm1, %xmm1
movapd %xmm0, %xmm2
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
divpd %xmm2, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
mulsd 0xe69e(%rip), %xmm2     # 0x1d140
addsd 0x48(%rbx,%r15), %xmm2
mulsd 0xe6f7(%rip), %xmm2     # 0x1d1a8
movapd %xmm2, 0x10(%rsp)
movsd 0xe6f1(%rip), %xmm1     # 0x1d1b0
callq 0x3360
movapd 0x10(%rsp), %xmm1
divsd %xmm0, %xmm1
maxsd 0x8(%rsp), %xmm1
addq $0x18, %r15
jne 0xea61
incq %r12
addq $0x8, %rbx
cmpq $0x3, %r12
jne 0xea5a
movq 0x20(%rsp), %rax
movsd %xmm1, 0x228(%rax)
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
testq %rax, %rax
jne 0xe983
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq