// File: /workspace/github_cpp_makefile_star2_O2/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 $0x178, %rsp            # imm = 0x178
leaq 0x1abd8(%rip), %rax     # 0x28610
movq (%rax), %rax
leaq 0xdd7e(%rip), %r12      # 0x1b7c0
pushq $0x6
popq %rbx
testq %rax, %rax
je 0xdbeb
movq 0x8(%rax), %rcx
cmpw $0x0, 0x1b0(%rcx)
jne 0xdbe2
cmpw $0x2, (%rax)
jg 0xdbe2
movq %rax, 0x30(%rsp)
andq $0x0, 0x220(%rcx)
andq $0x0, 0x230(%rcx)
movq %rcx, 0x28(%rsp)
leaq 0x30(%rcx), %rax
movq %rax, 0x38(%rsp)
leaq 0x50(%rsp), %r13
xorl %ecx, %ecx
cmpq $0x4, %rcx
je 0xdb19
movq %rcx, 0x40(%rsp)
imulq $0x30, %rcx, %r14
addq 0x38(%rsp), %r14
movq %r13, 0x48(%rsp)
xorl %ebp, %ebp
cmpq $0x3, %rbp
je 0xdb03
movsd (%r12,%rbp,8), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r13, 0x10(%rsp)
xorl %r15d, %r15d
cmpq $0x18, %r15
je 0xdaf5
movsd (%r15,%r12), %xmm0
movsd 0x8(%rsp), %xmm1
movq %r14, %rdi
movl %ebx, %esi
callq 0xc9cc
movsd %xmm0, (%r13)
addq $0x8, %r15
addq $0x18, %r13
jmp 0xdac9
incq %rbp
movq 0x10(%rsp), %r13
addq $0x8, %r13
jmp 0xdaaf
movq 0x40(%rsp), %rcx
incq %rcx
movq 0x48(%rsp), %r13
addq $0x48, %r13
jmp 0xda94
leaq 0x128(%rsp), %r14
xorl %r15d, %r15d
movsd 0xdc84(%rip), %xmm0     # 0x1b7b0
movsd %xmm0, 0x8(%rsp)
cmpq $0x3, %r15
je 0xdbca
pushq $-0x48
popq %r13
testq %r13, %r13
je 0xdbbe
movsd -0x48(%r14,%r13), %xmm1
movhpd (%r14,%r13), %xmm1      # xmm1 = xmm1[0],mem[0]
movsd -0x90(%r14,%r13), %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 0xd5f0(%rip), %xmm2     # 0x1b170
addsd 0x48(%r14,%r13), %xmm2
mulsd 0xd699(%rip), %xmm2     # 0x1b228
movapd %xmm2, 0x10(%rsp)
movsd 0xd693(%rip), %xmm1     # 0x1b230
callq 0x3340
movapd 0x10(%rsp), %xmm1
divsd %xmm0, %xmm1
maxsd 0x8(%rsp), %xmm1
addq $0x18, %r13
movsd %xmm1, 0x8(%rsp)
jmp 0xdb40
incq %r15
addq $0x8, %r14
jmp 0xdb32
movq 0x28(%rsp), %rax
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x228(%rax)
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
jmp 0xda45
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq