// File: /workspace/github_cpp_makefile_star2_O2/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 $0xf8, %rsp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x80(%rsi), %rdi
callq 0x4130
testb %al, %al
je 0x5da88
addq $0x10, %r15
leaq 0x238(%r14), %rax
movq %rax, 0x28(%rsp)
leaq 0x90(%r14), %rax
movq %rax, 0x38(%rsp)
leaq 0xa8(%r14), %rax
movq %rax, 0x30(%rsp)
leaq 0x60(%r14), %r12
leaq 0x140(%r14), %r13
xorl %ebp, %ebp
leaq 0x98(%rsp), %rbx
movq %r15, 0x8(%rsp)
movslq 0x138(%r14), %rax
cmpq %rax, %rbp
jge 0x5da76
movq %r15, %rdi
leaq 0xa4e27(%rip), %rsi     # 0x10257e
callq 0x4480
movq %rax, %rdi
leaq 0xa6703(%rip), %rsi     # 0x103e69
callq 0x4480
movq %rax, %rdi
movl %ebp, %esi
callq 0x4760
movq %rax, %rdi
leaq 0xa66f3(%rip), %rsi     # 0x103e72
callq 0x4480
movq %rax, %r15
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
callq 0xaa50
movsd (%rax), %xmm0
movq %r15, %rdi
callq 0x46c0
movq %rax, %rdi
leaq 0xa4dd4(%rip), %rsi     # 0x10257e
callq 0x4480
xorl %r15d, %r15d
movl %r15d, %r15d
movq 0x98(%r14), %rax
subq 0x90(%r14), %rax
cqto
pushq $0xc
popq %rcx
idivq %rcx
cmpq %r15, %rax
jbe 0x5da69
movq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0x4bbec
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa6ce
movq 0x38(%rsp), %rdi
movq %r15, 0x40(%rsp)
movq %r15, %rsi
callq 0x576b6
cvtsi2sdl (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
cvtsi2sdl 0x4(%rax), %xmm0
movsd %xmm0, 0x18(%rsp)
cvtsi2sdl 0x8(%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
xorl %r15d, %r15d
movl %r15d, %r15d
movq 0xa0(%rsp), %rax
subq 0x98(%rsp), %rax
sarq $0x2, %rax
cmpq %r15, %rax
jbe 0x5da54
movq %rbx, %rdi
movq %r15, %rsi
callq 0xac00
movslq (%rax), %rsi
movq %r12, %rdi
callq 0xabe2
leaq 0xb0(%rsp), %rdi
movq %rax, %rsi
callq 0x29ebe
movq %rbx, %rdi
movq %r15, %rsi
callq 0xac00
movslq (%rax), %rsi
movq %r13, %rdi
callq 0xac00
movl (%rax), %eax
cmpq %rax, %rbp
jne 0x5da3f
movsd 0xb8(%rsp), %xmm0
movsd %xmm0, 0x78(%rsp)
movsd 0xc0(%r14), %xmm0
movsd %xmm0, 0x80(%rsp)
movsd 0xd8(%r14), %xmm0
movsd %xmm0, 0x88(%rsp)
movsd 0xf0(%r14), %xmm0
movsd %xmm0, 0x90(%rsp)
movsd 0xc8(%r14), %xmm1
movsd 0x20(%rsp), %xmm0
mulsd %xmm0, %xmm1
addsd 0xc0(%rsp), %xmm1
movsd %xmm1, 0x70(%rsp)
movsd 0xe0(%r14), %xmm2
movsd 0x18(%rsp), %xmm1
mulsd %xmm1, %xmm2
movsd %xmm2, 0x60(%rsp)
movsd 0xf8(%r14), %xmm3
movsd 0x10(%rsp), %xmm2
mulsd %xmm2, %xmm3
movsd %xmm3, 0x68(%rsp)
movsd 0xd0(%r14), %xmm3
mulsd %xmm0, %xmm3
addsd 0xc8(%rsp), %xmm3
movsd %xmm3, 0x58(%rsp)
movsd 0xe8(%r14), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0x100(%r14), %xmm0
mulsd %xmm2, %xmm0
movsd %xmm0, 0x50(%rsp)
movq 0x8(%rsp), %rdi
leaq 0xa3a02(%rip), %rsi     # 0x101371
callq 0x4480
movsd 0x80(%rsp), %xmm0
mulsd 0x20(%rsp), %xmm0
addsd 0x78(%rsp), %xmm0
movsd 0x88(%rsp), %xmm1
mulsd 0x18(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd 0x90(%rsp), %xmm0
mulsd 0x10(%rsp), %xmm0
addsd %xmm1, %xmm0
movq %rax, %rdi
callq 0x46c0
movq %rax, %rdi
leaq 0xa6b51(%rip), %rsi     # 0x104512
callq 0x4480
movsd 0x60(%rsp), %xmm1
addsd 0x70(%rsp), %xmm1
movsd 0x68(%rsp), %xmm0
addsd %xmm1, %xmm0
movq %rax, %rdi
callq 0x46c0
movq %rax, %rdi
leaq 0xa6b24(%rip), %rsi     # 0x104512
callq 0x4480
movsd 0x48(%rsp), %xmm1
addsd 0x58(%rsp), %xmm1
movsd 0x50(%rsp), %xmm0
addsd %xmm1, %xmm0
movq %rax, %rdi
callq 0x46c0
movq %rax, %rdi
leaq 0xa2a42(%rip), %rsi     # 0x10045d
callq 0x4480
movq %rax, %rdi
movsd 0x9e645(%rip), %xmm0    # 0xfc070
callq 0x46c0
movq %rax, %rdi
leaq 0xa4b44(%rip), %rsi     # 0x10257e
callq 0x4480
leaq 0xd0(%rsp), %rdi
callq 0xaf14
incl %r15d
jmp 0x5d821
movq %rbx, %rdi
callq 0xb290
movq 0x40(%rsp), %r15
incl %r15d
jmp 0x5d7b2
incq %rbp
movq 0x8(%rsp), %r15
jmp 0x5d73d
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xf2561(%rip), %rdi     # 0x14fff0
leaq 0xa638e(%rip), %rsi     # 0x103e24
callq 0x4480
leaq 0xa4adc(%rip), %rbx     # 0x10257e
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4480
leaq 0x9f0ff(%rip), %rsi     # 0xfcbb3
movq %rax, %rdi
callq 0x4480
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4480
pushq $0x1
popq %rdi
callq 0x524c
jmp 0x5dad3
jmp 0x5dad8
movq %rax, %rbx
jmp 0x5dae8
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0xaf14
leaq 0x98(%rsp), %rdi
callq 0xb290
movq %rbx, %rdi
callq 0x4780
nop