// File: /workspace/github_cpp_makefile_star2_O1/jamesliu516[P]amrdg2d/farfield_boundary.cpp
// Function: farFieldBoundary(int)
void farFieldBoundary(int itt)
{
    int j,k;
    int i1, j1;
    double nx;
    double ny;
    SHBL sh;
    JBBL jb1, jb2;

    double speed, a, vbn;

    vbn=0.0;
    //-----------------------------------------------------------------------

    //----Զ���߽�������λ�ں�y�����ᴹֱ���²���----begin--	 
    nx=0.0;
    ny = 1.0;

    for(k=1; k <= Nx; k++)
    {
        //----�²��Ǹ���-------begin--
        sh.q = bodygrid[2*Nx +k].dof[0][0];
        sh.qu = bodygrid[2*Nx +k].dof[1][0];
        sh.qv = bodygrid[2*Nx +k].dof[2][0];
        sh.te = bodygrid[2*Nx +k].dof[3][0];

        bodygrid[Nx +k].dof[0][0] = sh.q;
        bodygrid[Nx +k].dof[1][0]= sh.qu;
        bodygrid[Nx +k].dof[2][0]= sh.qv;
        bodygrid[Nx +k].dof[3][0]= sh.te;
        for( i1=0; i1<4; ++i1) 
            for(j1=1; j1<nDOF; ++j1)
                bodygrid[Nx +k].dof[i1][j1]=0.0;


        //---������������------
        for(i1=0; i1<4; ++i1) {
            bodygrid[k].dof[i1][0] = 2.0*bodygrid[Nx+k].dof[i1][0]
                - bodygrid[2*Nx+k].dof[i1][0];
            for(j1=1; j1<nDOF;++j1)
                bodygrid[k].dof[i1][j1] = 0.0;
        }

        //----�²��Ǹ���-------end--
    }


    //////////////////////////////////////////////////////////////////////////////////---------------------2008.7.1

    //     for(j=1;j<=Ny;j++) {
    //       for(k=1;k<=Nx;k++) {	         				       		       
    //			bodygrid[(j-1)*Nx +k]

    //----Զ���߽�������λ�ں�y�����ᴹֱ���ϲ���----begin--	 
    nx=0.0;
    ny = -1.0;


    for(k=1; k <= Nx; k++)
    {
        //----�ϲ��Ǹ���-------begin--
        sh.q = bodygrid[(Ny-3)*Nx+k].dof[0][0];
        sh.qu = bodygrid[(Ny-3)*Nx+k].dof[1][0];
        sh.qv = bodygrid[(Ny-3)*Nx+k].dof[2][0];
        sh.te = bodygrid[(Ny-3)*Nx+k].dof[3][0];


        bodygrid[(Ny-2)*Nx+k].dof[0][0] = sh.q;
        bodygrid[(Ny-2)*Nx+k].dof[1][0]= sh.qu;
        bodygrid[(Ny-2)*Nx+k].dof[2][0] = sh.qv;
        bodygrid[(Ny-2)*Nx+k].dof[3][0] = sh.te;

        for(i1=0; i1<4; ++i1)
            for(j1=1; j1<nDOF; ++j1) 
                bodygrid[(Ny-2)*Nx+k].dof[i1][j1] = 0.0;

        //--������������------
        for (i1=0; i1<4; ++i1) {
            bodygrid[(Ny-1)*Nx+k].dof[i1][0] = 2.0*bodygrid[(Ny-2)*Nx+k].dof[i1][0]
                - bodygrid[(Ny-3)*Nx+k].dof[i1][0];
            for(j1=1; j1<nDOF; ++j1)
                bodygrid[(Ny-1)*Nx+k].dof[i1][j1] = 0.0;
        }
        //----------------------------------------------
        //----�ϲ��Ǹ���-------end--
    }


    //-------------------�Ҳ���---------0000000000000------begin---
    nx = -1.0;
    ny=0.0;

    for(j=1; j <= Ny; j++)
    {
        /*-----------begin--*/
        sh.q = bodygrid[(j-1)*Nx+Nx-2].dof[0][0];
        sh.qu = bodygrid[(j-1)*Nx+Nx-2].dof[1][0];
        sh.qv = bodygrid[(j-1)*Nx+Nx-2].dof[2][0];
        sh.te = bodygrid[(j-1)*Nx+Nx-2].dof[3][0];

        bodygrid[(j-1)*Nx+Nx-1].dof[0][0]= sh.q;
        bodygrid[(j-1)*Nx+Nx-1].dof[1][0] = sh.qu;
        bodygrid[(j-1)*Nx+Nx-1].dof[2][0] = sh.qv;
        bodygrid[(j-1)*Nx+Nx-1].dof[3][0] = sh.te;

        for(i1=0; i1<4; ++i1)
            for(j1=1; j1<nDOF; ++j1)
                bodygrid[(j-1)*Nx+Nx-1].dof[i1][j1]=0.0;

        //---������������------
        for(i1=0; i1<4; ++i1) {
            bodygrid[(j-1)*Nx+Nx].dof[i1][0]
                = 2.0*bodygrid[(j-1)*Nx+Nx-1].dof[i1][0] - bodygrid[(j-1)*Nx+Nx-2].dof[i1][0];
            for(j1=1; j1<nDOF; ++j1)
                bodygrid[(j-1)*Nx+Nx].dof[i1][j1]=0.0;	
        }	       

    }

    //----�Ҳ���------------------end--------

    //-------------------������----begin------
    nx = 1.0;
    ny=0.0;

    for(j=1; j <= Ny; j++)
    {
        //-----------begin--------
        sh.q = bodygrid[(j-1)*Nx+3].dof[0][0];
        sh.qu = bodygrid[(j-1)*Nx+3].dof[1][0];
        sh.qv = bodygrid[(j-1)*Nx+3].dof[2][0];
        sh.te = bodygrid[(j-1)*Nx+3].dof[3][0];


        bodygrid[(j-1)*Nx+2].dof[0][0] = sh.q;
        bodygrid[(j-1)*Nx+2].dof[1][0]= sh.qu;
        bodygrid[(j-1)*Nx+2].dof[2][0] = sh.qv;
        bodygrid[(j-1)*Nx+2].dof[3][0]= sh.te;
        for(i1=0; i1<4; ++i1) 
            for(j1=1; j1<nDOF; ++j1)
                bodygrid[(j-1)*Nx+2].dof[i1][j1]=0.0;

        //---������������------
        for(i1=0; i1<4; ++i1) {
            bodygrid[(j-1)*Nx+1].dof[i1][0]
                = 2.0*bodygrid[(j-1)*Nx+2].dof[i1][0] - bodygrid[(j-1)*Nx+3].dof[i1][0];
            for(j1=1; j1<nDOF; ++j1)
                bodygrid[(j-1)*Nx+1].dof[i1][j1]=0.0;
        }
    }

    //----������-------------------------end----
}

// Assembly:
leaq 0xfc21(%rip), %rax      # 0x252e0
movq (%rax), %rcx
leaq 0x1a2b8(%rcx), %rdx
leaq 0x390(%rcx), %rsi
movl $0x1, %edi
xorl %r8d, %r8d
xorps %xmm0, %xmm0
movl $0x360, %r9d            # imm = 0x360
imulq $0x360, %rdi, %r10      # imm = 0x360
movsd 0x33e70(%r10,%rcx), %xmm1
movsd 0x33ea0(%r10,%rcx), %xmm2
movsd 0x33ed0(%r10,%rcx), %xmm3
movsd 0x33f00(%r10,%rcx), %xmm4
movsd %xmm1, 0x19f50(%r10,%rcx)
movsd %xmm2, 0x19f80(%r10,%rcx)
movsd %xmm3, 0x19fb0(%r10,%rcx)
movsd %xmm4, 0x19fe0(%r10,%rcx)
xorl %r10d, %r10d
movups %xmm0, 0x10(%rdx,%r10)
movups %xmm0, (%rdx,%r10)
movq $0x0, 0x20(%rdx,%r10)
addq $0x30, %r10
cmpq $0xc0, %r10
jne 0x1573b
xorl %r10d, %r10d
movsd 0x19f20(%rsi,%r10), %xmm1
addsd %xmm1, %xmm1
subsd 0x33e40(%rsi,%r10), %xmm1
movsd %xmm1, (%rsi,%r10)
movups %xmm0, 0x8(%rsi,%r10)
movups %xmm0, 0x18(%rsi,%r10)
movq $0x0, 0x28(%rsi,%r10)
addq $0x30, %r10
cmpq $0xc0, %r10
jne 0x1575f
incq %rdi
incq %r8
addq %r9, %rdx
addq %r9, %rsi
cmpq $0x7b, %r8
jne 0x156e1
movq (%rax), %rcx
leaq 0x662c78(%rcx), %rdx
leaq 0x67cb98(%rcx), %rsi
movl $0x1, %edi
xorl %r8d, %r8d
xorps %xmm0, %xmm0
movl $0x360, %r9d            # imm = 0x360
imulq $0x360, %rdi, %r10      # imm = 0x360
movsd 0x6489f0(%r10,%rcx), %xmm1
movsd 0x648a20(%r10,%rcx), %xmm2
movsd 0x648a50(%r10,%rcx), %xmm3
movsd 0x648a80(%r10,%rcx), %xmm4
movsd %xmm1, 0x662910(%r10,%rcx)
movsd %xmm2, 0x662940(%r10,%rcx)
movsd %xmm3, 0x662970(%r10,%rcx)
movsd %xmm4, 0x6629a0(%r10,%rcx)
xorl %r10d, %r10d
movups %xmm0, 0x10(%rdx,%r10)
movups %xmm0, (%rdx,%r10)
movq $0x0, 0x20(%rdx,%r10)
addq $0x30, %r10
cmpq $0xc0, %r10
jne 0x15831
xorl %r10d, %r10d
movsd -0x19f28(%rsi,%r10), %xmm1
addsd %xmm1, %xmm1
subsd -0x33e48(%rsi,%r10), %xmm1
movsd %xmm1, -0x8(%rsi,%r10)
movups %xmm0, (%rsi,%r10)
movups %xmm0, 0x10(%rsi,%r10)
movq $0x0, 0x20(%rsi,%r10)
addq $0x30, %r10
cmpq $0xc0, %r10
jne 0x15855
incq %rdi
incq %r8
addq %r9, %rdx
addq %r9, %rsi
cmpq $0x7b, %r8
jne 0x157d7
movq (%rax), %rcx
leaq 0x19bf8(%rcx), %rdx
leaq 0x19f58(%rcx), %rsi
movl $0x1, %edi
xorl %r8d, %r8d
xorps %xmm0, %xmm0
movl $0x19f20, %r9d          # imm = 0x19F20
imulq $0x19f20, %rdi, %r10    # imm = 0x19F20
movsd -0x690(%r10,%rcx), %xmm1
movsd -0x660(%r10,%rcx), %xmm2
movsd -0x630(%r10,%rcx), %xmm3
movsd -0x600(%r10,%rcx), %xmm4
movsd %xmm1, -0x330(%r10,%rcx)
movsd %xmm2, -0x300(%r10,%rcx)
movsd %xmm3, -0x2d0(%r10,%rcx)
movsd %xmm4, -0x2a0(%r10,%rcx)
xorl %r10d, %r10d
movups %xmm0, 0x10(%rdx,%r10)
movups %xmm0, (%rdx,%r10)
movq $0x0, 0x20(%rdx,%r10)
addq $0x30, %r10
cmpq $0xc0, %r10
jne 0x15927
xorl %r10d, %r10d
movsd -0x368(%rsi,%r10), %xmm1
addsd %xmm1, %xmm1
subsd -0x6c8(%rsi,%r10), %xmm1
movsd %xmm1, -0x8(%rsi,%r10)
movups %xmm0, (%rsi,%r10)
movups %xmm0, 0x10(%rsi,%r10)
movq $0x0, 0x20(%rsi,%r10)
addq $0x30, %r10
cmpq $0xc0, %r10
jne 0x1594b
incq %rdi
incq %r8
addq %r9, %rdx
addq %r9, %rsi
cmpq $0x41, %r8
jne 0x158cd
movq (%rax), %rax
leaq 0x6f8(%rax), %rcx
leaq 0x390(%rax), %rdx
movl $0x1, %esi
xorl %edi, %edi
xorps %xmm0, %xmm0
movl $0x19f20, %r8d          # imm = 0x19F20
imulq $0x19f20, %rsi, %r9     # imm = 0x19F20
movsd -0x194d0(%r9,%rax), %xmm1
movsd -0x194a0(%r9,%rax), %xmm2
movsd -0x19470(%r9,%rax), %xmm3
movsd -0x19440(%r9,%rax), %xmm4
movsd %xmm1, -0x19830(%r9,%rax)
movsd %xmm2, -0x19800(%r9,%rax)
movsd %xmm3, -0x197d0(%r9,%rax)
movsd %xmm4, -0x197a0(%r9,%rax)
xorl %r9d, %r9d
movups %xmm0, 0x10(%rcx,%r9)
movups %xmm0, (%rcx,%r9)
movq $0x0, 0x20(%rcx,%r9)
addq $0x30, %r9
cmpq $0xc0, %r9
jne 0x15a1c
xorl %r9d, %r9d
movsd 0x360(%rdx,%r9), %xmm1
addsd %xmm1, %xmm1
subsd 0x6c0(%rdx,%r9), %xmm1
movsd %xmm1, (%rdx,%r9)
movups %xmm0, 0x8(%rdx,%r9)
movups %xmm0, 0x18(%rdx,%r9)
movq $0x0, 0x28(%rdx,%r9)
addq $0x30, %r9
cmpq $0xc0, %r9
jne 0x15a40
incq %rsi
incq %rdi
addq %r8, %rcx
addq %r8, %rdx
cmpq $0x41, %rdi
jne 0x159c2
retq