// File: /workspace/github_cpp_makefile_star2_O1/rtackx[P]ComSim/projection.cpp
// Function: compute_projection_thread(void*)
void* compute_projection_thread(void* struct_args)
{
	projection_thread_args* args = static_cast<projection_thread_args*>(struct_args);

	pair<unordered_map<unsigned int, set<pair<unsigned int, float>, comp_pair>>::iterator, bool> it_map;
	unordered_map<unsigned int, set<pair<unsigned int, float>, comp_pair>> map_neighbor;

	vector<Node*> list_distance_neighbors = args->p->get_neighbors(args->index, args->distance);
	float projection_weight;

	Node* node = new Node();
	node->id = args->p->in_graph->list_nodes[args->index]->id;
	node->main_index = args->p->in_graph->list_nodes[args->index]->main_index;

	it_map = map_neighbor.emplace(args->index, set<pair<unsigned int, float>, comp_pair>());

	for(auto& node_neighbor : list_distance_neighbors)
	{
		projection_weight = args->p->similarity_projection(args->p->in_graph->list_nodes[args->index], node_neighbor);

		if(projection_weight > 0.0)
			it_map.first->second.insert(make_pair(node_neighbor->index, projection_weight));
	}

	pthread_mutex_lock(&compute_projection_mutex);
	args->map_node->emplace(make_pair(args->index, node));
	args->map_neighbor->insert(map_neighbor.begin(), map_neighbor.end());
	pthread_mutex_unlock(&compute_projection_mutex);

	pthread_exit(NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
leaq 0x80(%rsp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
movq (%rdi), %rsi
leaq 0x8(%rdi), %r15
leaq 0xc(%rdi), %rcx
leaq 0x38(%rsp), %rdi
movq %r15, %rdx
callq 0x574a
movl $0x68, %edi
callq 0x2250
movq %rax, %r14
movq %rax, %rdi
callq 0x265c
movq (%rbx), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movl 0x8(%rbx), %ecx
movq (%rax,%rcx,8), %rsi
addq $0x8, %rsi
movq %r14, %rdi
addq $0x8, %rdi
callq 0x2110
movq (%rbx), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movl 0x8(%rbx), %ecx
movq (%rax,%rcx,8), %rax
movl 0x4(%rax), %eax
movl %eax, 0x4(%r14)
leaq 0x8(%rsp), %rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x8(%rax)
movaps %xmm0, 0x18(%rax)
movaps %xmm0, -0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq $0x0, 0x20(%rax)
leaq 0x50(%rsp), %rdi
movq %rsp, %rdx
movq %r15, %rsi
callq 0x656a
movq %rax, %r15
movq %rsp, %rdi
callq 0x4414
movq 0x38(%rsp), %r12
movq 0x40(%rsp), %rbp
cmpq %rbp, %r12
je 0x569f
addq $0x10, %r15
movq %rsp, %r13
movq (%rbx), %rdi
movq (%rdi), %rax
movq 0x10(%rdi), %rcx
movl 0x8(%rbx), %esi
shlq $0x3, %rsi
addq 0x8(%rcx), %rsi
movq %r12, %rdx
callq *(%rax)
ucomiss 0x5262(%rip), %xmm0     # 0xa8dc
jbe 0x5696
movq (%r12), %rax
movl (%rax), %eax
movl %eax, (%rsp)
movss %xmm0, 0x4(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x4f70
addq $0x8, %r12
cmpq %rbp, %r12
jne 0x5659
leaq 0x9c02(%rip), %rdi      # 0xf2a8
callq 0x2340
movq 0x10(%rbx), %rdi
movl 0x8(%rbx), %eax
movq %rsp, %rsi
movl %eax, (%rsi)
movq %r14, 0x8(%rsi)
callq 0x66bc
movq 0x18(%rbx), %rbx
movq 0x60(%rsp), %r15
movq %rbx, (%rsp)
testq %r15, %r15
je 0x56ec
movq %rsp, %r14
leaq 0x8(%r15), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x677e
movq (%r15), %r15
testq %r15, %r15
jne 0x56d5
leaq 0x9bb5(%rip), %rdi      # 0xf2a8
callq 0x21b0
xorl %edi, %edi
callq 0x23e0
jmp 0x5721
jmp 0x5721
jmp 0x5721
jmp 0x5721
movq %rax, %rbx
movq %rsp, %rdi
callq 0x4414
jmp 0x5724
movq %rax, %rbx
movq %r14, %rdi
callq 0x2220
jmp 0x5724
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x5738
callq 0x2220
jmp 0x5738
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x4388
movq %rbx, %rdi
callq 0x23d0