// File: /workspace/github_cpp_makefile_star2_O1/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 0x7e034
cmpl $0x0, 0x138(%rbp)
jle 0x7dfd5
addq $0x10, 0x8(%rsp)
xorl %r15d, %r15d
leaq 0xd79e6(%rip), %r12     # 0x15552e
movl $0x1, %edx
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x44e0
movl $0x8, %edx
movq %rbx, %rdi
leaq 0xd928d(%rip), %rsi     # 0x156df9
callq 0x44e0
movq %rbx, %rdi
movl %r15d, %esi
callq 0x4750
movq %rax, %r13
movl $0xf, %edx
movq %rax, %rdi
leaq 0xd9274(%rip), %rsi     # 0x156e02
callq 0x44e0
movq 0x238(%rbp), %rax
movq 0x240(%rbp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r15, %rdx
jbe 0x7e028
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 0x7dfbb
xorl %r13d, %r13d
movq 0xa8(%rbp), %rax
movq 0xb0(%rbp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
imulq %r12, %rdx
cmpq %r13, %rdx
jbe 0x7e006
leaq (,%r13,2), %rbx
addq %r13, %rbx
leaq (%rax,%rbx,8), %rsi
leaq 0x18(%rsp), %rdi
callq 0xe886
movq 0x90(%rbp), %rax
movq 0x98(%rbp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
imulq %r12, %rdx
cmpq %r13, %rdx
jbe 0x7e017
movq 0x18(%rsp), %rdi
cmpq %rdi, 0x20(%rsp)
je 0x7df87
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 0x7dff8
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 0x38318
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 0x7dfe7
movslq (%rax,%r13,4), %r13
movq 0x140(%rbp), %rax
movq 0x148(%rbp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r13, %rdx
jbe 0x7dfe7
movl (%rax,%r13,4), %eax
movq %r12, %r15
cmpq %rax, %r12
jne 0x7df36
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 0xd650d(%rip), %rsi     # 0x154351
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 0xd95e3(%rip), %rsi     # 0x157486
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 0xd95ae(%rip), %rsi     # 0x157486
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 0xd5530(%rip), %rsi     # 0x15343d
callq 0x44e0
movq %r13, %rdi
movsd 0xd114b(%rip), %xmm0    # 0x14f068
callq 0x46b0
movl $0x1, %edx
movq %rax, %rdi
leaq 0xd75fd(%rip), %rsi     # 0x15552e
callq 0x44e0
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
movl 0x14(%rsp), %ebx
je 0x7df57
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 0x7dc96
movabsq $-0x5555555555555555, %r12 # imm = 0xAAAAAAAAAAAAAAAB
movq 0x48(%rsp), %r13
testq %rdi, %rdi
je 0x7df99
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 0x7dbf0
incq %r15
movslq 0x138(%rbp), %rax
cmpq %rax, %r15
leaq 0xd755f(%rip), %r12     # 0x15552e
jl 0x7db48
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd16b7(%rip), %rdi     # 0x14f6a5
movq %r13, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xd16a6(%rip), %rdi     # 0x14f6a5
xorl %eax, %eax
callq 0x4630
leaq 0xd1698(%rip), %rdi     # 0x14f6a5
movq %r13, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xd1687(%rip), %rdi     # 0x14f6a5
movq %r13, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xd1676(%rip), %rdi     # 0x14f6a5
movq %r15, %rsi
jmp 0x7e010
movq 0x118fb5(%rip), %rdi    # 0x196ff0
leaq 0xd8d72(%rip), %rsi     # 0x156db4
callq 0x4440
leaq 0xd74e0(%rip), %rbx     # 0x15552e
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4440
leaq 0xd1ae3(%rip), %rsi     # 0x14fb43
movq %rax, %rdi
callq 0x4440
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4440
movl $0x1, %edi
callq 0x710c
jmp 0x7e081
jmp 0x7e081
movq %rax, %rbx
jmp 0x7e0a8
jmp 0x7e088
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x7e0a8
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x7e0bf
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq %rbx, %rdi
callq 0x4780
nop