// File: jamesliu516[P]amrdg2d/farfield_boundary.cpp
// Function: getInletOutletBndry(bodygridclass*, int)
void getInletOutletBndry(OctCell *ghostcell, int in2out)
{
    double nx,ny;
    double speed, a, vbn=0.0;
    PXYZ symtrcpt; 
    PXYZ ghostpt, plsA, plsB;
    int i1,j1;

    //Rieman problem������
    //    double dil,dir,ui,prei;
    JBBL jb1,jb2; 

    SHBL sh;

    //	OctCell *leafp;
    OctCell *pincell=NULL;
    vector< OctCell * > grid;


    ghostpt.x = ghostcell->xc1;
    ghostpt.y = ghostcell->yc1;	
    if(in2out==0){
        jb2=State_l;

        jbblToShbl(&jb2, &sh);

        ghostcell->dof[0][0] = sh.q;
        ghostcell->dof[1][0]= sh.qu;
        ghostcell->dof[2][0]= sh.qv;
        ghostcell->dof[3][0]= sh.te;
        for( i1=0; i1<4; ++i1) 
            for(j1=1; j1<nDOF; ++j1)
                ghostcell->dof[i1][j1]=0.0;

    }
    else {
        symtrcpt.x=2.0*xOutlet-ghostpt.x;
        symtrcpt.y=ghostpt.y;
        nx=-1.0;
        ny=0.0;
        getGridIndex2(ghostcell, &symtrcpt, pincell);
        findIntpltCell(pincell, ghostpt, symtrcpt, grid);
        chazhi4smtrictPshbl(grid, symtrcpt, jb1); 
        jbblToShbl(&jb1, &sh);

        ghostcell->dof[0][0] = sh.q;
        ghostcell->dof[1][0]= sh.qu;
        ghostcell->dof[2][0]= sh.qv;
        ghostcell->dof[3][0]= sh.te;
        for( i1=0; i1<4; ++i1) 
            for(j1=1; j1<nDOF; ++j1)
                ghostcell->dof[i1][j1]=0.0;
    }
}

// Assembly:
subq $0x118, %rsp            # imm = 0x118
movq %rdi, 0x110(%rsp)
movl %esi, 0x10c(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0xe0(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0x6310
leaq 0xc0(%rsp), %rdi
callq 0x6310
leaq 0xb0(%rsp), %rdi
callq 0x6310
leaq 0xa0(%rsp), %rdi
callq 0x6310
leaq 0x78(%rsp), %rdi
callq 0x6530
leaq 0x50(%rsp), %rdi
callq 0x6530
leaq 0x30(%rsp), %rdi
callq 0x21aa0
movq $0x0, 0x28(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x62a0
movq 0x110(%rsp), %rax
movsd 0x278(%rax), %xmm0
movsd %xmm0, 0xc0(%rsp)
movq 0x110(%rsp), %rax
movsd 0x280(%rax), %xmm0
movsd %xmm0, 0xc8(%rsp)
cmpl $0x0, 0x10c(%rsp)
jne 0x30948
leaq 0x20122(%rip), %rax     # 0x50950
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movaps %xmm1, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x23570
jmp 0x30850
movsd 0x30(%rsp), %xmm0
movq 0x110(%rsp), %rax
movsd %xmm0, 0x30(%rax)
movsd 0x38(%rsp), %xmm0
movq 0x110(%rsp), %rax
movsd %xmm0, 0x60(%rax)
movsd 0x40(%rsp), %xmm0
movq 0x110(%rsp), %rax
movsd %xmm0, 0x90(%rax)
movsd 0x48(%rsp), %xmm0
movq 0x110(%rsp), %rax
movsd %xmm0, 0xc0(%rax)
movl $0x0, 0x9c(%rsp)
cmpl $0x4, 0x9c(%rsp)
jge 0x30943
movl $0x1, 0x98(%rsp)
cmpl $0x6, 0x98(%rsp)
jge 0x3092b
movq 0x110(%rsp), %rax
addq $0x30, %rax
movslq 0x9c(%rsp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movslq 0x98(%rsp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl 0x98(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x98(%rsp)
jmp 0x308c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x8(%rsp)
movl %eax, 0x4(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x62b0
jmp 0x30ae0
jmp 0x3092d
movl 0x9c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x9c(%rsp)
jmp 0x308ad
jmp 0x30ace
movsd 0xc0(%rsp), %xmm1
movsd 0xef87(%rip), %xmm0     # 0x3f8e0
subsd %xmm1, %xmm0
movsd %xmm0, 0xd0(%rsp)
movsd 0xc8(%rsp), %xmm0
movsd %xmm0, 0xd8(%rsp)
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, 0x100(%rsp)
movq $0x0, 0xf8(%rsp)
movq 0x110(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x2a4c0
jmp 0x309b2
movq 0x28(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
leaq 0x10(%rsp), %rcx
callq 0x2a8b0
jmp 0x309d3
leaq 0x10(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0x2b9f0
jmp 0x309ec
leaq 0x78(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x23570
jmp 0x309fd
movsd 0x30(%rsp), %xmm0
movq 0x110(%rsp), %rax
movsd %xmm0, 0x30(%rax)
movsd 0x38(%rsp), %xmm0
movq 0x110(%rsp), %rax
movsd %xmm0, 0x60(%rax)
movsd 0x40(%rsp), %xmm0
movq 0x110(%rsp), %rax
movsd %xmm0, 0x90(%rax)
movsd 0x48(%rsp), %xmm0
movq 0x110(%rsp), %rax
movsd %xmm0, 0xc0(%rax)
movl $0x0, 0x9c(%rsp)
cmpl $0x4, 0x9c(%rsp)
jge 0x30acc
movl $0x1, 0x98(%rsp)
cmpl $0x6, 0x98(%rsp)
jge 0x30ab7
movq 0x110(%rsp), %rax
addq $0x30, %rax
movslq 0x9c(%rsp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movslq 0x98(%rsp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl 0x98(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x98(%rsp)
jmp 0x30a6f
jmp 0x30ab9
movl 0x9c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x9c(%rsp)
jmp 0x30a5a
jmp 0x30ace
leaq 0x10(%rsp), %rdi
callq 0x62b0
addq $0x118, %rsp            # imm = 0x118
retq
movq 0x8(%rsp), %rdi
callq 0x3440
nopw (%rax,%rax)