// File: /workspace/github_cpp_makefile_star2_O3/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 0xf2c5(%rip), %rax      # 0x242e0
movq (%rax), %rax
leaq 0x1a2b8(%rax), %rcx
leaq 0x390(%rax), %rdx
movl $0x1, %esi
xorl %edi, %edi
xorps %xmm0, %xmm0
xorl %r8d, %r8d
imulq $0x360, %rsi, %r9       # imm = 0x360
movsd 0x33e70(%r9,%rax), %xmm1
movsd 0x33ea0(%r9,%rax), %xmm2
movsd 0x33ed0(%r9,%rax), %xmm3
movsd 0x33f00(%r9,%rax), %xmm4
movsd %xmm1, 0x19f50(%r9,%rax)
movsd %xmm2, 0x19f80(%r9,%rax)
movsd %xmm3, 0x19fb0(%r9,%rax)
movsd %xmm4, 0x19fe0(%r9,%rax)
imulq $0x360, %r8, %r9        # imm = 0x360
movq %rdi, 0x20(%rcx,%r9)
movups %xmm0, 0x10(%rcx,%r9)
movups %xmm0, (%rcx,%r9)
movups %xmm0, 0x30(%rcx,%r9)
movups %xmm0, 0x40(%rcx,%r9)
movq %rdi, 0x50(%rcx,%r9)
movups %xmm0, 0x60(%rcx,%r9)
movups %xmm0, 0x70(%rcx,%r9)
movq %rdi, 0x80(%rcx,%r9)
movups %xmm0, 0x90(%rcx,%r9)
movups %xmm0, 0xa0(%rcx,%r9)
movq %rdi, 0xb0(%rcx,%r9)
xorl %r9d, %r9d
movsd 0x19f20(%rdx,%r9), %xmm1
addsd %xmm1, %xmm1
subsd 0x33e40(%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 0x150e9
incq %rsi
incq %r8
addq $0x360, %rdx            # imm = 0x360
cmpq $0x7b, %r8
jne 0x15039
leaq 0x662c78(%rax), %rcx
leaq 0x67cb98(%rax), %rdx
movl $0x1, %esi
xorl %edi, %edi
xorps %xmm0, %xmm0
xorl %r8d, %r8d
imulq $0x360, %rsi, %r9       # imm = 0x360
movsd 0x6489f0(%r9,%rax), %xmm1
movsd 0x648a20(%r9,%rax), %xmm2
movsd 0x648a50(%r9,%rax), %xmm3
movsd 0x648a80(%r9,%rax), %xmm4
movsd %xmm1, 0x662910(%r9,%rax)
movsd %xmm2, 0x662940(%r9,%rax)
movsd %xmm3, 0x662970(%r9,%rax)
movsd %xmm4, 0x6629a0(%r9,%rax)
imulq $0x360, %r8, %r9        # imm = 0x360
movq %rdi, 0x20(%rcx,%r9)
movups %xmm0, 0x10(%rcx,%r9)
movups %xmm0, (%rcx,%r9)
movups %xmm0, 0x30(%rcx,%r9)
movups %xmm0, 0x40(%rcx,%r9)
movq %rdi, 0x50(%rcx,%r9)
movups %xmm0, 0x60(%rcx,%r9)
movups %xmm0, 0x70(%rcx,%r9)
movq %rdi, 0x80(%rcx,%r9)
movups %xmm0, 0x90(%rcx,%r9)
movups %xmm0, 0xa0(%rcx,%r9)
movq %rdi, 0xb0(%rcx,%r9)
xorl %r9d, %r9d
movsd -0x19f28(%rdx,%r9), %xmm1
addsd %xmm1, %xmm1
subsd -0x33e48(%rdx,%r9), %xmm1
movsd %xmm1, -0x8(%rdx,%r9)
movups %xmm0, (%rdx,%r9)
movups %xmm0, 0x10(%rdx,%r9)
movq $0x0, 0x20(%rdx,%r9)
addq $0x30, %r9
cmpq $0xc0, %r9
jne 0x1520b
incq %rsi
incq %r8
addq $0x360, %rdx            # imm = 0x360
cmpq $0x7b, %r8
jne 0x1515b
leaq 0x19bf8(%rax), %rcx
leaq 0x19f58(%rax), %rdx
movl $0x1, %esi
xorl %edi, %edi
xorps %xmm0, %xmm0
xorl %r8d, %r8d
imulq $0x19f20, %rsi, %r9     # imm = 0x19F20
movsd -0x690(%r9,%rax), %xmm1
movsd -0x660(%r9,%rax), %xmm2
movsd -0x630(%r9,%rax), %xmm3
movsd -0x600(%r9,%rax), %xmm4
movsd %xmm1, -0x330(%r9,%rax)
movsd %xmm2, -0x300(%r9,%rax)
movsd %xmm3, -0x2d0(%r9,%rax)
movsd %xmm4, -0x2a0(%r9,%rax)
imulq $0x19f20, %r8, %r9      # imm = 0x19F20
movq %rdi, 0x20(%rcx,%r9)
movups %xmm0, 0x10(%rcx,%r9)
movups %xmm0, (%rcx,%r9)
movups %xmm0, 0x30(%rcx,%r9)
movups %xmm0, 0x40(%rcx,%r9)
movq %rdi, 0x50(%rcx,%r9)
movups %xmm0, 0x60(%rcx,%r9)
movups %xmm0, 0x70(%rcx,%r9)
movq %rdi, 0x80(%rcx,%r9)
movups %xmm0, 0x90(%rcx,%r9)
movups %xmm0, 0xa0(%rcx,%r9)
movq %rdi, 0xb0(%rcx,%r9)
xorl %r9d, %r9d
movsd -0x368(%rdx,%r9), %xmm1
addsd %xmm1, %xmm1
subsd -0x6c8(%rdx,%r9), %xmm1
movsd %xmm1, -0x8(%rdx,%r9)
movups %xmm0, (%rdx,%r9)
movups %xmm0, 0x10(%rdx,%r9)
movq $0x0, 0x20(%rdx,%r9)
addq $0x30, %r9
cmpq $0xc0, %r9
jne 0x1532d
incq %rsi
incq %r8
addq $0x19f20, %rdx          # imm = 0x19F20
cmpq $0x41, %r8
jne 0x1527d
leaq 0x6f8(%rax), %rcx
leaq 0x390(%rax), %rdx
movl $0x1, %esi
xorl %edi, %edi
xorps %xmm0, %xmm0
xorl %r8d, %r8d
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)
imulq $0x19f20, %r8, %r9      # imm = 0x19F20
movq %rdi, 0x20(%rcx,%r9)
movups %xmm0, 0x10(%rcx,%r9)
movups %xmm0, (%rcx,%r9)
movups %xmm0, 0x30(%rcx,%r9)
movups %xmm0, 0x40(%rcx,%r9)
movq %rdi, 0x50(%rcx,%r9)
movups %xmm0, 0x60(%rcx,%r9)
movups %xmm0, 0x70(%rcx,%r9)
movq %rdi, 0x80(%rcx,%r9)
movups %xmm0, 0x90(%rcx,%r9)
movups %xmm0, 0xa0(%rcx,%r9)
movq %rdi, 0xb0(%rcx,%r9)
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 0x1544f
incq %rsi
incq %r8
addq $0x19f20, %rdx          # imm = 0x19F20
cmpq $0x41, %r8
jne 0x1539f
retq