// File: 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:
subq $0x1b8, %rsp            # imm = 0x1B8
leaq 0x2f172(%rip), %rax     # 0x506a0
movq (%rax), %rax
movq %rax, 0x1b0(%rsp)
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x3150
cmpq $0x0, 0x1b0(%rsp)
je 0x218f2
movq 0x1b0(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x1a8(%rsp)
movq 0x1a8(%rsp), %rax
movswl 0x1b0(%rax), %eax
cmpl $0x0, %eax
jne 0x218d9
movq 0x1b0(%rsp), %rax
movswl (%rax), %eax
cmpl $0x2, %eax
jg 0x218d9
movq 0x1a8(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x220(%rax)
movq 0x1a8(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x230(%rax)
movsd 0x1e181(%rip), %xmm0    # 0x3f748
movsd %xmm0, 0x1a0(%rsp)
movw $0x0, 0x1e(%rsp)
movswl 0x1e(%rsp), %eax
cmpl $0x4, %eax
jge 0x216bd
movw $0x0, 0x1c(%rsp)
movswl 0x1c(%rsp), %eax
cmpl $0x3, %eax
jge 0x216a8
movw $0x0, 0x1a(%rsp)
movswl 0x1a(%rsp), %eax
cmpl $0x3, %eax
jge 0x21693
movswq 0x1a(%rsp), %rcx
leaq 0x1e164(%rip), %rax     # 0x3f780
movsd (%rax,%rcx,8), %xmm0
movswq 0x1c(%rsp), %rcx
leaq 0x1e152(%rip), %rax     # 0x3f780
movsd (%rax,%rcx,8), %xmm1
movq 0x1a8(%rsp), %rdi
addq $0x30, %rdi
movswq 0x1e(%rsp), %rax
imulq $0x30, %rax, %rax
addq %rax, %rdi
movl $0x6, %esi
callq 0x1f4b0
movswq 0x1e(%rsp), %rcx
leaq 0x70(%rsp), %rax
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movswq 0x1a(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movswq 0x1c(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movw 0x1a(%rsp), %ax
addw $0x1, %ax
movw %ax, 0x1a(%rsp)
jmp 0x21601
jmp 0x21695
movw 0x1c(%rsp), %ax
addw $0x1, %ax
movw %ax, 0x1c(%rsp)
jmp 0x215ec
jmp 0x216aa
movw 0x1e(%rsp), %ax
addw $0x1, %ax
movw %ax, 0x1e(%rsp)
jmp 0x215d7
movw $0x0, 0x18(%rsp)
movswl 0x18(%rsp), %eax
cmpl $0x3, %eax
jge 0x218c0
movw $0x0, 0x16(%rsp)
movswl 0x16(%rsp), %eax
cmpl $0x3, %eax
jge 0x218ab
leaq 0x70(%rsp), %rax
addq $0xd8, %rax
movswq 0x16(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movswq 0x18(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x70(%rsp), %rax
addq $0x48, %rax
movswq 0x16(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movswq 0x18(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
leaq 0x70(%rsp), %rax
addq $0x48, %rax
movswq 0x16(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movswq 0x18(%rsp), %rcx
mulsd (%rax,%rcx,8), %xmm1
leaq 0x70(%rsp), %rax
movswq 0x16(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movswq 0x18(%rsp), %rcx
divsd (%rax,%rcx,8), %xmm1
leaq 0x70(%rsp), %rax
addq $0x90, %rax
movswq 0x16(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movswq 0x18(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm2
leaq 0x70(%rsp), %rax
addq $0x90, %rax
movswq 0x16(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movswq 0x18(%rsp), %rcx
mulsd (%rax,%rcx,8), %xmm2
leaq 0x70(%rsp), %rax
movswq 0x16(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movswq 0x18(%rsp), %rcx
divsd (%rax,%rcx,8), %xmm2
addsd %xmm2, %xmm1
movsd 0x1d960(%rip), %xmm2    # 0x3f138
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x1da00(%rip), %xmm0    # 0x3f1e8
mulsd %xmm1, %xmm0
movswq 0x16(%rsp), %rcx
leaq 0x20(%rsp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movswq 0x18(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movswq 0x16(%rsp), %rcx
leaq 0x20(%rsp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movswq 0x18(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x70(%rsp), %rax
movswq 0x16(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movswq 0x18(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x1d987(%rip), %xmm1    # 0x3f1d8
callq 0x3430
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x198(%rsp)
movsd 0x1a0(%rsp), %xmm1
movsd 0x198(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x21896
movsd 0x198(%rsp), %xmm0
movsd %xmm0, 0x1a0(%rsp)
jmp 0x21898
movw 0x16(%rsp), %ax
addw $0x1, %ax
movw %ax, 0x16(%rsp)
jmp 0x216d9
jmp 0x218ad
movw 0x18(%rsp), %ax
addw $0x1, %ax
movw %ax, 0x18(%rsp)
jmp 0x216c4
movsd 0x1a0(%rsp), %xmm0
movq 0x1a8(%rsp), %rax
movsd %xmm0, 0x228(%rax)
movq 0x1b0(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x1b0(%rsp)
jmp 0x2154a
addq $0x1b8, %rsp            # imm = 0x1B8
retq
nopw (%rax,%rax)