// File: rtackx[P]ComSim/graph.cpp
// Function: Graph::create_graph(std::unordered_map<unsigned int, Node*, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, Node*>>>&, std::unordered_map<unsigned int, std::set<std::pair<unsigned int, float>, comp_pair, std::allocator<std::pair<unsigned int, float>>>, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, std::set<std::pair<unsigned int, float>, comp_pair, std::allocator<std::pair<unsigned int, float>>>>>>&)
void Graph::create_graph(unordered_map<unsigned int, Node*>& map_node, unordered_map<unsigned int, set<pair<unsigned int, float>, comp_pair>>& map_neighbor)
{
	Node* node;
	unsigned int index;

	n = map_node.size();
	for(auto& e : map_neighbor)
		m += e.second.size();

	list_nodes = new Node*[n];
	
	index = 0;
	for(auto& e : map_node)
	{
		node = e.second;
		node->nb_neighbors = map_neighbor[e.first].size();
		
		node->index = index;
		if(node->main_index == -1)
			node->main_index = index;
		
		list_nodes[index] = node;
		index++;
		
		for(auto& d : map_neighbor[e.first])
			node->neighbor_weights[map_node[d.first]] = d.second;
	}
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movq %rdx, 0x90(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x98(%rsp), %rdi
callq 0x7a00
movq %rax, %rcx
movq 0x18(%rsp), %rax
movl %ecx, (%rax)
movq 0x90(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rdi
callq 0x7a10
movq %rax, 0x70(%rsp)
movq 0x78(%rsp), %rdi
callq 0x7a40
movq %rax, 0x68(%rsp)
leaq 0x70(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x7a70
testb $0x1, %al
jne 0x7563
jmp 0x759d
leaq 0x70(%rsp), %rdi
callq 0x7a90
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rdi
addq $0x8, %rdi
callq 0x7ab0
movq %rax, %rdx
movq 0x18(%rsp), %rax
movl 0x4(%rax), %ecx
addq %rdx, %rcx
movl %ecx, 0x4(%rax)
leaq 0x70(%rsp), %rdi
callq 0x7ac0
jmp 0x754e
movq 0x18(%rsp), %rax
movl (%rax), %eax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x3030
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
movl $0x0, 0x84(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rdi
callq 0x7af0
movq %rax, 0x50(%rsp)
movq 0x58(%rsp), %rdi
callq 0x7b20
movq %rax, 0x48(%rsp)
leaq 0x50(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x7b50
testb $0x1, %al
jne 0x761f
jmp 0x7784
leaq 0x50(%rsp), %rdi
callq 0x7b70
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x88(%rsp)
movq 0x90(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x7b90
movq %rax, %rdi
callq 0x7ab0
movl %eax, %ecx
movq 0x88(%rsp), %rax
movl %ecx, 0x28(%rax)
movl 0x84(%rsp), %ecx
movq 0x88(%rsp), %rax
movl %ecx, (%rax)
movq 0x88(%rsp), %rax
cmpl $-0x1, 0x4(%rax)
jne 0x7697
movl 0x84(%rsp), %ecx
movq 0x88(%rsp), %rax
movl %ecx, 0x4(%rax)
movq 0x18(%rsp), %rax
movq 0x88(%rsp), %rdx
movq 0x8(%rax), %rax
movl 0x84(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
movl 0x84(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x84(%rsp)
movq 0x90(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x7b90
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
callq 0x7bc0
movq %rax, 0x30(%rsp)
movq 0x38(%rsp), %rdi
callq 0x7bf0
movq %rax, 0x28(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x7c20
testb $0x1, %al
jne 0x770e
jmp 0x7773
leaq 0x30(%rsp), %rdi
callq 0x7c40
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movss 0x4(%rax), %xmm0
movss %xmm0, 0x14(%rsp)
movq 0x88(%rsp), %rax
addq $0x30, %rax
movq %rax, 0x8(%rsp)
movq 0x98(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x7880
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x7c60
movss 0x14(%rsp), %xmm0
movss %xmm0, (%rax)
leaq 0x30(%rsp), %rdi
callq 0x7c90
jmp 0x76f9
jmp 0x7775
leaq 0x50(%rsp), %rdi
callq 0x7cc0
jmp 0x7607
addq $0xa8, %rsp
retq
nopl (%rax)