// File: /workspace/github_cpp_makefile_star2_O3/jkeys-ecg-nmsu[P]graph-with-search-algorithms/Graph.cpp
// Function: Graph::scan_tmg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Graph::scan_tmg(const string & file) {	
	string tmg_start, tmg_version, tmg_simple;
	string num_nodes_s, num_edges_s;
	string waypoint, latitude_s, longitude_s;	
	int u_id, v_id, weight;
	double latitude, longitude;
    ifstream fs;
	
	int num_nodes, num_edges;
	
	fs.open(file.c_str()); assert(fs.is_open());
	
	/**** read in header data ****/
	
	fs >> tmg_start >> tmg_version >> tmg_simple >> num_nodes >> num_edges;
	
	assert(tmg_start == "TMG"); assert(tmg_version == "1.0"); assert(tmg_simple == "simple");	
		
	initEmpty(num_edges + 10); //twice num_edges because undirected
	
	/**** read in all nodes ****/
	
	cout << num_nodes << endl << num_edges << endl;	
	
	for (size_t i = 0; i != num_nodes; i++) {
		fs >> waypoint >> latitude >> longitude;
		// cout << waypoint << latitude_s << longitude_s << endl;
				 
		u_id = current_id;
		current_id++;			
			
		Node n(waypoint, u_id); 
		
		n.setLatitude(latitude);
		n.setLongitude(longitude);
		
		m_nodes.push_back(n);	
	} //end for
	
	
	/**** have read in all nodes, now read in all edges ****/
	
	string adjRoads;
	
	
	for (size_t i = 0; i != num_edges; i++) {
		fs >> u_id >> v_id >> adjRoads;
		
		Node u = m_nodes[u_id]; 
		Node v = m_nodes[v_id];
		
		double u_v_distance = calculateDistance(u, v);
				
		Edge u_v(u_id, v_id, u_v_distance);
		Edge v_u(v_id, u_id, u_v_distance); //undirected
		
		addEdge(u, v); addEdge(v, u);
		
		addEdgeObj(u, u_v); addEdgeObj(v, v_u);
		
		setEdgeRoads(m_nodes[u_id], adjRoads);
		setEdgeRoads(m_nodes[v_id], adjRoads);
	} //end for
	
	fs.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4c8, %rsp            # imm = 0x4C8
movq %rsi, %r14
movq %rdi, -0x40(%rbp)
leaq -0x110(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0xf0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0xd0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x230(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x210(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x130(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x1f0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x1d0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x4e8(%rbp), %rdi
callq 0x2260
movq (%r14), %rsi
leaq -0x4e8(%rbp), %rdi
movl $0x8, %edx
callq 0x2140
leaq -0x470(%rbp), %rdi
callq 0x20a0
testb %al, %al
je 0x46b6
leaq -0x4e8(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x22a0
leaq -0x100(%rbp), %rsi
movq %rax, %rdi
callq 0x22a0
leaq -0xe0(%rbp), %rsi
movq %rax, %rdi
callq 0x22a0
leaq -0x44(%rbp), %rsi
movq %rax, %rdi
callq 0x2130
leaq -0x30(%rbp), %rsi
movq %rax, %rdi
callq 0x2130
leaq 0xb05b(%rip), %rsi      # 0xf13e
leaq -0x120(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
jne 0x46d5
leaq 0xb057(%rip), %rsi      # 0xf155
leaq -0x100(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
jne 0x46de
leaq 0xb055(%rip), %rsi      # 0xf16e
leaq -0xe0(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
jne 0x46e7
movl -0x30(%rbp), %esi
addl $0xa, %esi
movq -0x40(%rbp), %rdi
callq 0x2faa
movl -0x44(%rbp), %esi
movq 0x10e8a(%rip), %rdi     # 0x14fd0
callq 0x2370
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
movl -0x30(%rbp), %esi
movq %rax, %rdi
callq 0x2370
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
cmpl $0x0, -0x44(%rbp)
je 0x427c
leaq -0x150(%rbp), %rbx
xorl %r12d, %r12d
leaq -0x140(%rbp), %r15
leaq -0xb8(%rbp), %r13
leaq -0x1c0(%rbp), %r14
leaq -0x4e8(%rbp), %rdi
movq %r15, %rsi
callq 0x22a0
movq %rax, %rdi
leaq -0xc0(%rbp), %rsi
callq 0x2160
movq %rax, %rdi
movq %r13, %rsi
callq 0x2160
movq -0x40(%rbp), %rcx
movl 0x60(%rcx), %edx
movl %edx, -0x2c(%rbp)
leal 0x1(%rdx), %eax
movl %eax, 0x60(%rcx)
movq %r14, %rdi
movq %r15, %rsi
callq 0x7aa4
movsd -0xc0(%rbp), %xmm0
movq %r14, %rdi
callq 0x7c24
movsd -0xb8(%rbp), %xmm0
movq %r14, %rdi
callq 0x7c18
movq -0x40(%rbp), %rdi
movq %r14, %rsi
callq 0x5f20
movq -0x160(%rbp), %rdi
cmpq %rbx, %rdi
je 0x4254
callq 0x21f0
movq -0x1c0(%rbp), %rdi
leaq -0x1b0(%rbp), %rax
cmpq %rax, %rdi
je 0x426c
callq 0x21f0
incq %r12
movslq -0x44(%rbp), %rax
cmpq %rax, %r12
jne 0x41d3
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
cmpl $0x0, -0x30(%rbp)
je 0x45ba
leaq -0x2d0(%rbp), %r12
xorl %r13d, %r13d
movq %r12, %rbx
leaq -0x4e8(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x2130
movq %rax, %rdi
leaq -0x34(%rbp), %rsi
callq 0x2130
movq %rax, %rdi
leaq -0x68(%rbp), %rsi
callq 0x22a0
movslq -0x2c(%rbp), %r15
movq -0x40(%rbp), %rax
movq (%rax), %r14
shlq $0x7, %r15
leaq -0x1b0(%rbp), %r12
movq %r12, -0x1c0(%rbp)
movq (%r14,%r15), %rsi
movq 0x8(%r14,%r15), %rdx
addq %rsi, %rdx
leaq -0x1c0(%rbp), %rdi
callq 0x2c2e
addq %r15, %r14
movups 0x20(%r14), %xmm0
movups 0x30(%r14), %xmm1
movups 0x40(%r14), %xmm2
movups 0x50(%r14), %xmm3
movups %xmm3, 0x40(%r12)
movups %xmm2, 0x30(%r12)
movups %xmm1, 0x20(%r12)
movups %xmm0, 0x10(%r12)
leaq -0x150(%rbp), %rax
movq %rax, -0x160(%rbp)
movq 0x60(%r14), %rsi
movq 0x68(%r14), %rdx
addq %rsi, %rdx
leaq -0x160(%rbp), %rdi
callq 0x2c2e
movslq -0x34(%rbp), %r15
movq -0x40(%rbp), %rax
movq (%rax), %r14
shlq $0x7, %r15
movq %rbx, %r12
movq %rbx, -0x2e0(%rbp)
movq (%r14,%r15), %rsi
movq 0x8(%r14,%r15), %rdx
addq %rsi, %rdx
leaq -0x2e0(%rbp), %rdi
callq 0x2c2e
addq %r15, %r14
movups 0x20(%r14), %xmm0
movups 0x30(%r14), %xmm1
movups 0x40(%r14), %xmm2
movups 0x50(%r14), %xmm3
movups %xmm3, 0x40(%r12)
movups %xmm2, 0x30(%r12)
movups %xmm1, 0x20(%r12)
movups %xmm0, 0x10(%r12)
leaq -0x270(%rbp), %rax
movq %rax, -0x280(%rbp)
movq 0x60(%r14), %rsi
movq 0x68(%r14), %rdx
addq %rsi, %rdx
leaq -0x280(%rbp), %rdi
callq 0x2c2e
leaq -0x1c0(%rbp), %rdi
leaq -0x2e0(%rbp), %rsi
callq 0x489b
movl -0x2c(%rbp), %esi
movl -0x34(%rbp), %edx
leaq -0x260(%rbp), %rdi
movsd %xmm0, -0x70(%rbp)
callq 0x7ca4
movl -0x34(%rbp), %esi
movl -0x2c(%rbp), %edx
leaq -0x250(%rbp), %rdi
movsd -0x70(%rbp), %xmm0
callq 0x7ca4
movq -0x40(%rbp), %rbx
leaq -0x1c0(%rbp), %rdi
callq 0x7c44
cltq
leaq (%rax,%rax,2), %rdi
shlq $0x4, %rdi
addq 0x18(%rbx), %rdi
leaq -0x2e0(%rbp), %rsi
callq 0x71ba
leaq -0x2e0(%rbp), %rdi
callq 0x7c44
cltq
leaq (%rax,%rax,2), %rdi
shlq $0x4, %rdi
addq 0x18(%rbx), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x71ba
movq %rbx, %rdi
leaq -0x1c0(%rbp), %rsi
leaq -0x260(%rbp), %rdx
callq 0x4a6c
movq %rbx, %rdi
leaq -0x2e0(%rbp), %rsi
leaq -0x250(%rbp), %rdx
callq 0x4a6c
movslq -0x2c(%rbp), %r15
movq (%rbx), %r14
leaq -0xa0(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
leaq -0xb0(%rbp), %rdi
callq 0x2c2e
shlq $0x7, %r15
addq %r15, %r14
movq %rbx, %rdi
movq %r14, %rsi
leaq -0xb0(%rbp), %rdx
callq 0x4abe
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x44f6
callq 0x21f0
movslq -0x34(%rbp), %r15
movq -0x40(%rbp), %rbx
movq (%rbx), %r14
leaq -0x80(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %rdi
callq 0x2c2e
shlq $0x7, %r15
addq %r15, %r14
movq %rbx, %rdi
movq %r14, %rsi
leaq -0x90(%rbp), %rdx
callq 0x4abe
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
leaq -0x1b0(%rbp), %r14
je 0x4558
callq 0x21f0
movq -0x280(%rbp), %rdi
leaq -0x270(%rbp), %rax
cmpq %rax, %rdi
je 0x4570
callq 0x21f0
movq -0x2e0(%rbp), %rdi
cmpq %r12, %rdi
je 0x4581
callq 0x21f0
movq -0x160(%rbp), %rdi
leaq -0x150(%rbp), %rax
cmpq %rax, %rdi
je 0x4599
callq 0x21f0
movq -0x1c0(%rbp), %rdi
cmpq %r14, %rdi
je 0x45aa
callq 0x21f0
incq %r13
movslq -0x30(%rbp), %rax
cmpq %rax, %r13
jne 0x42a3
leaq -0x4e8(%rbp), %rdi
callq 0x2080
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x45d8
callq 0x21f0
leaq -0x4e8(%rbp), %rdi
callq 0x20b0
movq -0x1e0(%rbp), %rdi
leaq -0x1d0(%rbp), %rax
cmpq %rax, %rdi
je 0x45fc
callq 0x21f0
movq -0x200(%rbp), %rdi
leaq -0x1f0(%rbp), %rax
cmpq %rax, %rdi
je 0x4614
callq 0x21f0
movq -0x140(%rbp), %rdi
leaq -0x130(%rbp), %rax
cmpq %rax, %rdi
je 0x462c
callq 0x21f0
movq -0x220(%rbp), %rdi
leaq -0x210(%rbp), %rax
cmpq %rax, %rdi
je 0x4644
callq 0x21f0
movq -0x240(%rbp), %rdi
leaq -0x230(%rbp), %rax
cmpq %rax, %rdi
je 0x465c
callq 0x21f0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x4674
callq 0x21f0
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x468c
callq 0x21f0
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x46a4
callq 0x21f0
addq $0x4c8, %rsp            # imm = 0x4C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa9f3(%rip), %rdi      # 0xf0b0
leaq 0xa9f9(%rip), %rsi      # 0xf0bd
leaq 0xaa4e(%rip), %rcx      # 0xf119
movl $0xa7, %edx
callq 0x2150
leaq 0xaa66(%rip), %rdi      # 0xf142
jmp 0x46ee
leaq 0xaa74(%rip), %rdi      # 0xf159
jmp 0x46ee
leaq 0xaa87(%rip), %rdi      # 0xf175
leaq 0xa9c8(%rip), %rsi      # 0xf0bd
leaq 0xaa1d(%rip), %rcx      # 0xf119
movl $0xad, %edx
callq 0x2150
jmp 0x477f
movq %rax, %rbx
jmp 0x47d3
jmp 0x4784
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
jmp 0x4733
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x479d
callq 0x21f0
jmp 0x479d
jmp 0x477f
movq %rax, %rbx
movq -0x1c0(%rbp), %rdi
leaq -0x1b0(%rbp), %rax
cmpq %rax, %rdi
je 0x47b5
callq 0x21f0
jmp 0x47b5
movq %rax, %rbx
jmp 0x47a9
movq %rax, %rbx
movq -0x2e0(%rbp), %rdi
cmpq %r12, %rdi
je 0x47a9
callq 0x21f0
jmp 0x47a9
jmp 0x479a
jmp 0x479a
jmp 0x4784
movq %rax, %rbx
jmp 0x47b5
movq %rax, %rbx
jmp 0x47c7
movq %rax, %rbx
leaq -0x1c0(%rbp), %rdi
callq 0x2bc0
jmp 0x47c7
movq %rax, %rbx
leaq -0x2e0(%rbp), %rdi
callq 0x2bc0
leaq -0x1c0(%rbp), %rdi
callq 0x2bc0
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x47c7
callq 0x21f0
leaq -0x4e8(%rbp), %rdi
callq 0x20b0
movq -0x1e0(%rbp), %rdi
leaq -0x1d0(%rbp), %rax
cmpq %rax, %rdi
je 0x47eb
callq 0x21f0
movq -0x200(%rbp), %rdi
leaq -0x1f0(%rbp), %rax
cmpq %rax, %rdi
je 0x4803
callq 0x21f0
movq -0x140(%rbp), %rdi
leaq -0x130(%rbp), %rax
cmpq %rax, %rdi
je 0x481b
callq 0x21f0
movq -0x220(%rbp), %rdi
leaq -0x210(%rbp), %rax
cmpq %rax, %rdi
je 0x4833
callq 0x21f0
movq -0x240(%rbp), %rdi
leaq -0x230(%rbp), %rax
cmpq %rax, %rdi
je 0x484b
callq 0x21f0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x4863
callq 0x21f0
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x487b
callq 0x21f0
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x4893
callq 0x21f0
movq %rbx, %rdi
callq 0x2380