// File: /workspace/github_cpp_makefile_star2_O3/Luthaf[P]zeopp/feature.cc
// Function: FEATURE::segment_saveVis(std::basic_fstream<char, std::char_traits<char>>&)
void FEATURE::segment_saveVis(fstream &output)
{
	int k;

	if(!output.is_open()){
		cerr << "Error: File stream needed to print segment information was not open." << "\n"
			<< "Exiting ..." << "\n";
		exit(1);
	}
	else{

		for(k=0;k<nsegments;k++)
		{
			output << "\n" << "Segment " << k << " with max_r of " << segment_max_r.at(k) << "\n";
	// Draw the components located in each unit cell
			for(unsigned int i = 0; i < unitCells.size(); i++){
				vector<int> nodeIDs = ucNodes.at(i);
				DELTA_POS disp = unitCells.at(i);

	// Iterate over all nodes in the unit cell
				for(unsigned int j = 0; j < nodeIDs.size(); j++){
					DIJKSTRA_NODE curNode = nodes.at(nodeIDs.at(j));

					if(segments.at(nodeIDs.at(j))==k)
					{
	// Find node coordinates
						double xCoord = curNode.x + v_a.x*disp.x + v_b.x*disp.y + v_c.x*disp.z;
						double yCoord = curNode.y + v_a.y*disp.x + v_b.y*disp.y + v_c.y*disp.z;
						double zCoord = curNode.z + v_a.z*disp.x + v_b.z*disp.y + v_c.z*disp.z;

	// Command used to draw node
//        output << "draw sphere {" << xCoord <<  " " << yCoord << " " << zCoord << "} radius " <<  curNode.max_radius << "\n";	
						output << "draw sphere {" << xCoord <<  " " << yCoord << " " << zCoord << "} radius " <<  0.1 << "\n";

					};//printing segment block


				} // ends for loop

			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdi, %rbp
movq %rsi, 0x8(%rsp)
leaq 0x80(%rsi), %rdi
callq 0x4120
testb %al, %al
je 0x7cf62
cmpl $0x0, 0x138(%rbp)
jle 0x7cf03
addq $0x10, 0x8(%rsp)
xorl %r15d, %r15d
leaq 0xd6ba8(%rip), %r12     # 0x15361e
movl $0x1, %edx
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x44e0
movl $0x8, %edx
movq %rbx, %rdi
leaq 0xd8477(%rip), %rsi     # 0x154f11
callq 0x44e0
movq %rbx, %rdi
movl %r15d, %esi
callq 0x4750
movq %rax, %r13
movl $0xf, %edx
movq %rax, %rdi
leaq 0xd845e(%rip), %rsi     # 0x154f1a
callq 0x44e0
movq 0x238(%rbp), %rax
movq 0x240(%rbp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r15, %rdx
jbe 0x7cf56
movsd (%rax,%r15,8), %xmm0
movq %r13, %rdi
callq 0x46b0
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x44e0
movq 0x98(%rbp), %rax
cmpq 0x90(%rbp), %rax
movabsq $-0x5555555555555555, %r12 # imm = 0xAAAAAAAAAAAAAAAB
je 0x7cee9
xorl %r13d, %r13d
movq 0xa8(%rbp), %rax
movq 0xb0(%rbp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
imulq %r12, %rdx
cmpq %r13, %rdx
jbe 0x7cf34
leaq (,%r13,2), %rbx
addq %r13, %rbx
leaq (%rax,%rbx,8), %rsi
leaq 0x18(%rsp), %rdi
callq 0xe8f8
movq 0x90(%rbp), %rax
movq 0x98(%rbp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
imulq %r12, %rdx
cmpq %r13, %rdx
jbe 0x7cf45
movq 0x18(%rsp), %rdi
cmpq %rdi, 0x20(%rsp)
je 0x7ceb5
movq %r13, 0x48(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl (%rax,%rbx,4), %xmm0
movsd %xmm0, 0x40(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0x4(%rax,%rbx,4), %xmm0
movsd %xmm0, 0x38(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0x8(%rax,%rbx,4), %xmm0
movsd %xmm0, 0x30(%rsp)
movl $0x1, %ecx
xorl %r13d, %r13d
movslq (%rdi,%r13,4), %rsi
movq 0x60(%rbp), %rbx
movq 0x68(%rbp), %rdx
subq %rbx, %rdx
sarq $0x3, %rdx
movabsq $-0x71c71c71c71c71c7, %rax # imm = 0x8E38E38E38E38E39
imulq %rax, %rdx
cmpq %rsi, %rdx
jbe 0x7cf26
movl %ecx, 0x14(%rsp)
movq %r15, %r12
leaq (%rsi,%rsi,8), %r15
leaq (%rbx,%r15,8), %rsi
addq $0x20, %rsi
movupd -0x20(%rsi), %xmm0
movupd -0x10(%rsi), %xmm1
movapd %xmm1, 0xb0(%rsp)
movapd %xmm0, 0xa0(%rsp)
leaq 0xc0(%rsp), %r14
movq %r14, %rdi
callq 0x37e9e
leaq (%rbx,%r15,8), %rax
movb 0x40(%rax), %cl
movb %cl, 0x20(%r14)
movq 0x38(%rax), %rax
movq %rax, 0x18(%r14)
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r13, %rdx
jbe 0x7cf15
movslq (%rax,%r13,4), %r13
movq 0x140(%rbp), %rax
movq 0x148(%rbp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r13, %rdx
jbe 0x7cf15
movl (%rax,%r13,4), %eax
movq %r12, %r15
cmpq %rax, %r12
jne 0x7ce64
movsd 0xa8(%rsp), %xmm0
movsd %xmm0, 0x80(%rsp)
movsd 0xc0(%rbp), %xmm0
movsd %xmm0, 0x88(%rsp)
movsd 0xd8(%rbp), %xmm0
movsd %xmm0, 0x90(%rsp)
movsd 0xf0(%rbp), %xmm0
movsd %xmm0, 0x98(%rsp)
movsd 0xc8(%rbp), %xmm1
movsd 0x40(%rsp), %xmm0
mulsd %xmm0, %xmm1
addsd 0xb0(%rsp), %xmm1
movsd %xmm1, 0x78(%rsp)
movsd 0xe0(%rbp), %xmm2
movsd 0x38(%rsp), %xmm1
mulsd %xmm1, %xmm2
movsd %xmm2, 0x68(%rsp)
movsd 0xf8(%rbp), %xmm3
movsd 0x30(%rsp), %xmm2
mulsd %xmm2, %xmm3
movsd %xmm3, 0x70(%rsp)
movsd 0xd0(%rbp), %xmm3
mulsd %xmm0, %xmm3
addsd 0xb8(%rsp), %xmm3
movsd %xmm3, 0x60(%rsp)
movsd 0xe8(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0x100(%rbp), %xmm0
mulsd %xmm2, %xmm0
movsd %xmm0, 0x58(%rsp)
movl $0xd, %edx
movq 0x8(%rsp), %rdi
leaq 0xd568f(%rip), %rsi     # 0x152401
callq 0x44e0
movsd 0x88(%rsp), %xmm0
mulsd 0x40(%rsp), %xmm0
addsd 0x80(%rsp), %xmm0
movsd 0x90(%rsp), %xmm1
mulsd 0x38(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd 0x98(%rsp), %xmm0
mulsd 0x30(%rsp), %xmm0
addsd %xmm1, %xmm0
movq 0x8(%rsp), %rdi
callq 0x46b0
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0xd8805(%rip), %rsi     # 0x1555d6
callq 0x44e0
movsd 0x68(%rsp), %xmm1
addsd 0x78(%rsp), %xmm1
movsd 0x70(%rsp), %xmm0
addsd %xmm1, %xmm0
movq %r13, %rdi
callq 0x46b0
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0xd87d0(%rip), %rsi     # 0x1555d6
callq 0x44e0
movsd 0x50(%rsp), %xmm1
addsd 0x60(%rsp), %xmm1
movsd 0x58(%rsp), %xmm0
addsd %xmm1, %xmm0
movq %r13, %rdi
callq 0x46b0
movq %rax, %r13
movl $0x9, %edx
movq %rax, %rdi
leaq 0xd4692(%rip), %rsi     # 0x1514cd
callq 0x44e0
movq %r13, %rdi
movsd 0xd021d(%rip), %xmm0    # 0x14d068
callq 0x46b0
movl $0x1, %edx
movq %rax, %rdi
leaq 0xd67bf(%rip), %rsi     # 0x15361e
callq 0x44e0
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
movl 0x14(%rsp), %ebx
je 0x7ce85
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movl %ebx, %r13d
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rax
subq %rdi, %rax
sarq $0x2, %rax
incl %ebx
cmpq %r13, %rax
movl %ebx, %ecx
ja 0x7cbc4
movabsq $-0x5555555555555555, %r12 # imm = 0xAAAAAAAAAAAAAAAB
movq 0x48(%rsp), %r13
testq %rdi, %rdi
je 0x7cec7
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x98(%rbp), %rax
subq 0x90(%rbp), %rax
incl %r13d
sarq $0x2, %rax
imulq %r12, %rax
cmpq %r13, %rax
ja 0x7cb1e
incq %r15
movslq 0x138(%rbp), %rax
cmpq %rax, %r15
leaq 0xd6721(%rip), %r12     # 0x15361e
jl 0x7ca76
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd07d9(%rip), %rdi     # 0x14d6f5
movq %r13, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xd07c8(%rip), %rdi     # 0x14d6f5
xorl %eax, %eax
callq 0x4630
leaq 0xd07ba(%rip), %rdi     # 0x14d6f5
movq %r13, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xd07a9(%rip), %rdi     # 0x14d6f5
movq %r13, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xd0798(%rip), %rdi     # 0x14d6f5
movq %r15, %rsi
jmp 0x7cf3e
movq 0x118087(%rip), %rdi    # 0x194ff0
leaq 0xd7f5c(%rip), %rsi     # 0x154ecc
callq 0x4440
leaq 0xd66a2(%rip), %rbx     # 0x15361e
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4440
leaq 0xd0c25(%rip), %rsi     # 0x14dbb3
movq %rax, %rdi
callq 0x4440
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4440
movl $0x1, %edi
callq 0x72bc
jmp 0x7cfaf
jmp 0x7cfaf
movq %rax, %rbx
jmp 0x7cfd6
jmp 0x7cfb6
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x7cfd6
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x7cfed
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq %rbx, %rdi
callq 0x4780
nop