// File: /workspace/github_cpp_makefile_star2_O3/jamesliu516[P]amrdg2d/outputgrid.cpp
// Function: outputcell(int)
void outputcell(int ij)
{
//
	ofstream fpxx;

	string proxfile1(FILE_PROX);
		
	string  str1=str0+proxfile1;
	
	ostringstream omess1;
	
	omess1 << str1 << ij<<".plt";
	
	//fpxx.open(filename1[ljm]);
	fpxx.open(omess1.str().c_str());
	
//
	long i;
	long k,j;
	
	Node *current;
	OctCell *lsbl;
	current = HeadListAllGrid;
	
	pointOutput=new PointJBoutput[NpointForOutput];
	cellOutput=new ControlCellOutput[NpointForOutput];

	while(current != NULL)
	{
		
		lsbl = current->cell;
		if(lsbl->flag % 2 == 0 && current->flg<=2 ) 
			PrintNode_bk(lsbl);
		current = current->next;
	}

//	for(i=1;i<=Nx*Ny;i++)
//	{
//		PrintNode(&bodygrid[i]);
//	}

        fpxx<<"TITLE =\"EULER SOLVER\"\n"
        <<"VARIABLES = \"X\", \"Y\"\n"
        <<"ZONE N=   "<<Np-1 << ",E=    "<<   NU-1<< ", F=FEPOINT, ET=QUADRILATERAL\n";  
        
         cout<<"Np= "<<Np-1<<", NU= "<<NU-1<<endl;
         
//	fprintf(fp,"TITLE = \" Bodygrid \"\n");
//	fprintf(fp,"VARIABLES = \"X\", \"Y\"\n");
//	fprintf(fp,"ZONE N=\t%d ,E=\t%d , F=FEPOINT, ET=QUADRILATERAL\n",Np-1,NU-1);
//	printf("Np=%d,NU=%d\n",Np,NU);

//	getch();
	for(j=1;j<Np;j++)
	{
	  fpxx<<pointOutput[j].x<<"      "<<pointOutput[j].y<<"\n";
     //   fprintf(fp,"%15.8e\t%15.8e\n",point[j].x,point[j].y);
	}
	for(k=1;k<NU;k++)
	{
		for(i=0;i<4;i++)
		{
		   //fprintf(fp,"%d\t",cell[k].cpoint[i]);
		    fpxx<<cellOutput[k].cpoint[i]<<"   ";

		}
		//fprintf(fp,"\n");
		fpxx<<"\n";
	}
	fpxx.close();
	
	delete[] pointOutput;
	delete[] cellOutput;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3d8, %rsp            # imm = 0x3D8
movl %edi, %ebx
leaq 0x60(%rsp), %rdi
callq 0x3340
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x15d8c(%rip), %rsi     # 0x1d1d0
leaq 0x15d87(%rip), %rdx     # 0x1d1d2
movq %rsp, %rdi
callq 0x8b9a
leaq 0x22446(%rip), %rsi     # 0x298a0
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
callq 0x8aaa
leaq 0x260(%rsp), %rdi
callq 0x3290
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
leaq 0x260(%rsp), %rdi
callq 0x3250
movq %rax, %rdi
movl %ebx, %esi
callq 0x3350
leaq 0x15d37(%rip), %rsi     # 0x1d1d3
movl $0x4, %edx
movq %rax, %rdi
callq 0x3250
leaq 0x268(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0x32f0
movq 0x40(%rsp), %rsi
leaq 0x60(%rsp), %rdi
movl $0x10, %edx
callq 0x3050
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x74ea
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3220
leaq 0x2211f(%rip), %rax     # 0x29610
movq (%rax), %rbx
movl $0xc35000, %edi         # imm = 0xC35000
callq 0x3030
movq %rax, 0x2247b(%rip)     # 0x29980
movl $0xc35000, %edi         # imm = 0xC35000
callq 0x3030
movq %rax, 0x22472(%rip)     # 0x29988
testq %rbx, %rbx
je 0x7539
movq 0x8(%rbx), %rdi
testb $0x1, 0x1b0(%rdi)
jne 0x7533
cmpw $0x2, (%rbx)
jg 0x7533
callq 0x7264
movq 0x10(%rbx), %rbx
jmp 0x7516
leaq 0x15c98(%rip), %rsi     # 0x1d1d8
leaq 0x60(%rsp), %rdi
movl $0x16, %edx
callq 0x3250
leaq 0x15c99(%rip), %rsi     # 0x1d1ef
leaq 0x60(%rsp), %rdi
movl $0x15, %edx
callq 0x3250
leaq 0x15c99(%rip), %rsi     # 0x1d205
leaq 0x60(%rsp), %rdi
movl $0xa, %edx
callq 0x3250
movl 0x1cca7(%rip), %esi     # 0x24228
decl %esi
leaq 0x60(%rsp), %rdi
callq 0x3350
movq %rax, %rbx
leaq 0x15c79(%rip), %rsi     # 0x1d210
movl $0x7, %edx
movq %rax, %rdi
callq 0x3250
movl 0x1cc82(%rip), %esi     # 0x2422c
decl %esi
movq %rbx, %rdi
callq 0x3350
leaq 0x15c5d(%rip), %rsi     # 0x1d218
movl $0x1e, %edx
movq %rax, %rdi
callq 0x3250
movq 0x1c9f9(%rip), %rdi     # 0x23fc8
leaq 0x15c61(%rip), %rsi     # 0x1d237
movl $0x4, %edx
callq 0x3250
movl 0x1cc42(%rip), %esi     # 0x24228
decl %esi
movq 0x1c9d9(%rip), %rdi     # 0x23fc8
callq 0x3350
movq %rax, %rbx
leaq 0x15c3e(%rip), %rsi     # 0x1d23c
movl $0x6, %edx
movq %rax, %rdi
callq 0x3250
movl 0x1cc1b(%rip), %esi     # 0x2422c
decl %esi
movq %rbx, %rdi
callq 0x3350
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3200
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3170
cmpl $0x2, 0x1cbdc(%rip)     # 0x24228
jl 0x76cb
movl $0x1, %ebp
xorl %r13d, %r13d
leaq 0x60(%rsp), %rbx
leaq 0x16797(%rip), %r14     # 0x1ddf9
leaq 0x15c31(%rip), %r15     # 0x1d29a
movq 0x22310(%rip), %rax     # 0x29980
movsd 0x10(%rax,%r13), %xmm0
movq %rbx, %rdi
callq 0x3300
movq %rax, %r12
movl $0x6, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x3250
movq 0x222e7(%rip), %rax     # 0x29980
movsd 0x18(%rax,%r13), %xmm0
movq %r12, %rdi
callq 0x3300
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x3250
incq %rbp
movslq 0x1cb66(%rip), %rax     # 0x24228
addq $0x10, %r13
cmpq %rax, %rbp
jl 0x7669
cmpl $0x2, 0x1cb5a(%rip)     # 0x2422c
jl 0x7746
movl $0x1, %r12d
movl $0x10, %r13d
leaq 0x60(%rsp), %rbx
leaq 0x16710(%rip), %r14     # 0x1ddfc
leaq 0x15ba7(%rip), %r15     # 0x1d29a
xorl %ebp, %ebp
movq 0x2228c(%rip), %rax     # 0x29988
addq %r13, %rax
movl (%rax,%rbp,4), %esi
movq %rbx, %rdi
callq 0x3350
movl $0x3, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x3250
incq %rbp
cmpq $0x4, %rbp
jne 0x76f5
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3250
incq %r12
movslq 0x1caef(%rip), %rax     # 0x2422c
addq $0x10, %r13
cmpq %rax, %r12
jl 0x76f3
leaq 0x60(%rsp), %rdi
callq 0x32a0
movq 0x22229(%rip), %rdi     # 0x29980
testq %rdi, %rdi
je 0x7761
callq 0x3280
movq 0x22220(%rip), %rdi     # 0x29988
testq %rdi, %rdi
je 0x7772
callq 0x3280
movq 0x1c847(%rip), %rsi     # 0x23fc0
leaq 0x260(%rsp), %rdi
callq 0x3100
leaq 0x2d0(%rsp), %rdi
callq 0x30b0
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x77ae
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3220
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x77c9
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x1c7e8(%rip), %rax     # 0x23fb8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x68(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x60(%rsp,%rcx)
callq 0x31d0
leaq 0x158(%rsp), %rdi
callq 0x30b0
addq $0x3d8, %rsp            # imm = 0x3D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7849
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0x7849
jmp 0x7846
movq %rax, %rbx
jmp 0x786a
movq %rax, %rbx
jmp 0x7885
movq %rax, %rbx
jmp 0x78a0
jmp 0x7846
jmp 0x7846
jmp 0x7846
jmp 0x7846
movq %rax, %rbx
movq 0x1c770(%rip), %rsi     # 0x23fc0
leaq 0x260(%rsp), %rdi
callq 0x3100
leaq 0x2d0(%rsp), %rdi
callq 0x30b0
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7885
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3220
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x78a0
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
leaq 0x60(%rsp), %rdi
callq 0x32c0
movq %rbx, %rdi
callq 0x3370