// File: /workspace/github_cpp_makefile_star2_O3/jkeys-ecg-nmsu[P]graph-with-search-algorithms/Graph.cpp
// Function: Graph::saveUndirected(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
void Graph::saveUndirected(const string & file) const {
	ofstream fs( file.c_str() );
	assert( fs.is_open() );
		
	for(unsigned int u = 0; u != m_nodes.size(); u++) {
		set<Node> adjNodes = getAdjNodes(m_nodes[u]);
		for(set<Node>::iterator v = adjNodes.begin(); v != adjNodes.end(); v++) {
			fs << m_nodes[u].name() << '\t' << m_nodes[v->id()].name() << '\n';
			fs << m_nodes[v->id()].name() << '\t' << m_nodes[u].name() << '\n'; //may print duplicates;		
		}
 	}
	
	
	fs.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x248, %rsp            # imm = 0x248
movq %rdi, %rbx
movq (%rsi), %rsi
leaq -0x268(%rbp), %rdi
movl $0x10, %edx
callq 0x2250
leaq -0x1f8(%rbp), %rdi
callq 0x20a0
testb %al, %al
je 0x5c6e
movq (%rbx), %rdi
cmpq %rdi, 0x8(%rbx)
je 0x5c1a
xorl %r12d, %r12d
leaq -0x68(%rbp), %r14
xorl %ecx, %ecx
movq %rcx, -0x38(%rbp)
shlq $0x7, %r12
addq %r12, %rdi
callq 0x7c44
cltq
leaq (%rax,%rax,2), %rsi
shlq $0x4, %rsi
addq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0x6756
movq -0x50(%rbp), %r13
leaq -0x60(%rbp), %rax
cmpq %rax, %r13
je 0x5bee
movq (%rbx), %rdi
addq %r12, %rdi
callq 0x7c4e
movq (%rax), %rsi
movq 0x8(%rax), %rdx
leaq -0x268(%rbp), %rdi
callq 0x2270
movb $0x9, -0x29(%rbp)
movl $0x1, %edx
movq %rax, %rdi
leaq -0x29(%rbp), %rsi
callq 0x2270
movq %rax, %r15
leaq 0x20(%r13), %r14
movq %r14, %rdi
callq 0x7c44
movslq %eax, %rdi
shlq $0x7, %rdi
addq (%rbx), %rdi
callq 0x7c4e
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r15, %rdi
callq 0x2270
movb $0xa, -0x29(%rbp)
movl $0x1, %edx
movq %rax, %rdi
leaq -0x29(%rbp), %rsi
callq 0x2270
movq %r14, %rdi
callq 0x7c44
movslq %eax, %rdi
shlq $0x7, %rdi
addq (%rbx), %rdi
callq 0x7c4e
movq (%rax), %rsi
movq 0x8(%rax), %rdx
leaq -0x268(%rbp), %rdi
callq 0x2270
movb $0x9, -0x29(%rbp)
movl $0x1, %edx
movq %rax, %rdi
leaq -0x29(%rbp), %rsi
callq 0x2270
movq %rax, %r14
movq (%rbx), %rdi
addq %r12, %rdi
callq 0x7c4e
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r14, %rdi
callq 0x2270
movb $0xa, -0x29(%rbp)
movl $0x1, %edx
movq %rax, %rdi
leaq -0x29(%rbp), %rsi
callq 0x2270
movq %r13, %rdi
callq 0x2280
movq %rax, %r13
jmp 0x5aeb
leaq -0x68(%rbp), %r14
movq %r14, %rdi
callq 0x2dba
movq -0x38(%rbp), %rcx
incl %ecx
movq (%rbx), %rdi
movq 0x8(%rbx), %rax
subq %rdi, %rax
sarq $0x7, %rax
movq %rcx, %r12
cmpq %rcx, %rax
jne 0x5ac1
leaq -0x268(%rbp), %rdi
callq 0x22b0
movq 0xf39b(%rip), %rax      # 0x14fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x260(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x268(%rbp,%rcx)
callq 0x21d0
leaq -0x170(%rbp), %rdi
callq 0x20e0
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x943b(%rip), %rdi      # 0xf0b0
leaq 0x9441(%rip), %rsi      # 0xf0bd
leaq 0x963c(%rip), %rcx      # 0xf2bf
movl $0x1c9, %edx            # imm = 0x1C9
callq 0x2150
jmp 0x5c8f
movq %rax, %rbx
jmp 0x5ca0
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x2dba
leaq -0x268(%rbp), %rdi
callq 0x22e0
movq %rbx, %rdi
callq 0x2380