// File: /workspace/github_cpp_makefile_star2_O2/jkeys-ecg-nmsu[P]graph-with-search-algorithms/Graph.cpp
// Function: Graph::scan_undirected(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Graph::scan_undirected(const string & file) {
    ifstream fs;
    string line, u, v;
	int u_id, v_id, weight;	
    std::set<string> node_names;
	std::map<string, int> node_id_map;
		
	initEmpty(MAX_NODES); //reserve memory space, initialize vector set 
	
	fs.open(file.c_str());	
	assert(fs.is_open());
	
	while (!fs.eof()) {	  
		fs >> u >> v >> weight;
		
		 u = trim(u); /***/ v = trim(v); 		 
		 if(u.size() == 0 || v.size() == 0) continue; //skip blank lines (EOF)

		set<string>::iterator u_string_itr = node_names.find(u);
		 
		//check if node exists
		if(u_string_itr == node_names.end()) { //does not exist
			u_id = current_id;
			current_id++;			
			
			node_names.insert(u);
			node_id_map.insert( pair<string, int>(u, u_id)  );
			Node nodeU(u, u_id); //the source node; put it in the node_set
			m_nodes.push_back(nodeU);
		} else { //does exist, find that nodes id by looking up node name in map (node name string is key, node id is value)
			u_id = node_id_map.at(u);
		}		
		
		set<string>::iterator v_string_itr = node_names.find(v);
			
		if(v_string_itr == node_names.end()) {
			v_id = current_id;
			current_id++;			
			
			node_names.insert(v);
			node_id_map.insert( pair<string, int>(v, v_id)  );
			Node nodeV(v, v_id);
			m_nodes.push_back(nodeV);
		} 	else {
			v_id = node_id_map.at(v);
		}		
		
		Node node_u = getNode(u_id);
		Node node_v = getNode(v_id);
		Edge u_v_edge(u_id, v_id, weight);
		Edge v_u_edge(v_id, u_id, weight);
		
		m_adjList[u_id].insert(node_v);		
		m_adjList[v_id].insert(node_u);
		m_edgeList[u_id].push_front(u_v_edge);
		m_edgeList[v_id].push_front(v_u_edge);
	} //end while		
	
	fs.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3f8, %rsp            # imm = 0x3F8
movq %rsi, %r14
movq %rdi, %r12
leaq -0x420(%rbp), %rdi
callq 0x2250
leaq -0x108(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
leaq -0xa8(%rbp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
movb %cl, (%rax)
movb %cl, (%rdx)
leaq -0x88(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq -0x70(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq -0xe0(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq %r12, %rdi
movl $0x186a0, %esi          # imm = 0x186A0
callq 0x2bcc
movq (%r14), %rsi
leaq -0x420(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x2160
leaq -0x3a8(%rbp), %rdi
callq 0x2090
testb %al, %al
je 0x3604
leaq -0xb8(%rbp), %r15
leaq -0x98(%rbp), %r13
movq %r12, -0x38(%rbp)
movq -0x420(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x2, -0x400(%rbp,%rax)
jne 0x35a1
leaq -0x420(%rbp), %rdi
movq %r15, %rsi
callq 0x2290
movq %rax, %rdi
movq %r13, %rsi
callq 0x2290
movq %rax, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x2150
leaq -0x218(%rbp), %rbx
movq %rbx, %rdi
leaq 0x7d98(%rip), %rsi      # 0xb0a8
leaq -0x48(%rbp), %rdx
callq 0x20e0
leaq -0x198(%rbp), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x7570
movq %r15, %rdi
movq %r14, %rsi
callq 0x2280
movq %r14, %rdi
callq 0x2110
movq %rbx, %rdi
callq 0x2110
movq %rbx, %rdi
leaq 0x7d55(%rip), %rsi      # 0xb0a8
leaq -0x48(%rbp), %rdx
callq 0x20e0
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x7570
movq %r13, %rdi
movq %r14, %rsi
callq 0x2280
movq %r14, %rdi
callq 0x2110
movq %rbx, %rdi
callq 0x2110
cmpq $0x0, -0xb0(%rbp)
je 0x32c0
cmpq $0x0, -0x90(%rbp)
je 0x32c0
leaq -0x78(%rbp), %rdi
movq %r15, %rsi
callq 0x57c6
leaq -0x198(%rbp), %rbx
leaq -0x70(%rbp), %rcx
cmpq %rcx, %rax
je 0x33d1
leaq -0xe8(%rbp), %rdi
movq %r15, %rsi
callq 0x4e76
movl (%rax), %r15d
jmp 0x3439
movl 0x60(%r12), %eax
movq %rax, %r14
incl %eax
movl %eax, 0x60(%r12)
leaq -0x78(%rbp), %rdi
movq %r15, %rsi
callq 0x5866
movq %rbx, %rdi
movq %r15, %rsi
callq 0x22b0
movl %r14d, -0x178(%rbp)
leaq -0xe8(%rbp), %rdi
movq %rbx, %rsi
callq 0x5a80
movq %rbx, %rdi
callq 0x2110
movq %rbx, %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0x6938
movq %r14, %r15
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4e3a
movq %rbx, %rdi
callq 0x2918
leaq -0x78(%rbp), %rdi
movq %r13, %rsi
callq 0x57c6
leaq -0x70(%rbp), %rcx
cmpq %rcx, %rax
je 0x3462
leaq -0xe8(%rbp), %rdi
movq %r13, %rsi
callq 0x4e76
movl (%rax), %r12d
jmp 0x34c9
movq -0x38(%rbp), %rcx
movl 0x60(%rcx), %r12d
leal 0x1(%r12), %eax
movl %eax, 0x60(%rcx)
leaq -0x78(%rbp), %rdi
movq %r13, %rsi
callq 0x5866
movq %rbx, %rdi
movq %r13, %rsi
callq 0x22b0
movl %r12d, -0x178(%rbp)
leaq -0xe8(%rbp), %rdi
movq %rbx, %rsi
callq 0x5a80
movq %rbx, %rdi
callq 0x2110
movq %rbx, %rdi
movq %r13, %rsi
movl %r12d, %edx
callq 0x6938
movq -0x38(%rbp), %rdi
movq %rbx, %rsi
callq 0x4e3a
movq %rbx, %rdi
callq 0x2918
movq %rbx, %rdi
movslq %r15d, %rbx
movq %rbx, %rsi
shlq $0x7, %rsi
movq -0x38(%rbp), %r14
addq (%r14), %rsi
callq 0x28ba
movslq %r12d, %r13
movq %r13, %rsi
shlq $0x7, %rsi
addq (%r14), %rsi
leaq -0x218(%rbp), %r14
movq %r14, %rdi
callq 0x28ba
cvtsi2sdl -0x2c(%rbp), %xmm0
leaq -0x48(%rbp), %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x6b20
cvtsi2sdl -0x2c(%rbp), %xmm0
leaq -0xf8(%rbp), %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0x6b20
movq -0x38(%rbp), %r12
imulq $0x30, %rbx, %rdi
addq 0x18(%r12), %rdi
movq %r14, %rsi
callq 0x5f28
imulq $0x30, %r13, %rdi
addq 0x18(%r12), %rdi
leaq -0x198(%rbp), %rsi
callq 0x5f28
imulq $0x18, %rbx, %rdi
addq 0x30(%r12), %rdi
leaq -0x48(%rbp), %rsi
callq 0x4ec6
imulq $0x18, %r13, %rdi
addq 0x30(%r12), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x4ec6
movq %r14, %rdi
callq 0x2918
leaq -0x198(%rbp), %rdi
callq 0x2918
leaq -0xb8(%rbp), %r15
leaq -0x98(%rbp), %r13
jmp 0x32c0
leaq -0x420(%rbp), %rdi
callq 0x2070
leaq -0xe8(%rbp), %rdi
callq 0x5426
leaq -0x78(%rbp), %rdi
callq 0x549e
leaq -0x98(%rbp), %rdi
callq 0x2110
leaq -0xb8(%rbp), %rdi
callq 0x2110
leaq -0x118(%rbp), %rdi
callq 0x2110
leaq -0x420(%rbp), %rdi
callq 0x20a0
addq $0x3f8, %rsp            # imm = 0x3F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7a65(%rip), %rdi      # 0xb070
leaq 0x7a6b(%rip), %rsi      # 0xb07d
leaq 0x7a94(%rip), %rcx      # 0xb0ad
pushq $0x69
popq %rdx
callq 0x2170
jmp 0x367e
jmp 0x367e
jmp 0x3629
jmp 0x367e
movq %rax, %rbx
leaq -0x198(%rbp), %rdi
jmp 0x365a
jmp 0x367e
jmp 0x3641
jmp 0x3641
jmp 0x367e
jmp 0x367e
jmp 0x3661
movq %rax, %rbx
jmp 0x3670
jmp 0x3650
jmp 0x367e
jmp 0x367e
jmp 0x367e
jmp 0x367e
movq %rax, %rbx
leaq -0x218(%rbp), %rdi
callq 0x2110
jmp 0x3681
movq %rax, %rbx
leaq -0x218(%rbp), %rdi
callq 0x2918
leaq -0x198(%rbp), %rdi
callq 0x2918
jmp 0x3681
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
callq 0x5426
leaq -0x78(%rbp), %rdi
callq 0x549e
leaq -0x98(%rbp), %rdi
callq 0x2110
leaq -0xb8(%rbp), %rdi
callq 0x2110
leaq -0x118(%rbp), %rdi
callq 0x2110
leaq -0x420(%rbp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2370