// File: /workspace/github_cpp_makefile_star2_O3/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 0x7296
xorl %r14d, %r14d
movq 0x258(%rbx,%r14,8), %rdi
callq 0x7264
incq %r14
cmpq $0x4, %r14
jne 0x727b
jmp 0x740f
movsd 0x15eaa(%rip), %xmm0    # 0x1d148
movsd 0x288(%rbx), %xmm1
mulsd %xmm0, %xmm1
mulsd 0x290(%rbx), %xmm0
movsd 0x278(%rbx), %xmm2
movsd 0x280(%rbx), %xmm3
xorl %eax, %eax
leaq 0x1609d(%rip), %rcx     # 0x1d368
leaq 0x160b6(%rip), %rdx     # 0x1d388
movsd (%rax,%rdx), %xmm4
mulsd %xmm1, %xmm4
addsd %xmm2, %xmm4
movsd %xmm4, 0x20(%rsp,%rax)
movsd (%rax,%rcx), %xmm4
mulsd %xmm0, %xmm4
addsd %xmm3, %xmm4
movsd %xmm4, (%rsp,%rax)
addq $0x8, %rax
cmpq $0x20, %rax
jne 0x72d2
movl 0x1cf21(%rip), %esi     # 0x24228
movslq 0x1cf1e(%rip), %rax     # 0x2422c
movq %rax, %rcx
shlq $0x4, %rcx
addq 0x2266c(%rip), %rcx     # 0x29988
movq 0x2265d(%rip), %rdx     # 0x29980
xorl %edi, %edi
movapd 0x15e93(%rip), %xmm0    # 0x1d1c0
movsd 0x15e1b(%rip), %xmm1    # 0x1d150
cmpl $0x1, %esi
je 0x73c6
movq 0x2263b(%rip), %r9      # 0x29980
movl $0x1, %r8d
cmovll %esi, %r8d
decl %r8d
leal -0x1(%rsi), %r10d
movq %r10, %r11
shlq $0x4, %r11
addq %r9, %r11
leal 0x1(%r10), %ebx
cmpl $0x2, %ebx
jl 0x73f6
movsd 0x20(%rsp,%rdi,8), %xmm2
movsd (%rsp,%rdi,8), %xmm3
movupd (%r11), %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 0x73f3
addq $-0x10, %r11
decl %r10d
jne 0x7360
movslq %esi, %r8
shlq $0x4, %r8
movsd %xmm2, (%r9,%r8)
movsd %xmm3, 0x8(%r9,%r8)
movl %esi, (%rcx,%rdi,4)
incl %esi
movl %esi, 0x1ce64(%rip)     # 0x24228
jmp 0x73fa
movsd 0x20(%rsp,%rdi,8), %xmm2
movsd %xmm2, 0x10(%rdx)
movsd (%rsp,%rdi,8), %xmm2
movsd %xmm2, 0x18(%rdx)
movl $0x1, (%rcx,%rdi,4)
movl $0x2, 0x1ce3c(%rip)     # 0x24228
movl $0x2, %esi
jmp 0x73fa
movl %r10d, %r8d
movl %r8d, (%rcx,%rdi,4)
incq %rdi
cmpq $0x4, %rdi
jne 0x7335
incl %eax
movl %eax, 0x1ce1d(%rip)     # 0x2422c
addq $0x48, %rsp
popq %rbx
popq %r14
retq