// File: /workspace/github_cpp_makefile_star2_O2/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 $0x338, %rsp            # imm = 0x338
leaq -0xa8(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq -0x128(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
leaq -0x108(%rbp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
movb %cl, (%rax)
movb %cl, (%rdx)
leaq -0xe8(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
leaq -0xc8(%rbp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
movb %cl, (%rax)
movb %cl, (%rdx)
leaq -0x88(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0x5aa3(%rip), %rsi      # 0xf3f6
leaq -0x358(%rbp), %rdi
pushq $0x10
popq %rdx
callq 0x2200
movq -0x358(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x338(%rbp,%rax)
jne 0x9d18
leaq 0x5a99(%rip), %rsi      # 0xf41b
leaq -0x358(%rbp), %rdi
callq 0x21d0
movq %rax, %rdi
callq 0x2110
leaq 0x985b(%rip), %rax      # 0x131f8
leaq -0x158(%rbp), %rbx
leaq -0x138(%rbp), %r15
leaq -0x118(%rbp), %r14
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
cmpq 0x95ec(%rip), %rax      # 0x12fb0
je 0x9ca6
movq %rax, -0x30(%rbp)
movq 0x10(%rax), %rdi
movsd 0x68(%rdi), %xmm0
movsd %xmm0, -0x78(%rbp)
movsd 0x70(%rdi), %xmm0
movsd %xmm0, -0x70(%rbp)
movsd 0x78(%rdi), %xmm0
movsd %xmm0, -0x68(%rbp)
movsd 0x88(%rdi), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd 0x80(%rdi), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd 0x90(%rdi), %xmm0
movsd %xmm0, -0x50(%rbp)
callq 0x3e06
movl %eax, -0x34(%rbp)
movq %r14, %r13
movq %r15, %r14
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x38(%rax), %esi
movl 0x3c(%rax), %r15d
movl 0x40(%rax), %r12d
movl 0x44(%rax), %ecx
movl %ecx, -0x44(%rbp)
movl 0x48(%rax), %ecx
movl %ecx, -0x40(%rbp)
movl 0x4c(%rax), %ecx
movl %ecx, -0x3c(%rbp)
movl 0x98(%rax), %eax
movl %eax, -0x38(%rbp)
movq %rbx, %rdi
callq 0x9878
leaq -0xb8(%rbp), %rdi
movq %rbx, %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x2100
movq %rbx, %rdi
movl %r15d, %esi
callq 0x9878
movq %r14, %r15
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x2100
movq %rbx, %rdi
movl %r12d, %esi
callq 0x9878
movq %r13, %r14
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x2100
movq %rbx, %rdi
movl -0x44(%rbp), %esi
callq 0x9878
leaq -0xf8(%rbp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x2100
movq %rbx, %rdi
movl -0x40(%rbp), %esi
callq 0x9878
leaq -0xd8(%rbp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x2100
movq %rbx, %rdi
movl -0x3c(%rbp), %esi
callq 0x9878
leaq -0x98(%rbp), %rdi
movq %rbx, %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x2100
leaq -0x358(%rbp), %rdi
movl -0x38(%rbp), %esi
callq 0x2310
movq %rax, %rdi
leaq 0x568b(%rip), %rsi      # 0xf1c4
callq 0x21d0
movq %rax, %rdi
movsd -0x78(%rbp), %xmm0
callq 0x22e0
movq %rax, %rdi
leaq 0x566f(%rip), %rsi      # 0xf1c4
callq 0x21d0
movq %rax, %rdi
movsd -0x70(%rbp), %xmm0
callq 0x22e0
movq %rax, %rdi
leaq 0x5653(%rip), %rsi      # 0xf1c4
callq 0x21d0
movq %rax, %rdi
movsd -0x68(%rbp), %xmm0
callq 0x22e0
movq %rax, %rdi
leaq 0x5637(%rip), %rsi      # 0xf1c4
callq 0x21d0
movq %rax, %rdi
movsd -0x60(%rbp), %xmm0
callq 0x22e0
movq %rax, %rdi
leaq 0x561b(%rip), %rsi      # 0xf1c4
callq 0x21d0
movq %rax, %rdi
movsd -0x58(%rbp), %xmm0
callq 0x22e0
movq %rax, %rdi
leaq 0x55ff(%rip), %rsi      # 0xf1c4
callq 0x21d0
movq %rax, %rdi
movsd -0x50(%rbp), %xmm0
callq 0x22e0
movq %rax, %rdi
leaq 0x55e3(%rip), %rsi      # 0xf1c4
callq 0x21d0
movq %rax, %rdi
movl -0x34(%rbp), %esi
callq 0x2310
movq %rax, %rdi
leaq 0x55c9(%rip), %rsi      # 0xf1c4
callq 0x21d0
leaq -0x358(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x21a0
movq %rax, %rdi
leaq 0x55a7(%rip), %rsi      # 0xf1c4
callq 0x21d0
movq %rax, %rdi
movq %r15, %rsi
callq 0x21a0
movq %rax, %rdi
leaq 0x558d(%rip), %rsi      # 0xf1c4
callq 0x21d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21a0
movq %rax, %rdi
leaq 0x5573(%rip), %rsi      # 0xf1c4
callq 0x21d0
movq %rax, %rdi
movq %r12, %rsi
callq 0x21a0
movq %rax, %rdi
leaq 0x5559(%rip), %rsi      # 0xf1c4
callq 0x21d0
movq %rax, %rdi
movq %r13, %rsi
callq 0x21a0
movq %rax, %rdi
leaq 0x553f(%rip), %rsi      # 0xf1c4
callq 0x21d0
movq %rax, %rdi
leaq -0x98(%rbp), %rsi
callq 0x21a0
movq %rax, %rdi
callq 0x2110
jmp 0x99b6
leaq -0x358(%rbp), %rdi
callq 0x2280
leaq -0x358(%rbp), %rdi
callq 0x22b0
leaq -0x98(%rbp), %rdi
callq 0x2100
leaq -0xd8(%rbp), %rdi
callq 0x2100
leaq -0xf8(%rbp), %rdi
callq 0x2100
leaq -0x118(%rbp), %rdi
callq 0x2100
leaq -0x138(%rbp), %rdi
callq 0x2100
leaq -0xb8(%rbp), %rdi
callq 0x2100
addq $0x338, %rsp            # imm = 0x338
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x92d1(%rip), %rdi      # 0x12ff0
leaq 0x56db(%rip), %rsi      # 0xf401
callq 0x21d0
pushq $0x1
popq %rdi
callq 0x2220
movq %rax, %rbx
jmp 0x9d55
jmp 0x9d46
jmp 0x9d46
jmp 0x9d46
jmp 0x9d46
jmp 0x9d46
jmp 0x9d46
jmp 0x9d46
movq %rax, %rbx
leaq -0x358(%rbp), %rdi
callq 0x22b0
leaq -0x98(%rbp), %rdi
callq 0x2100
leaq -0xd8(%rbp), %rdi
callq 0x2100
leaq -0xf8(%rbp), %rdi
callq 0x2100
leaq -0x118(%rbp), %rdi
callq 0x2100
leaq -0x138(%rbp), %rdi
callq 0x2100
leaq -0xb8(%rbp), %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x2320
nopl (%rax)