// File: /workspace/github_cpp_makefile_star2_O1/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 0x4678
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 0xb099(%rip), %rsi      # 0xf13e
leaq -0x120(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
jne 0x4697
leaq 0xb095(%rip), %rsi      # 0xf155
leaq -0x100(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
jne 0x46a0
leaq 0xb093(%rip), %rsi      # 0xf16e
leaq -0xe0(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
jne 0x46a9
movl -0x30(%rbp), %esi
addl $0xa, %esi
movq -0x40(%rbp), %rdi
callq 0x2f62
movl -0x44(%rbp), %esi
movq 0x10ec8(%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 0x423e
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 0x7a24
movsd -0xc0(%rbp), %xmm0
movq %r14, %rdi
callq 0x7ba4
movsd -0xb8(%rbp), %xmm0
movq %r14, %rdi
callq 0x7b98
movq -0x40(%rbp), %rdi
movq %r14, %rsi
callq 0x5ed4
movq -0x160(%rbp), %rdi
cmpq %rbx, %rdi
je 0x4216
callq 0x21f0
movq -0x1c0(%rbp), %rdi
leaq -0x1b0(%rbp), %rax
cmpq %rax, %rdi
je 0x422e
callq 0x21f0
incq %r12
movslq -0x44(%rbp), %rax
cmpq %rax, %r12
jne 0x4195
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
cmpl $0x0, -0x30(%rbp)
je 0x457c
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 0x2bfe
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 0x2bfe
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 0x2bfe
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 0x2bfe
leaq -0x1c0(%rbp), %rdi
leaq -0x2e0(%rbp), %rsi
callq 0x485d
movl -0x2c(%rbp), %esi
movl -0x34(%rbp), %edx
leaq -0x260(%rbp), %rdi
movsd %xmm0, -0x70(%rbp)
callq 0x7c24
movl -0x34(%rbp), %esi
movl -0x2c(%rbp), %edx
leaq -0x250(%rbp), %rdi
movsd -0x70(%rbp), %xmm0
callq 0x7c24
movq -0x40(%rbp), %rbx
leaq -0x1c0(%rbp), %rdi
callq 0x7bc4
cltq
leaq (%rax,%rax,2), %rdi
shlq $0x4, %rdi
addq 0x18(%rbx), %rdi
leaq -0x2e0(%rbp), %rsi
callq 0x7128
leaq -0x2e0(%rbp), %rdi
callq 0x7bc4
cltq
leaq (%rax,%rax,2), %rdi
shlq $0x4, %rdi
addq 0x18(%rbx), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x7128
movq %rbx, %rdi
leaq -0x1c0(%rbp), %rsi
leaq -0x260(%rbp), %rdx
callq 0x4a2e
movq %rbx, %rdi
leaq -0x2e0(%rbp), %rsi
leaq -0x250(%rbp), %rdx
callq 0x4a2e
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 0x2bfe
shlq $0x7, %r15
addq %r15, %r14
movq %rbx, %rdi
movq %r14, %rsi
leaq -0xb0(%rbp), %rdx
callq 0x4a80
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x44b8
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 0x2bfe
shlq $0x7, %r15
addq %r15, %r14
movq %rbx, %rdi
movq %r14, %rsi
leaq -0x90(%rbp), %rdx
callq 0x4a80
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
leaq -0x1b0(%rbp), %r14
je 0x451a
callq 0x21f0
movq -0x280(%rbp), %rdi
leaq -0x270(%rbp), %rax
cmpq %rax, %rdi
je 0x4532
callq 0x21f0
movq -0x2e0(%rbp), %rdi
cmpq %r12, %rdi
je 0x4543
callq 0x21f0
movq -0x160(%rbp), %rdi
leaq -0x150(%rbp), %rax
cmpq %rax, %rdi
je 0x455b
callq 0x21f0
movq -0x1c0(%rbp), %rdi
cmpq %r14, %rdi
je 0x456c
callq 0x21f0
incq %r13
movslq -0x30(%rbp), %rax
cmpq %rax, %r13
jne 0x4265
leaq -0x4e8(%rbp), %rdi
callq 0x2080
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x459a
callq 0x21f0
leaq -0x4e8(%rbp), %rdi
callq 0x20b0
movq -0x1e0(%rbp), %rdi
leaq -0x1d0(%rbp), %rax
cmpq %rax, %rdi
je 0x45be
callq 0x21f0
movq -0x200(%rbp), %rdi
leaq -0x1f0(%rbp), %rax
cmpq %rax, %rdi
je 0x45d6
callq 0x21f0
movq -0x140(%rbp), %rdi
leaq -0x130(%rbp), %rax
cmpq %rax, %rdi
je 0x45ee
callq 0x21f0
movq -0x220(%rbp), %rdi
leaq -0x210(%rbp), %rax
cmpq %rax, %rdi
je 0x4606
callq 0x21f0
movq -0x240(%rbp), %rdi
leaq -0x230(%rbp), %rax
cmpq %rax, %rdi
je 0x461e
callq 0x21f0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x4636
callq 0x21f0
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x464e
callq 0x21f0
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x4666
callq 0x21f0
addq $0x4c8, %rsp            # imm = 0x4C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xaa31(%rip), %rdi      # 0xf0b0
leaq 0xaa37(%rip), %rsi      # 0xf0bd
leaq 0xaa8c(%rip), %rcx      # 0xf119
movl $0xa7, %edx
callq 0x2150
leaq 0xaaa4(%rip), %rdi      # 0xf142
jmp 0x46b0
leaq 0xaab2(%rip), %rdi      # 0xf159
jmp 0x46b0
leaq 0xaac5(%rip), %rdi      # 0xf175
leaq 0xaa06(%rip), %rsi      # 0xf0bd
leaq 0xaa5b(%rip), %rcx      # 0xf119
movl $0xad, %edx
callq 0x2150
jmp 0x4741
movq %rax, %rbx
jmp 0x4795
jmp 0x4746
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
jmp 0x46f5
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x475f
callq 0x21f0
jmp 0x475f
jmp 0x4741
movq %rax, %rbx
movq -0x1c0(%rbp), %rdi
leaq -0x1b0(%rbp), %rax
cmpq %rax, %rdi
je 0x4777
callq 0x21f0
jmp 0x4777
movq %rax, %rbx
jmp 0x476b
movq %rax, %rbx
movq -0x2e0(%rbp), %rdi
cmpq %r12, %rdi
je 0x476b
callq 0x21f0
jmp 0x476b
jmp 0x475c
jmp 0x475c
jmp 0x4746
movq %rax, %rbx
jmp 0x4777
movq %rax, %rbx
jmp 0x4789
movq %rax, %rbx
leaq -0x1c0(%rbp), %rdi
callq 0x2b90
jmp 0x4789
movq %rax, %rbx
leaq -0x2e0(%rbp), %rdi
callq 0x2b90
leaq -0x1c0(%rbp), %rdi
callq 0x2b90
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x4789
callq 0x21f0
leaq -0x4e8(%rbp), %rdi
callq 0x20b0
movq -0x1e0(%rbp), %rdi
leaq -0x1d0(%rbp), %rax
cmpq %rax, %rdi
je 0x47ad
callq 0x21f0
movq -0x200(%rbp), %rdi
leaq -0x1f0(%rbp), %rax
cmpq %rax, %rdi
je 0x47c5
callq 0x21f0
movq -0x140(%rbp), %rdi
leaq -0x130(%rbp), %rax
cmpq %rax, %rdi
je 0x47dd
callq 0x21f0
movq -0x220(%rbp), %rdi
leaq -0x210(%rbp), %rax
cmpq %rax, %rdi
je 0x47f5
callq 0x21f0
movq -0x240(%rbp), %rdi
leaq -0x230(%rbp), %rax
cmpq %rax, %rdi
je 0x480d
callq 0x21f0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x4825
callq 0x21f0
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x483d
callq 0x21f0
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x4855
callq 0x21f0
movq %rbx, %rdi
callq 0x2380