// File: /workspace/github_cpp_makefile_star2_O1/suhasjains[P]AMR-Solver/src/output.cpp
// Function: std::write_output_file()
void write_output_file() {

	int count = 0;
	int blocknumber;
	double xmin, xmax, ymin, ymax, zmin, zmax;
	int level;
	string eastbc, westbc, northbc, southbc, topbc, bottombc;
        myOctree::NodeBc east_bc, west_bc, north_bc, south_bc, top_bc, bottom_bc;



	ofstream file ("output.pfs");
	if(file.fail()) {
                cerr << "Error opening input file\n";
                exit(1);
        }
		
	file << "blocks" <<endl;
	
	for (std::list<Octree*>::iterator it = nodes.begin(), end = nodes.end(); it != end; ++it)     {
	count++;

	xmin = (*it)->x_min;	
	ymin = (*it)->y_min;	
	zmin = (*it)->z_min;	
	xmax = (*it)->x_max;	
	ymax = (*it)->y_max;	
	zmax = (*it)->z_max;	
	level = (*it)->get_level();
	east_bc = (*it)->bc[myOctree::XDIR][myOctree::RIGHT];
	west_bc = (*it)->bc[myOctree::XDIR][myOctree::LEFT];
	north_bc = (*it)->bc[myOctree::YDIR][myOctree::RIGHT];
	south_bc = (*it)->bc[myOctree::YDIR][myOctree::LEFT];
	top_bc = (*it)->bc[myOctree::ZDIR][myOctree::RIGHT];
	bottom_bc = (*it)->bc[myOctree::ZDIR][myOctree::LEFT];
	
	blocknumber = (*it)->number;

	eastbc = NodeBc_to_string(east_bc);
	westbc = NodeBc_to_string(west_bc);
	northbc = NodeBc_to_string(north_bc);
	southbc = NodeBc_to_string(south_bc);
	topbc = NodeBc_to_string(top_bc);
	bottombc = NodeBc_to_string(bottom_bc);

	file << blocknumber << " " << xmin << " " << xmax << " " << ymin << " " << ymax << " " << zmin << " " << zmax << " " << level<< " " ;			 
	file << eastbc << " " << westbc << " " << northbc << " " << southbc << " " << topbc << " " << bottombc << endl;
		
	}

	file.close();
	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x328, %rsp            # imm = 0x328
leaq -0x110(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0xf0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0xd0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0xb0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x90(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x70(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x6bbb(%rip), %rsi      # 0x113f6
leaq -0x350(%rbp), %rdi
movl $0x10, %edx
callq 0x2220
movq -0x350(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x330(%rbp,%rax)
jne 0xadc9
leaq 0x6baf(%rip), %rsi      # 0x1141b
leaq -0x350(%rbp), %rbx
movl $0x6, %edx
movq %rbx, %rdi
callq 0x2230
movq -0x350(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %esi
leaq -0x350(%rbp), %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2150
leaq 0xa952(%rip), %rax      # 0x15208
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq (%rax), %rax
cmpq 0xa6e0(%rip), %rax      # 0x14fa8
je 0xacb2
movq %rax, -0x50(%rbp)
movq 0x10(%rax), %rdi
movsd 0x68(%rdi), %xmm0
movsd %xmm0, -0x150(%rbp)
movsd 0x70(%rdi), %xmm0
movsd %xmm0, -0x148(%rbp)
movsd 0x78(%rdi), %xmm0
movsd %xmm0, -0x140(%rbp)
movsd 0x88(%rdi), %xmm0
movsd %xmm0, -0x130(%rbp)
movsd 0x80(%rdi), %xmm0
movsd %xmm0, -0x138(%rbp)
movsd 0x90(%rdi), %xmm0
movsd %xmm0, -0x128(%rbp)
callq 0x40ba
movl %eax, -0x54(%rbp)
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x38(%rax), %esi
movl 0x3c(%rax), %r12d
movl 0x40(%rax), %r13d
movl 0x44(%rax), %r14d
movl 0x48(%rax), %ebx
movl 0x4c(%rax), %ecx
movl %ecx, -0x5c(%rbp)
movl 0x98(%rax), %eax
movl %eax, -0x58(%rbp)
leaq -0x48(%rbp), %r15
movq %r15, %rdi
callq 0xa6fc
leaq -0x120(%rbp), %rdi
movq %r15, %rsi
callq 0x2260
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xa992
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2200
movq %r15, %rdi
movl %r12d, %esi
callq 0xa6fc
leaq -0x100(%rbp), %rdi
movq %r15, %rsi
callq 0x2260
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xa9c5
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2200
movq %r15, %rdi
movl %r13d, %esi
callq 0xa6fc
leaq -0xe0(%rbp), %rdi
movq %r15, %rsi
callq 0x2260
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xa9f8
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2200
movq %r15, %rdi
movl %r14d, %esi
callq 0xa6fc
leaq -0xc0(%rbp), %rdi
movq %r15, %rsi
callq 0x2260
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xaa2b
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2200
movq %r15, %rdi
movl %ebx, %esi
callq 0xa6fc
leaq -0xa0(%rbp), %rdi
movq %r15, %rsi
callq 0x2260
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xaa5d
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2200
movq %r15, %rdi
movl -0x5c(%rbp), %esi
callq 0xa6fc
leaq -0x80(%rbp), %rdi
movq %r15, %rsi
callq 0x2260
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xaa8d
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2200
leaq -0x350(%rbp), %r14
movq %r14, %rdi
movl -0x58(%rbp), %esi
callq 0x2330
leaq 0x671e(%rip), %r15      # 0x111c4
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2230
movq %rbx, %rdi
movsd -0x150(%rbp), %xmm0
callq 0x2300
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2230
movq %rbx, %rdi
movsd -0x148(%rbp), %xmm0
callq 0x2300
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2230
movq %rbx, %rdi
movsd -0x140(%rbp), %xmm0
callq 0x2300
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2230
movq %rbx, %rdi
movsd -0x138(%rbp), %xmm0
callq 0x2300
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2230
movq %rbx, %rdi
movsd -0x130(%rbp), %xmm0
callq 0x2300
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2230
movq %rbx, %rdi
movsd -0x128(%rbp), %xmm0
callq 0x2300
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2230
movq %rbx, %rdi
movl -0x54(%rbp), %esi
callq 0x2330
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2230
movq -0x120(%rbp), %rsi
movq -0x118(%rbp), %rdx
movq %r14, %rdi
callq 0x2230
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2230
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdx
movq %rbx, %rdi
callq 0x2230
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2230
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
movq %rbx, %rdi
callq 0x2230
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2230
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
movq %rbx, %rdi
callq 0x2230
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2230
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdx
movq %rbx, %rdi
callq 0x2230
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2230
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
movq %rbx, %rdi
callq 0x2230
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2150
jmp 0xa8ba
leaq -0x350(%rbp), %rdi
callq 0x2290
movq 0xa303(%rip), %rax      # 0x14fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x348(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x350(%rbp,%rcx)
callq 0x2190
leaq -0x258(%rbp), %rdi
callq 0x20b0
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0xad0d
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0xad2f
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0xad51
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0xad73
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0xad95
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0xadb7
movq -0x110(%rbp), %rsi
incq %rsi
callq 0x2200
addq $0x328, %rsp            # imm = 0x328
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xa220(%rip), %rdi      # 0x14ff0
leaq 0x662a(%rip), %rsi      # 0x11401
callq 0x21e0
movl $0x1, %edi
callq 0x2250
movq %rax, %rbx
jmp 0xae08
jmp 0xadf9
jmp 0xadf9
jmp 0xadf9
jmp 0xadf9
jmp 0xadf9
jmp 0xadf9
jmp 0xadf9
movq %rax, %rbx
leaq -0x350(%rbp), %rdi
callq 0x22c0
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0xae21
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0xae43
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0xae65
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0xae87
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0xaea9
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x2200
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0xaecb
movq -0x110(%rbp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rdi
callq 0x2340
nop