// File: /workspace/github_cpp_makefile_star2_O1/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 0x16c76(%rip), %rsi     # 0x1e1f0
leaq 0x16c71(%rip), %rdx     # 0x1e1f2
movq %rsp, %rdi
callq 0x8ce8
leaq 0x23310(%rip), %rsi     # 0x2a8a0
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
callq 0x8bfd
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 0x16c21(%rip), %rsi     # 0x1e1f3
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 0x7620
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3220
leaq 0x22fe9(%rip), %rax     # 0x2a610
movq (%rax), %rbx
movl $0xc35000, %edi         # imm = 0xC35000
callq 0x3030
movq %rax, 0x23345(%rip)     # 0x2a980
movl $0xc35000, %edi         # imm = 0xC35000
callq 0x3030
movq %rax, 0x2333c(%rip)     # 0x2a988
testq %rbx, %rbx
je 0x766f
movq 0x8(%rbx), %rdi
testb $0x1, 0x1b0(%rdi)
jne 0x7669
cmpw $0x2, (%rbx)
jg 0x7669
callq 0x73a4
movq 0x10(%rbx), %rbx
jmp 0x764c
leaq 0x16b82(%rip), %rsi     # 0x1e1f8
leaq 0x60(%rsp), %rdi
movl $0x16, %edx
callq 0x3250
leaq 0x16b83(%rip), %rsi     # 0x1e20f
leaq 0x60(%rsp), %rdi
movl $0x15, %edx
callq 0x3250
leaq 0x16b83(%rip), %rsi     # 0x1e225
leaq 0x60(%rsp), %rdi
movl $0xa, %edx
callq 0x3250
movl 0x1db71(%rip), %esi     # 0x25228
decl %esi
leaq 0x60(%rsp), %rdi
callq 0x3350
movq %rax, %rbx
leaq 0x16b63(%rip), %rsi     # 0x1e230
movl $0x7, %edx
movq %rax, %rdi
callq 0x3250
movl 0x1db4c(%rip), %esi     # 0x2522c
decl %esi
movq %rbx, %rdi
callq 0x3350
leaq 0x16b47(%rip), %rsi     # 0x1e238
movl $0x1e, %edx
movq %rax, %rdi
callq 0x3250
movq 0x1d8c3(%rip), %rdi     # 0x24fc8
leaq 0x16b4b(%rip), %rsi     # 0x1e257
movl $0x4, %edx
callq 0x3250
movl 0x1db0c(%rip), %esi     # 0x25228
decl %esi
movq 0x1d8a3(%rip), %rdi     # 0x24fc8
callq 0x3350
movq %rax, %rbx
leaq 0x16b28(%rip), %rsi     # 0x1e25c
movl $0x6, %edx
movq %rax, %rdi
callq 0x3250
movl 0x1dae5(%rip), %esi     # 0x2522c
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, 0x1daa6(%rip)     # 0x25228
jl 0x7801
movl $0x1, %ebp
xorl %r13d, %r13d
leaq 0x60(%rsp), %rbx
leaq 0x17659(%rip), %r14     # 0x1edf1
leaq 0x16b1b(%rip), %r15     # 0x1e2ba
movq 0x231da(%rip), %rax     # 0x2a980
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 0x231b1(%rip), %rax     # 0x2a980
movsd 0x18(%rax,%r13), %xmm0
movq %r12, %rdi
callq 0x3300
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x3250
incq %rbp
movslq 0x1da30(%rip), %rax     # 0x25228
addq $0x10, %r13
cmpq %rax, %rbp
jl 0x779f
cmpl $0x2, 0x1da24(%rip)     # 0x2522c
jl 0x787c
movl $0x1, %r12d
movl $0x10, %r13d
leaq 0x60(%rsp), %rbx
leaq 0x175d2(%rip), %r14     # 0x1edf4
leaq 0x16a91(%rip), %r15     # 0x1e2ba
xorl %ebp, %ebp
movq 0x23156(%rip), %rax     # 0x2a988
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 0x782b
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3250
incq %r12
movslq 0x1d9b9(%rip), %rax     # 0x2522c
addq $0x10, %r13
cmpq %rax, %r12
jl 0x7829
leaq 0x60(%rsp), %rdi
callq 0x32a0
movq 0x230f3(%rip), %rdi     # 0x2a980
testq %rdi, %rdi
je 0x7897
callq 0x3280
movq 0x230ea(%rip), %rdi     # 0x2a988
testq %rdi, %rdi
je 0x78a8
callq 0x3280
movq 0x1d711(%rip), %rsi     # 0x24fc0
leaq 0x260(%rsp), %rdi
callq 0x3100
leaq 0x2d0(%rsp), %rdi
callq 0x30b0
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x78e4
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3220
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x78ff
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
movq 0x1d6b2(%rip), %rax     # 0x24fb8
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 0x797f
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3220
jmp 0x797f
jmp 0x797c
movq %rax, %rbx
jmp 0x79a0
movq %rax, %rbx
jmp 0x79bb
movq %rax, %rbx
jmp 0x79d6
jmp 0x797c
jmp 0x797c
jmp 0x797c
jmp 0x797c
movq %rax, %rbx
movq 0x1d63a(%rip), %rsi     # 0x24fc0
leaq 0x260(%rsp), %rdi
callq 0x3100
leaq 0x2d0(%rsp), %rdi
callq 0x30b0
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x79bb
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3220
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x79d6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3220
leaq 0x60(%rsp), %rdi
callq 0x32c0
movq %rbx, %rdi
callq 0x3370