// File: /workspace/github_cpp_makefile_star2_O1/jkeys-ecg-nmsu[P]graph-with-search-algorithms/Graph.cpp
// Function: Graph::save(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
void Graph::save(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]);
		list<Edge> uEdges = getEdges(m_nodes[u]);
		//only print to file if this node has children (directed)
		for(list<Edge>::iterator e = uEdges.begin(); e != uEdges.end(); e++) {
			fs << name(e->u_id()) << '\t' << name(e->v_id()) << '\t' << e->weight() << '\n';
		}
 	}
		
	fs.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movq %rdi, %r14
movq (%rsi), %rsi
leaq -0x2c0(%rbp), %rdi
movl $0x10, %edx
callq 0x2250
leaq -0x250(%rbp), %rdi
callq 0x20a0
testb %al, %al
je 0x5986
movq (%r14), %rdi
cmpq %rdi, 0x8(%r14)
je 0x5932
xorl %r13d, %r13d
leaq -0xc0(%rbp), %r15
leaq -0x90(%rbp), %rbx
xorl %r12d, %r12d
shlq $0x7, %r13
addq %r13, %rdi
callq 0x7bc4
cltq
leaq (%rax,%rax,2), %rsi
shlq $0x4, %rsi
addq 0x18(%r14), %rsi
movq %r15, %rdi
callq 0x66b0
movq %r12, -0x78(%rbp)
addq (%r14), %r13
movq %r13, %rdi
callq 0x7bc4
cltq
leaq (%rax,%rax,2), %rsi
shlq $0x3, %rsi
addq 0x30(%r14), %rsi
movq %rbx, %rdi
callq 0x655c
movq -0x90(%rbp), %r12
cmpq %rbx, %r12
je 0x58e6
leaq 0x10(%r12), %r13
movq %r13, %rdi
callq 0x7c34
movslq %eax, %rdi
shlq $0x7, %rdi
addq (%r14), %rdi
callq 0x7bce
leaq -0x60(%rbp), %rcx
movq %rcx, -0x70(%rbp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x70(%rbp), %rdi
callq 0x2bfe
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
leaq -0x2c0(%rbp), %rdi
callq 0x2270
movb $0x9, -0x50(%rbp)
movl $0x1, %edx
movq %rax, %rdi
leaq -0x50(%rbp), %rsi
callq 0x2270
movq %rax, %r15
movq %r13, %rdi
callq 0x7c3c
movslq %eax, %rdi
shlq $0x7, %rdi
addq (%r14), %rdi
callq 0x7bce
leaq -0x40(%rbp), %rcx
movq %rcx, -0x50(%rbp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %rdi
callq 0x2bfe
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %r15, %rdi
callq 0x2270
movb $0x9, -0x29(%rbp)
movl $0x1, %edx
movq %rax, %rdi
leaq -0x29(%rbp), %rsi
callq 0x2270
movq %rax, %r15
movq %r13, %rdi
callq 0x7c46
movq %r15, %rdi
callq 0x2310
movb $0xa, -0x29(%rbp)
movl $0x1, %edx
movq %rax, %rdi
leaq -0x29(%rbp), %rsi
callq 0x2270
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x58cb
callq 0x21f0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x58dd
callq 0x21f0
movq (%r12), %r12
jmp 0x57ce
movq -0x90(%rbp), %rdi
cmpq %rbx, %rdi
je 0x5902
movq (%rdi), %r15
callq 0x21f0
movq %r15, %rdi
cmpq %rbx, %r15
jne 0x58f2
leaq -0xc0(%rbp), %r15
movq %r15, %rdi
callq 0x2d76
movq -0x78(%rbp), %r12
incl %r12d
movq (%r14), %rdi
movq 0x8(%r14), %rax
subq %rdi, %rax
sarq $0x7, %rax
movq %r12, %r13
cmpq %r12, %rax
jne 0x5780
leaq -0x2c0(%rbp), %rdi
callq 0x22b0
movq 0xf683(%rip), %rax      # 0x14fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x2b8(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x2c0(%rbp,%rcx)
callq 0x21d0
leaq -0x1c8(%rbp), %rdi
callq 0x20e0
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9723(%rip), %rdi      # 0xf0b0
leaq 0x9729(%rip), %rsi      # 0xf0bd
leaq 0x98fd(%rip), %rcx      # 0xf298
movl $0x1b8, %edx            # imm = 0x1B8
callq 0x2150
jmp 0x59a7
movq %rax, %r14
jmp 0x5a0c
movq %rax, %r14
jmp 0x5a00
jmp 0x59b8
movq %rax, %r14
jmp 0x59e4
movq %rax, %r14
jmp 0x59d2
movq %rax, %r14
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x59d2
callq 0x21f0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x59e4
callq 0x21f0
movq -0x90(%rbp), %rdi
cmpq %rbx, %rdi
je 0x5a00
movq (%rdi), %r15
callq 0x21f0
movq %r15, %rdi
cmpq %rbx, %r15
jne 0x59f0
leaq -0xc0(%rbp), %rdi
callq 0x2d76
leaq -0x2c0(%rbp), %rdi
callq 0x22e0
movq %r14, %rdi
callq 0x2380