// File: /workspace/github_cpp_makefile_star2_O3/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 0x6bb6(%rip), %rsi      # 0x113f6
leaq -0x350(%rbp), %rdi
movl $0x10, %edx
callq 0x2230
movq -0x350(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x330(%rbp,%rax)
jne 0xadce
leaq 0x6baa(%rip), %rsi      # 0x1141b
leaq -0x350(%rbp), %rbx
movl $0x6, %edx
movq %rbx, %rdi
callq 0x2240
movq -0x350(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
leaq -0x350(%rbp), %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2160
leaq 0xa95d(%rip), %rax      # 0x15218
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq (%rax), %rax
cmpq 0xa6db(%rip), %rax      # 0x14fa8
je 0xacb7
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 0x41e2
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 0xa748
leaq -0x120(%rbp), %rdi
movq %r15, %rsi
callq 0x2270
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xa997
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movq %r15, %rdi
movl %r12d, %esi
callq 0xa748
leaq -0x100(%rbp), %rdi
movq %r15, %rsi
callq 0x2270
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xa9ca
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movq %r15, %rdi
movl %r13d, %esi
callq 0xa748
leaq -0xe0(%rbp), %rdi
movq %r15, %rsi
callq 0x2270
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xa9fd
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movq %r15, %rdi
movl %r14d, %esi
callq 0xa748
leaq -0xc0(%rbp), %rdi
movq %r15, %rsi
callq 0x2270
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xaa30
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movq %r15, %rdi
movl %ebx, %esi
callq 0xa748
leaq -0xa0(%rbp), %rdi
movq %r15, %rsi
callq 0x2270
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xaa62
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movq %r15, %rdi
movl -0x5c(%rbp), %esi
callq 0xa748
leaq -0x80(%rbp), %rdi
movq %r15, %rsi
callq 0x2270
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xaa92
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
leaq -0x350(%rbp), %r14
movq %r14, %rdi
movl -0x58(%rbp), %esi
callq 0x2340
leaq 0x6719(%rip), %r15      # 0x111c4
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2240
movq %rbx, %rdi
movsd -0x150(%rbp), %xmm0
callq 0x2310
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2240
movq %rbx, %rdi
movsd -0x148(%rbp), %xmm0
callq 0x2310
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2240
movq %rbx, %rdi
movsd -0x140(%rbp), %xmm0
callq 0x2310
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2240
movq %rbx, %rdi
movsd -0x138(%rbp), %xmm0
callq 0x2310
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2240
movq %rbx, %rdi
movsd -0x130(%rbp), %xmm0
callq 0x2310
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2240
movq %rbx, %rdi
movsd -0x128(%rbp), %xmm0
callq 0x2310
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2240
movq %rbx, %rdi
movl -0x54(%rbp), %esi
callq 0x2340
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2240
movq -0x120(%rbp), %rsi
movq -0x118(%rbp), %rdx
movq %r14, %rdi
callq 0x2240
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2240
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdx
movq %rbx, %rdi
callq 0x2240
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2240
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
movq %rbx, %rdi
callq 0x2240
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2240
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
movq %rbx, %rdi
callq 0x2240
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2240
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdx
movq %rbx, %rdi
callq 0x2240
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2240
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
movq %rbx, %rdi
callq 0x2240
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2160
jmp 0xa8bf
leaq -0x350(%rbp), %rdi
callq 0x22a0
movq 0xa2fe(%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 0x21a0
leaq -0x258(%rbp), %rdi
callq 0x20b0
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0xad12
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0xad34
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0xad56
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0xad78
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0xad9a
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0xadbc
movq -0x110(%rbp), %rsi
incq %rsi
callq 0x2210
addq $0x328, %rsp            # imm = 0x328
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xa21b(%rip), %rdi      # 0x14ff0
leaq 0x6625(%rip), %rsi      # 0x11401
callq 0x21f0
movl $0x1, %edi
callq 0x2260
movq %rax, %rbx
jmp 0xae0d
jmp 0xadfe
jmp 0xadfe
jmp 0xadfe
jmp 0xadfe
jmp 0xadfe
jmp 0xadfe
jmp 0xadfe
movq %rax, %rbx
leaq -0x350(%rbp), %rdi
callq 0x22d0
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0xae26
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0xae48
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0xae6a
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0xae8c
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0xaeae
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0xaed0
movq -0x110(%rbp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2350