// File: /workspace/github_cpp_makefile_star2_O3/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 %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
leal -0x1(%rbx), %eax
cmpl $0x4, %eax
ja 0xced9
leaq 0x10c07(%rip), %rcx     # 0x1d600
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x178d7(%rip), %rbx     # 0x242e0
movq (%rbx), %rax
movl $0x5e0, %r14d           # imm = 0x5E0
movsd 0x10b3e(%rip), %xmm1    # 0x1d558
movsd 0x10b3e(%rip), %xmm2    # 0x1d560
movapd 0x10796(%rip), %xmm3    # 0x1d1c0
movsd 0x10b36(%rip), %xmm4    # 0x1d568
movsd -0x8(%rax,%r14), %xmm0
ucomisd %xmm1, %xmm0
jb 0xca8d
ucomisd %xmm0, %xmm2
jb 0xca8d
movsd (%rax,%r14), %xmm0
andpd %xmm3, %xmm0
ucomisd %xmm0, %xmm4
jb 0xca8d
leaq (%rax,%r14), %rdi
addq $-0x280, %rdi           # imm = 0xFD80
movl $0x1, %esi
callq 0xc918
movsd 0x10af6(%rip), %xmm4    # 0x1d568
movapd 0x10746(%rip), %xmm3    # 0x1d1c0
movsd 0x10ade(%rip), %xmm2    # 0x1d560
movsd 0x10ace(%rip), %xmm1    # 0x1d558
movq (%rbx), %rax
addq $0x360, %r14            # imm = 0x360
cmpq $0x696d00, %r14         # imm = 0x696D00
jne 0xca32
jmp 0xced1
movl $0x5e0, %ebx            # imm = 0x5E0
leaq 0x17832(%rip), %r14     # 0x242e0
movq (%r14), %rax
movsd -0x8(%rax,%rbx), %xmm0
ucomisd 0x10a99(%rip), %xmm0    # 0x1d558
jb 0xcaf3
movsd 0x10a97(%rip), %xmm1    # 0x1d560
ucomisd %xmm0, %xmm1
jb 0xcaf3
movsd (%rax,%rbx), %xmm1
andpd 0x106e4(%rip), %xmm1    # 0x1d1c0
movl $0x5, %esi
movsd 0x10a7f(%rip), %xmm2    # 0x1d568
ucomisd %xmm1, %xmm2
jae 0xcbdd
ucomisd 0x10a75(%rip), %xmm0    # 0x1d570
jbe 0xcb2f
movsd 0x10a73(%rip), %xmm1    # 0x1d578
ucomisd %xmm0, %xmm1
jb 0xcb2f
movsd (%rax,%rbx), %xmm1
andpd 0x106a8(%rip), %xmm1    # 0x1d1c0
movl $0x4, %esi
movsd 0x10a5b(%rip), %xmm2    # 0x1d580
ucomisd %xmm1, %xmm2
jae 0xcbdd
ucomisd 0x10a51(%rip), %xmm0    # 0x1d588
jbe 0xcb69
movsd 0x10a4f(%rip), %xmm1    # 0x1d590
ucomisd %xmm0, %xmm1
jb 0xcb69
movsd (%rax,%rbx), %xmm1
ucomisd 0x10a44(%rip), %xmm1    # 0x1d598
jb 0xcb69
movl $0x3, %esi
movsd 0x10a3d(%rip), %xmm2    # 0x1d5a0
ucomisd %xmm1, %xmm2
ja 0xcbdd
ucomisd 0x10a37(%rip), %xmm0    # 0x1d5a8
jbe 0xcba3
movsd 0x10a35(%rip), %xmm1    # 0x1d5b0
ucomisd %xmm0, %xmm1
jb 0xcba3
movsd (%rax,%rbx), %xmm1
ucomisd 0x10a2a(%rip), %xmm1    # 0x1d5b8
jb 0xcba3
movl $0x2, %esi
movsd 0x10a23(%rip), %xmm2    # 0x1d5c0
ucomisd %xmm1, %xmm2
ja 0xcbdd
ucomisd 0x10a1d(%rip), %xmm0    # 0x1d5c8
jbe 0xcbed
movsd 0x10a1b(%rip), %xmm1    # 0x1d5d0
ucomisd %xmm0, %xmm1
jb 0xcbed
movsd (%rax,%rbx), %xmm0
ucomisd 0x10a10(%rip), %xmm0    # 0x1d5d8
jb 0xcbed
movl $0x1, %esi
movsd 0x10a09(%rip), %xmm1    # 0x1d5e0
ucomisd %xmm0, %xmm1
jbe 0xcbed
leaq (%rax,%rbx), %rdi
addq $-0x280, %rdi           # imm = 0xFD80
callq 0xc918
addq $0x360, %rbx            # imm = 0x360
cmpq $0x696d00, %rbx         # imm = 0x696D00
jne 0xcaae
jmp 0xced1
movl $0x5e0, %ebx            # imm = 0x5E0
leaq 0x176ce(%rip), %r14     # 0x242e0
movq (%r14), %rax
movsd -0x8(%rax,%rbx), %xmm0
ucomisd 0x10935(%rip), %xmm0    # 0x1d558
jb 0xcc53
movsd 0x10933(%rip), %xmm1    # 0x1d560
ucomisd %xmm0, %xmm1
jb 0xcc53
movsd (%rax,%rbx), %xmm1
andpd 0x10580(%rip), %xmm1    # 0x1d1c0
movl $0x3, %esi
movsd 0x1091b(%rip), %xmm2    # 0x1d568
ucomisd %xmm1, %xmm2
jae 0xccc5
ucomisd 0x10915(%rip), %xmm0    # 0x1d570
jbe 0xcc8b
movsd 0x10913(%rip), %xmm1    # 0x1d578
ucomisd %xmm0, %xmm1
jb 0xcc8b
movsd (%rax,%rbx), %xmm1
andpd 0x10548(%rip), %xmm1    # 0x1d1c0
movl $0x2, %esi
movsd 0x108fb(%rip), %xmm2    # 0x1d580
ucomisd %xmm1, %xmm2
jae 0xccc5
ucomisd 0x108f5(%rip), %xmm0    # 0x1d588
jbe 0xccd5
movsd 0x108f3(%rip), %xmm1    # 0x1d590
ucomisd %xmm0, %xmm1
jb 0xccd5
movsd (%rax,%rbx), %xmm0
ucomisd 0x108e8(%rip), %xmm0    # 0x1d598
jb 0xccd5
movl $0x1, %esi
movsd 0x108e1(%rip), %xmm1    # 0x1d5a0
ucomisd %xmm0, %xmm1
jbe 0xccd5
leaq (%rax,%rbx), %rdi
addq $-0x280, %rdi           # imm = 0xFD80
callq 0xc918
addq $0x360, %rbx            # imm = 0x360
cmpq $0x696d00, %rbx         # imm = 0x696D00
jne 0xcc12
jmp 0xced1
movl $0x5e0, %ebx            # imm = 0x5E0
leaq 0x175e6(%rip), %r14     # 0x242e0
movq (%r14), %rax
movsd -0x8(%rax,%rbx), %xmm0
ucomisd 0x1084d(%rip), %xmm0    # 0x1d558
jb 0xcd3f
movsd 0x1084b(%rip), %xmm1    # 0x1d560
ucomisd %xmm0, %xmm1
jb 0xcd3f
movsd (%rax,%rbx), %xmm1
andpd 0x10498(%rip), %xmm1    # 0x1d1c0
movl $0x4, %esi
movsd 0x10833(%rip), %xmm2    # 0x1d568
ucomisd %xmm1, %xmm2
jae 0xcdeb
ucomisd 0x10829(%rip), %xmm0    # 0x1d570
jbe 0xcd77
movsd 0x10827(%rip), %xmm1    # 0x1d578
ucomisd %xmm0, %xmm1
jb 0xcd77
movsd (%rax,%rbx), %xmm1
andpd 0x1045c(%rip), %xmm1    # 0x1d1c0
movl $0x3, %esi
movsd 0x1080f(%rip), %xmm2    # 0x1d580
ucomisd %xmm1, %xmm2
jae 0xcdeb
ucomisd 0x10809(%rip), %xmm0    # 0x1d588
jbe 0xcdb1
movsd 0x10807(%rip), %xmm1    # 0x1d590
ucomisd %xmm0, %xmm1
jb 0xcdb1
movsd (%rax,%rbx), %xmm1
ucomisd 0x107fc(%rip), %xmm1    # 0x1d598
jb 0xcdb1
movl $0x2, %esi
movsd 0x107f5(%rip), %xmm2    # 0x1d5a0
ucomisd %xmm1, %xmm2
ja 0xcdeb
ucomisd 0x107ef(%rip), %xmm0    # 0x1d5a8
jbe 0xcdfb
movsd 0x107ed(%rip), %xmm1    # 0x1d5b0
ucomisd %xmm0, %xmm1
jb 0xcdfb
movsd (%rax,%rbx), %xmm0
ucomisd 0x107e2(%rip), %xmm0    # 0x1d5b8
jb 0xcdfb
movl $0x1, %esi
movsd 0x107db(%rip), %xmm1    # 0x1d5c0
ucomisd %xmm0, %xmm1
jbe 0xcdfb
leaq (%rax,%rbx), %rdi
addq $-0x280, %rdi           # imm = 0xFD80
callq 0xc918
addq $0x360, %rbx            # imm = 0x360
cmpq $0x696d00, %rbx         # imm = 0x696D00
jne 0xccfa
jmp 0xced1
movl $0x5e0, %ebx            # imm = 0x5E0
leaq 0x174c0(%rip), %r14     # 0x242e0
movsd 0x10730(%rip), %xmm2    # 0x1d558
movapd 0x10390(%rip), %xmm3    # 0x1d1c0
movq (%r14), %rax
movsd -0x8(%rax,%rbx), %xmm0
ucomisd %xmm2, %xmm0
jb 0xce69
movsd 0x10719(%rip), %xmm1    # 0x1d560
ucomisd %xmm0, %xmm1
jb 0xce69
movsd (%rax,%rbx), %xmm1
andpd %xmm3, %xmm1
movl $0x2, %esi
movsd 0x10705(%rip), %xmm4    # 0x1d568
ucomisd %xmm1, %xmm4
jae 0xce9d
ucomisd 0x106ff(%rip), %xmm0    # 0x1d570
jbe 0xcebd
movsd 0x106fd(%rip), %xmm1    # 0x1d578
ucomisd %xmm0, %xmm1
jb 0xcebd
movsd (%rax,%rbx), %xmm0
andpd %xmm3, %xmm0
movl $0x1, %esi
movsd 0x106e9(%rip), %xmm1    # 0x1d580
ucomisd %xmm0, %xmm1
jb 0xcebd
leaq (%rax,%rbx), %rdi
addq $-0x280, %rdi           # imm = 0xFD80
callq 0xc918
movapd 0x1030b(%rip), %xmm3    # 0x1d1c0
movsd 0x1069b(%rip), %xmm2    # 0x1d558
addq $0x360, %rbx            # imm = 0x360
cmpq $0x696d00, %rbx         # imm = 0x696D00
jne 0xce30
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x170e8(%rip), %r14     # 0x23fc8
leaq 0x1072d(%rip), %rsi     # 0x1d614
movl $0x1c, %edx
movq %r14, %rdi
callq 0x3250
leaq 0x10736(%rip), %rsi     # 0x1d631
movl $0xb, %edx
movq %r14, %rdi
callq 0x3250
movq %r14, %rdi
movl %ebx, %esi
callq 0x3350
leaq 0x10724(%rip), %rsi     # 0x1d63d
movl $0x18, %edx
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3250
nopl (%rax)