// File: /workspace/github_cpp_makefile_star2_O2/jamesliu516[P]amrdg2d/amr_grid_treat.cpp
// Function: refineCicleDemain(int)
void refineCicleDemain(int rfN)// 1,2,3,4,5�μ���
{
	int i;
	int jk1,jk2,jk3,jk4,jk5;

	switch(rfN)
	{	
	case 5: 
		for(i=1;i<=Nx*Ny;i++) 
		{			
			if(jk1=(bodygrid[i].xc1 >= Ellipse_x - 2 * hx && bodygrid[i].xc1 <= Ellipse_x1 + 2 * hx		    
				&& bodygrid[i].yc1 >= Ellipse_y - 2 * hy && bodygrid[i].yc1 <= Ellipse_y1 + 2 * hy))		
			{					
				refineOneCell(&bodygrid[i], 5);
			}		
			else if(jk2=((!jk1) && bodygrid[i].xc1 > Ellipse_x - 4*hx && bodygrid[i].xc1 <= Ellipse_x1 + 4*hx 					
				&& bodygrid[i].yc1 >= Ellipse_y-4*hy && bodygrid[i].yc1 <= Ellipse_y1+4*hy))	
			{					
				refineOneCell(&bodygrid[i], 4);						
			}	    
			else if(jk3=((!jk2) && bodygrid[i].xc1 > Ellipse_x-6*hx && bodygrid[i].xc1 <= Ellipse_x1 + 6*hx 		   
				&& bodygrid[i].yc1 >=  Ellipse_y-6*hy && bodygrid[i].yc1 < Ellipse_y1 + 6*hy ) )
			{					
				refineOneCell(&bodygrid[i], 3);		
			}
			else if(jk4=((!jk3) && bodygrid[i].xc1 > Ellipse_x-8*hx && bodygrid[i].xc1 <= Ellipse_x1 + 8*hx 		   
				&& bodygrid[i].yc1 >=  Ellipse_y-8*hy && bodygrid[i].yc1 < Ellipse_y1 + 8*hy) )
			{					
				refineOneCell(&bodygrid[i], 2);		
			}				
			else if(jk5=((!jk4) && bodygrid[i].xc1 > Ellipse_x-10*hx && bodygrid[i].xc1 <= Ellipse_x1 + 10*hx 		   
				&& bodygrid[i].yc1 >=  Ellipse_y-10*hy && bodygrid[i].yc1 < Ellipse_y1 + 10*hy) )
			{					
				refineOneCell(&bodygrid[i], 1);		
			}				
		}
		break;

	case 4:
		for(i=1;i<=Nx*Ny;i++) 
		{			
			if(jk1=(bodygrid[i].xc1 >= Ellipse_x - 2 * hx && bodygrid[i].xc1 <= Ellipse_x1+ 2 * hx		    
				&& bodygrid[i].yc1 >= Ellipse_y - 2 * hy && bodygrid[i].yc1 <= Ellipse_y1 + 2 * hy))		
			{					
				refineOneCell(&bodygrid[i], 4);
			}		
			else if(jk2=((!jk1) && bodygrid[i].xc1 > Ellipse_x - 4*hx && bodygrid[i].xc1 <= Ellipse_x1 + 4*hx 					
				&& bodygrid[i].yc1 >= Ellipse_y-4*hy && bodygrid[i].yc1 <= Ellipse_y1+4*hy))	
			{					
				refineOneCell(&bodygrid[i], 3);						
			}	    
			else if(jk3=((!jk2) && bodygrid[i].xc1 > Ellipse_x-6*hx && bodygrid[i].xc1 <= Ellipse_x1+ 6*hx 		   
				&& bodygrid[i].yc1 >=  Ellipse_y-6*hy && bodygrid[i].yc1 < Ellipse_y1 + 6*hy ) )
			{					
				refineOneCell(&bodygrid[i], 2);		
			}
			else if(jk4=((!jk3) && bodygrid[i].xc1 > Ellipse_x-8*hx && bodygrid[i].xc1 <= Ellipse_x1 + 8*hx 		   
				&& bodygrid[i].yc1 >=  Ellipse_y-8*hy && bodygrid[i].yc1 < Ellipse_y1 + 8*hy) )
			{					
				refineOneCell(&bodygrid[i], 1);		
			}							
		}
		break;
	case 3:
		for(i=1;i<=Nx*Ny;i++) 
		{			
			if(jk1=(bodygrid[i].xc1 >= Ellipse_x - 2 * hx && bodygrid[i].xc1 <= Ellipse_x1 + 2 * hx		    
				&& bodygrid[i].yc1 >= Ellipse_y - 2 * hy && bodygrid[i].yc1 <= Ellipse_y1 + 2 * hy))		
			{					
				refineOneCell(&bodygrid[i], 3);
			}		
			else if(jk2=((!jk1) && bodygrid[i].xc1 > Ellipse_x - 4*hx && bodygrid[i].xc1 <= Ellipse_x1 + 4*hx 					
				&& bodygrid[i].yc1 >= Ellipse_y-4*hy && bodygrid[i].yc1 <= Ellipse_y1+4*hy))	
			{					
				refineOneCell(&bodygrid[i], 2);						
			}	    
			else if(jk3=((!jk2) && bodygrid[i].xc1 > Ellipse_x-6*hx && bodygrid[i].xc1 <= Ellipse_x1 + 6*hx 		   
				&& bodygrid[i].yc1 >=  Ellipse_y-6*hy && bodygrid[i].yc1 < Ellipse_y1 + 6*hy ) )
			{					
				refineOneCell(&bodygrid[i], 1);		
			}						
		}
		break;
	case 2:
		for(i=1;i<=Nx*Ny;i++) 
		{			
			if(jk1=(bodygrid[i].xc1 >= Ellipse_x - 2 * hx && bodygrid[i].xc1 <= Ellipse_x1 + 2 * hx		    
				&& bodygrid[i].yc1 >= Ellipse_y - 2 * hy && bodygrid[i].yc1 <= Ellipse_y1+ 2 * hy))		
			{					
				refineOneCell(&bodygrid[i], 2);
			}		
			else if(jk2=((!jk1) && bodygrid[i].xc1 > Ellipse_x - 4*hx && bodygrid[i].xc1 <= Ellipse_x1+ 4*hx 					
				&& bodygrid[i].yc1 >= Ellipse_y-4*hy && bodygrid[i].yc1 <= Ellipse_y1+4*hy))	
			{					
				refineOneCell(&bodygrid[i], 1);						
			}	    
		}
		break;
	case 1:
		for(i=1;i<=Nx*Ny;i++) 
		{			
			if(jk1=(bodygrid[i].xc1 >= Ellipse_x - 2 * hx && bodygrid[i].xc1 <= Ellipse_x1+ 2 * hx		    
				&& bodygrid[i].yc1 >= Ellipse_y - 2 * hy && bodygrid[i].yc1 <= Ellipse_y1+ 2 * hy))		
			{					
				refineOneCell(&bodygrid[i], 1);
			}		
		}
		break;
	default:
		cout<<"Only refine 1,2,3,4,5 time.\n";
		cout<<"You input: "<<rfN<<". No refine out domain.\n";
		break;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
leal -0x1(%rbx), %eax
cmpl $0x4, %eax
ja 0xc0d0
leaq 0xfa4a(%rip), %rcx      # 0x1b620
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x5e0, %r14d           # imm = 0x5E0
leaq 0x176f4(%rip), %r15     # 0x232e0
movsd 0xf984(%rip), %xmm1     # 0x1b578
movsd 0xf984(%rip), %xmm2     # 0x1b580
movapd 0xf63c(%rip), %xmm3     # 0x1b240
movsd 0xf97c(%rip), %xmm4     # 0x1b588
pushq $0x1
popq %rbx
cmpq $0x696d00, %r14         # imm = 0x696D00
je 0xc0c1
movq (%r15), %rax
movsd -0x8(%rax,%r14), %xmm0
ucomisd %xmm1, %xmm0
jb 0xbc74
ucomisd %xmm0, %xmm2
jb 0xbc74
movsd (%rax,%r14), %xmm0
andpd %xmm3, %xmm0
ucomisd %xmm0, %xmm4
jb 0xbc74
leaq (%rax,%r14), %rdi
addq $-0x280, %rdi           # imm = 0xFD80
movl %ebx, %esi
callq 0xbaec
movsd 0xf92c(%rip), %xmm4     # 0x1b588
movapd 0xf5dc(%rip), %xmm3     # 0x1b240
movsd 0xf914(%rip), %xmm2     # 0x1b580
movsd 0xf904(%rip), %xmm1     # 0x1b578
addq $0x360, %r14            # imm = 0x360
jmp 0xbc0f
movl $0x5e0, %ebx            # imm = 0x5E0
leaq 0x17657(%rip), %r14     # 0x232e0
pushq $0x2
popq %r15
pushq $0x3
popq %r12
pushq $0x4
popq %r13
pushq $0x5
popq %rbp
cmpq $0x696d00, %rbx         # imm = 0x696D00
je 0xc0c1
movq (%r14), %rax
movsd -0x8(%rax,%rbx), %xmm0
ucomisd 0xf8c2(%rip), %xmm0     # 0x1b578
jb 0xbce7
movsd 0xf8c0(%rip), %xmm1     # 0x1b580
ucomisd %xmm0, %xmm1
jb 0xbce7
movsd (%rax,%rbx), %xmm1
andpd 0xf56d(%rip), %xmm1     # 0x1b240
movsd 0xf8ad(%rip), %xmm2     # 0x1b588
ucomisd %xmm1, %xmm2
movl %ebp, %esi
jae 0xbdc9
ucomisd 0xf8a1(%rip), %xmm0     # 0x1b590
jbe 0xbd21
movsd 0xf89f(%rip), %xmm1     # 0x1b598
ucomisd %xmm0, %xmm1
jb 0xbd21
movsd (%rax,%rbx), %xmm1
andpd 0xf534(%rip), %xmm1     # 0x1b240
movsd 0xf88c(%rip), %xmm2     # 0x1b5a0
ucomisd %xmm1, %xmm2
movl %r13d, %esi
jae 0xbdc9
ucomisd 0xf87f(%rip), %xmm0     # 0x1b5a8
jbe 0xbd59
movsd 0xf87d(%rip), %xmm1     # 0x1b5b0
ucomisd %xmm0, %xmm1
jb 0xbd59
movsd (%rax,%rbx), %xmm1
ucomisd 0xf872(%rip), %xmm1     # 0x1b5b8
jb 0xbd59
movsd 0xf870(%rip), %xmm2     # 0x1b5c0
ucomisd %xmm1, %xmm2
movl %r12d, %esi
ja 0xbdc9
ucomisd 0xf867(%rip), %xmm0     # 0x1b5c8
jbe 0xbd91
movsd 0xf865(%rip), %xmm1     # 0x1b5d0
ucomisd %xmm0, %xmm1
jb 0xbd91
movsd (%rax,%rbx), %xmm1
ucomisd 0xf85a(%rip), %xmm1     # 0x1b5d8
jb 0xbd91
movsd 0xf858(%rip), %xmm2     # 0x1b5e0
ucomisd %xmm1, %xmm2
movl %r15d, %esi
ja 0xbdc9
ucomisd 0xf84f(%rip), %xmm0     # 0x1b5e8
jbe 0xbdd9
movsd 0xf84d(%rip), %xmm1     # 0x1b5f0
ucomisd %xmm0, %xmm1
jb 0xbdd9
movsd (%rax,%rbx), %xmm0
ucomisd 0xf842(%rip), %xmm0     # 0x1b5f8
jb 0xbdd9
movsd 0xf840(%rip), %xmm1     # 0x1b600
ucomisd %xmm0, %xmm1
pushq $0x1
popq %rsi
jbe 0xbdd9
leaq (%rax,%rbx), %rdi
addq $-0x280, %rdi           # imm = 0xFD80
callq 0xbaec
addq $0x360, %rbx            # imm = 0x360
jmp 0xbc98
movl $0x5e0, %ebx            # imm = 0x5E0
leaq 0x174ef(%rip), %r14     # 0x232e0
pushq $0x1
popq %rbp
pushq $0x2
popq %r15
pushq $0x3
popq %r12
cmpq $0x696d00, %rbx         # imm = 0x696D00
je 0xc0c1
movq (%r14), %rax
movsd -0x8(%rax,%rbx), %xmm0
ucomisd 0xf75e(%rip), %xmm0     # 0x1b578
jb 0xbe48
movsd 0xf75c(%rip), %xmm1     # 0x1b580
ucomisd %xmm0, %xmm1
jb 0xbe48
movsd (%rax,%rbx), %xmm1
andpd 0xf409(%rip), %xmm1     # 0x1b240
movsd 0xf749(%rip), %xmm2     # 0x1b588
ucomisd %xmm1, %xmm2
movl %r12d, %esi
jae 0xbeb5
ucomisd 0xf740(%rip), %xmm0     # 0x1b590
jbe 0xbe7e
movsd 0xf73e(%rip), %xmm1     # 0x1b598
ucomisd %xmm0, %xmm1
jb 0xbe7e
movsd (%rax,%rbx), %xmm1
andpd 0xf3d3(%rip), %xmm1     # 0x1b240
movsd 0xf72b(%rip), %xmm2     # 0x1b5a0
ucomisd %xmm1, %xmm2
movl %r15d, %esi
jae 0xbeb5
ucomisd 0xf722(%rip), %xmm0     # 0x1b5a8
jbe 0xbec5
movsd 0xf720(%rip), %xmm1     # 0x1b5b0
ucomisd %xmm0, %xmm1
jb 0xbec5
movsd (%rax,%rbx), %xmm0
ucomisd 0xf715(%rip), %xmm0     # 0x1b5b8
jb 0xbec5
movsd 0xf713(%rip), %xmm1     # 0x1b5c0
ucomisd %xmm0, %xmm1
movl %ebp, %esi
jbe 0xbec5
leaq (%rax,%rbx), %rdi
addq $-0x280, %rdi           # imm = 0xFD80
callq 0xbaec
addq $0x360, %rbx            # imm = 0x360
jmp 0xbdfc
movl $0x5e0, %ebx            # imm = 0x5E0
leaq 0x17403(%rip), %r14     # 0x232e0
pushq $0x1
popq %rbp
pushq $0x2
popq %r15
pushq $0x3
popq %r12
pushq $0x4
popq %r13
cmpq $0x696d00, %rbx         # imm = 0x696D00
je 0xc0c1
movq (%r14), %rax
movsd -0x8(%rax,%rbx), %xmm0
ucomisd 0xf66e(%rip), %xmm0     # 0x1b578
jb 0xbf3c
movsd 0xf66c(%rip), %xmm1     # 0x1b580
ucomisd %xmm0, %xmm1
jb 0xbf3c
movsd (%rax,%rbx), %xmm1
andpd 0xf319(%rip), %xmm1     # 0x1b240
movsd 0xf659(%rip), %xmm2     # 0x1b588
ucomisd %xmm1, %xmm2
movl %r13d, %esi
jae 0xbfe1
ucomisd 0xf64c(%rip), %xmm0     # 0x1b590
jbe 0xbf72
movsd 0xf64a(%rip), %xmm1     # 0x1b598
ucomisd %xmm0, %xmm1
jb 0xbf72
movsd (%rax,%rbx), %xmm1
andpd 0xf2df(%rip), %xmm1     # 0x1b240
movsd 0xf637(%rip), %xmm2     # 0x1b5a0
ucomisd %xmm1, %xmm2
movl %r12d, %esi
jae 0xbfe1
ucomisd 0xf62e(%rip), %xmm0     # 0x1b5a8
jbe 0xbfaa
movsd 0xf62c(%rip), %xmm1     # 0x1b5b0
ucomisd %xmm0, %xmm1
jb 0xbfaa
movsd (%rax,%rbx), %xmm1
ucomisd 0xf621(%rip), %xmm1     # 0x1b5b8
jb 0xbfaa
movsd 0xf61f(%rip), %xmm2     # 0x1b5c0
ucomisd %xmm1, %xmm2
movl %r15d, %esi
ja 0xbfe1
ucomisd 0xf616(%rip), %xmm0     # 0x1b5c8
jbe 0xbff1
movsd 0xf614(%rip), %xmm1     # 0x1b5d0
ucomisd %xmm0, %xmm1
jb 0xbff1
movsd (%rax,%rbx), %xmm0
ucomisd 0xf609(%rip), %xmm0     # 0x1b5d8
jb 0xbff1
movsd 0xf607(%rip), %xmm1     # 0x1b5e0
ucomisd %xmm0, %xmm1
movl %ebp, %esi
jbe 0xbff1
leaq (%rax,%rbx), %rdi
addq $-0x280, %rdi           # imm = 0xFD80
callq 0xbaec
addq $0x360, %rbx            # imm = 0x360
jmp 0xbeec
movl $0x5e0, %ebx            # imm = 0x5E0
leaq 0x172d7(%rip), %r14     # 0x232e0
movsd 0xf567(%rip), %xmm2     # 0x1b578
movapd 0xf227(%rip), %xmm3     # 0x1b240
pushq $0x1
popq %rbp
pushq $0x2
popq %r15
cmpq $0x696d00, %rbx         # imm = 0x696D00
je 0xc0c1
movq (%r14), %rax
movsd -0x8(%rax,%rbx), %xmm0
ucomisd %xmm2, %xmm0
jb 0xc064
movsd 0xf53c(%rip), %xmm1     # 0x1b580
ucomisd %xmm0, %xmm1
jb 0xc064
movsd (%rax,%rbx), %xmm1
andpd %xmm3, %xmm1
movsd 0xf52d(%rip), %xmm4     # 0x1b588
ucomisd %xmm1, %xmm4
movl %r15d, %esi
jae 0xc095
ucomisd 0xf524(%rip), %xmm0     # 0x1b590
jbe 0xc0b5
movsd 0xf522(%rip), %xmm1     # 0x1b598
ucomisd %xmm0, %xmm1
jb 0xc0b5
movsd (%rax,%rbx), %xmm0
andpd %xmm3, %xmm0
movsd 0xf513(%rip), %xmm1     # 0x1b5a0
ucomisd %xmm0, %xmm1
movl %ebp, %esi
jb 0xc0b5
leaq (%rax,%rbx), %rdi
addq $-0x280, %rdi           # imm = 0xFD80
callq 0xbaec
movapd 0xf193(%rip), %xmm3     # 0x1b240
movsd 0xf4c3(%rip), %xmm2     # 0x1b578
addq $0x360, %rbx            # imm = 0x360
jmp 0xc020
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x16ee9(%rip), %r14     # 0x22fc0
leaq 0xf556(%rip), %rsi      # 0x1b634
movq %r14, %rdi
callq 0x31d0
leaq 0xf564(%rip), %rsi      # 0x1b651
movq %r14, %rdi
callq 0x31d0
movq %rax, %rdi
movl %ebx, %esi
callq 0x3330
leaq 0xf557(%rip), %rsi      # 0x1b65d
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31d0