// File: /workspace/github_cpp_makefile_star2_O1/jamesliu516[P]amrdg2d/outputgrid.cpp
// Function: PrintNode_bk(bodygridclass*)
void PrintNode_bk(OctCell* parent)
{
	int i,j;
	int ix,jy,kz,m;
//	double plevel;
	double x[4],y[4];//网格顶点的坐标
	double hcx,xc,yc,hcy;
	
	if(parent->children[1]==NULL)
	{   
	//	if(parent->flag>0)
		//{
		//	plevel=parent->level+1.0;		    
			//hc=h/pow(2.0,plevel);//子网格的步长	
			hcx=0.5*parent->dx;
			hcy=0.5*parent->dy;	   
			xc=parent->xc1;	    
			yc=parent->yc1;		
			//printf("xc=%15.8e,yc=%15.8e\n",parent->xc1,parent->yc1);
		//	cout<<"xc= "<<xc<<", yc= "<<yc<<endl;		
			for(m=0;m<4;m++)		
			{				
				switch(m)					
				{				
				case 0: ix=-1;jy=-1;kz=-1;break;				
				case 1: ix=1;jy=-1;kz=-1;break;				
				case 2: ix=1;jy=1;kz=-1;break;				
				case 3: ix=-1;jy=1;kz=-1;break;								
				}         
				x[m]=xc+ix*hcx;			
				y[m]=yc+jy*hcy;
		
			}
	
			for(j=0;j<4;j++)		
			{		
				if(Np==1)		
				{								
					pointOutput[Np].x=x[j];                   			
					pointOutput[Np].y=y[j];	
							
					cellOutput[NU].cpoint[j]=Np;								
					Np++; 		
				}					
				else		
				{													
					//for(i=1;i<Np;i++)	
					for(i=Np-1;i>0;i--)				
					{												
						if(fabs(x[j]-pointOutput[i].x)+fabs(y[j]-pointOutput[i].y)<1.0e-8) break;					
					//	if(i==Np-1) goto loop1;
					      if(i==1) goto loop1;				
					}								
					cellOutput[NU].cpoint[j]=i;				
					goto loop2;
loop1:
					{					
						pointOutput[Np].x=x[j];          														
						pointOutput[Np].y=y[j];					
						cellOutput[NU].cpoint[j]=Np;								
						Np++;  					
//					printf("point[%d].x=%f,point[%d].y=%f\n",Np-1,point[Np-1].x,Np-1,point[Np-1].y);		
//					getch();			
					}														    								          			
				}
loop2: 			continue;					
			}				
			NU++;		
     //   }
	}
	else 
	{
		for(int im=0;im<4;im++)
		{
			PrintNode_bk(parent->children[im]);
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
cmpq $0x0, 0x260(%rdi)
je 0x73d6
xorl %r14d, %r14d
movq 0x258(%rbx,%r14,8), %rdi
callq 0x73a4
incq %r14
cmpq $0x4, %r14
jne 0x73bb
jmp 0x7545
movsd 0x16d6a(%rip), %xmm0    # 0x1e148
movsd 0x288(%rbx), %xmm1
mulsd %xmm0, %xmm1
mulsd 0x290(%rbx), %xmm0
movsd 0x278(%rbx), %xmm2
movsd 0x280(%rbx), %xmm3
leaq 0x16dd7(%rip), %rax     # 0x1e1e0
leaq 0x16dc0(%rip), %rcx     # 0x1e1d0
xorl %edx, %edx
cmpq $0x3, %rdx
ja 0x741c
movl (%rcx), %esi
movl (%rax), %edi
xorps %xmm4, %xmm4
cvtsi2sd %edi, %xmm4
mulsd %xmm1, %xmm4
addsd %xmm2, %xmm4
xorps %xmm5, %xmm5
cvtsi2sd %esi, %xmm5
movsd %xmm4, 0x20(%rsp,%rdx,8)
mulsd %xmm0, %xmm5
addsd %xmm3, %xmm5
movsd %xmm5, (%rsp,%rdx,8)
incq %rdx
addq $0x4, %rax
addq $0x4, %rcx
cmpq $0x4, %rdx
jne 0x7412
movl 0x1ddcc(%rip), %eax     # 0x25228
movslq 0x1ddc9(%rip), %rcx     # 0x2522c
shlq $0x4, %rcx
addq 0x2351a(%rip), %rcx     # 0x2a988
movq 0x2350b(%rip), %rdx     # 0x2a980
xorl %esi, %esi
movapd 0x16d41(%rip), %xmm0    # 0x1e1c0
movsd 0x16cc9(%rip), %xmm1    # 0x1e150
cmpl $0x1, %eax
jne 0x74aa
movsd 0x20(%rsp,%rsi,8), %xmm2
movsd %xmm2, 0x10(%rdx)
movsd (%rsp,%rsi,8), %xmm2
movl %eax, %edi
shlq $0x4, %rdi
movsd %xmm2, 0x8(%rdx,%rdi)
jmp 0x751f
movq 0x234cf(%rip), %r8      # 0x2a980
movl $0x1, %edi
cmovll %eax, %edi
decl %edi
leal -0x1(%rax), %r9d
movq %r9, %r10
shlq $0x4, %r10
addq %r8, %r10
leal 0x1(%r9), %r11d
cmpl $0x2, %r11d
jl 0x752f
movsd 0x20(%rsp,%rsi,8), %xmm2
movsd (%rsp,%rsi,8), %xmm3
movupd (%r10), %xmm4
movapd %xmm2, %xmm5
unpcklpd %xmm3, %xmm5            # xmm5 = xmm5[0],xmm3[0]
subpd %xmm4, %xmm5
andpd %xmm0, %xmm5
pshufd $0xee, %xmm5, %xmm4     # xmm4 = xmm5[2,3,2,3]
addsd %xmm5, %xmm4
ucomisd %xmm4, %xmm1
ja 0x752c
addq $-0x10, %r10
decl %r9d
jne 0x74c9
movslq %eax, %rdi
shlq $0x4, %rdi
movsd %xmm2, (%r8,%rdi)
movsd %xmm3, 0x8(%r8,%rdi)
movl %eax, (%rcx,%rsi,4)
incl %eax
movl %eax, 0x1dcfe(%rip)     # 0x25228
jmp 0x7532
movl %r9d, %edi
movl %edi, (%rcx,%rsi,4)
incq %rsi
cmpq $0x4, %rsi
jne 0x7487
incl 0x1dce7(%rip)           # 0x2522c
addq $0x48, %rsp
popq %rbx
popq %r14
retq