// File: /workspace/github_cpp_makefile_star2_O1/flastest[P]HeterogeneousParallelDijkstra/BGL_Dijkstra.cc
// Function: relax_vertex(unsigned long, unsigned long, float, std::priority_queue<std::pair<unsigned long, float>, std::vector<std::pair<unsigned long, float>, std::allocator<std::pair<unsigned long, float>>>, Offer_Comparator>&, std::map<unsigned long, std::shared_ptr<std::mutex>, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, std::shared_ptr<std::mutex>>>>, std::map<unsigned long, float, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, float>>>&, std::map<unsigned long, std::shared_ptr<std::mutex>, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, std::shared_ptr<std::mutex>>>>&, std::map<unsigned long, unsigned long, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, unsigned long>>>&, int)
void relax_vertex(vertex_descriptor neighbor,
		   vertex_descriptor origin, 
		   float vd,
		   offer_pqueue_t& offer_pq, 
		   mutex_map_t distance_mutexes,
		   distance_map_t& distances,
		   mutex_map_t& predecessor_mutexes,
		   predecessor_map_t& predecessors,
		   int thread_id )
{
	std::lock_guard<std::mutex> guard(*distance_mutexes[neighbor]);
	//now I can play around with offers[v]
	

	// if the current offer is better than what's in distances, and better than the current offer, 
	// we can replace the old offer with the new one.
	if (vd < distances[neighbor]) 
	{
		/* The following is probbaly for that hybrid data structure
		//uh how do i get a specific offer from the priority queue???
		auto vector_offer = offer_pq[v];
		//UHHHHHHHHHHHHHHH^^^^^^^^^^^


		//if there is no current offer, than this offer is the best.
		if (!vector_offer) {
			//add offer to the pqeuue
			offer_pq.push(offer);
			
		}
		else 
		{
			//if the curresnt offer is better than the old offer, replace also
			if (vd < vector_offer) 
			{
				//this is publishOfferNoMP
				offer_pq.push(offer_t(v,vd));
			}
		}*/
		//this is publishOfferNoMP
		{
			if (DEBUG_THREAD) print_thread_debug(thread_id, "ADDING AN OFFER TO " + std::to_string(neighbor) + "!!! distnace is " + std::to_string(vd) , debug_file_stream);
			//std::lock_guard<std::mutex> guard2(pq_mutex);
			offer_pq.push(offer_t(neighbor,vd));
			if (DEBUG_THREAD) print_thread_debug(thread_id, "updating "+ std::to_string(neighbor) +"'s predecessor", debug_file_stream);
			std::lock_guard<std::mutex> guard(*predecessor_mutexes[neighbor]);
			//now update this node's predecessor 
			predecessors[neighbor] = origin;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %r9, %r15
movq %r8, %r13
movq %rdx, %r12
movss %xmm0, 0xc(%rsp)
movq %rsi, %r14
leaq 0x10(%rsp), %rsi
movq %rdi, (%rsi)
movq %rcx, %rdi
callq 0xde02
movq (%rax), %rbx
movq %rbx, %rdi
callq 0x3330
testl %eax, %eax
jne 0xb953
leaq 0x10(%rsp), %rsi
movq %r13, %rdi
callq 0xdbd2
movss (%rax), %xmm0
ucomiss 0xc(%rsp), %xmm0
jbe 0xb939
cmpb $0x1, 0xcdf4(%rip)      # 0x18248
jne 0xb722
movq 0x10(%rsp), %r13
movl $0x1, %esi
cmpq $0xa, %r13
jb 0xb4b9
movl $0x4, %esi
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
movq %r13, %rcx
cmpq $0x63, %rcx
jbe 0xb4b2
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0xb4b7
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0xb4b9
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0xb47c
addl $-0x3, %esi
jmp 0xb4b9
addl $-0x2, %esi
jmp 0xb4b9
decl %esi
movl %esi, %esi
leaq 0xa8(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x98(%rsp), %rdi
xorl %edx, %edx
callq 0x32b0
leaq 0x98(%rsp), %rbp
movq (%rbp), %rdi
movl 0x8(%rbp), %esi
movq %r13, %rdx
callq 0xe095
leaq 0x707e(%rip), %rcx      # 0x12572
movl $0x13, %r8d
movq %rbp, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3290
leaq 0x48(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb52d
movq %rdx, 0x38(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x48(%rsp)
jmp 0xb535
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq 0x38(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x702e(%rip), %rsi      # 0x12586
callq 0x3440
leaq 0x28(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb584
movq %rdx, 0x18(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x28(%rsp)
jmp 0xb58b
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x20(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
cvtss2sd 0xc(%rsp), %xmm0
movq 0xca05(%rip), %rsi      # 0x17fb8
leaq 0x726f(%rip), %rcx      # 0x12829
leaq 0x78(%rsp), %rdi
movl $0x3a, %edx
movb $0x1, %al
callq 0xe110
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %r8
movq 0x80(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %rbp, %rcx
je 0xb5f0
movq 0x28(%rsp), %rsi
cmpq %rsi, %rax
jbe 0xb615
leaq 0x88(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0xb610
movq 0x88(%rsp), %rsi
cmpq %rsi, %rax
jbe 0xb626
movq 0x78(%rsp), %rsi
leaq 0x18(%rsp), %rdi
callq 0x30c0
jmp 0xb634
leaq 0x78(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3290
leaq 0x68(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0xb658
movq %rsi, 0x58(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x68(%rsp)
jmp 0xb65e
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x60(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0xcc26(%rip), %rdx      # 0x182a8
leaq 0x58(%rsp), %rsi
movl 0x118(%rsp), %edi
callq 0xad9c
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb6ae
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3250
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb6cf
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x3250
movq 0x18(%rsp), %rdi
cmpq %rbp, %rdi
je 0xb6e6
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3250
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0xb6fd
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3250
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0xb722
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x3250
movq 0x10(%rsp), %rax
leaq 0x18(%rsp), %rsi
movq %rax, (%rsi)
movss 0xc(%rsp), %xmm0
movss %xmm0, 0x8(%rsi)
movq %r12, %rdi
callq 0xde68
cmpb $0x1, 0xcaff(%rip)      # 0x18248
jne 0xb900
movq 0x10(%rsp), %r12
movl $0x1, %esi
cmpq $0xa, %r12
jb 0xb7ae
movl $0x4, %esi
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
movq %r12, %rcx
cmpq $0x63, %rcx
jbe 0xb7a7
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0xb7ac
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0xb7ae
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0xb771
addl $-0x3, %esi
jmp 0xb7ae
addl $-0x2, %esi
jmp 0xb7ae
decl %esi
movl %esi, %esi
leaq 0x48(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x38(%rsp), %rdi
xorl %edx, %edx
callq 0x32b0
leaq 0x38(%rsp), %r13
movq (%r13), %rdi
movl 0x8(%r13), %esi
movq %r12, %rdx
callq 0xe095
leaq 0x6db6(%rip), %rcx      # 0x12597
movl $0x9, %r8d
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3290
leaq 0x28(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb81b
movq %rdx, 0x18(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x28(%rsp)
jmp 0xb823
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x18(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x6d5b(%rip), %rsi      # 0x125a1
callq 0x3440
leaq 0xc8(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb87b
movq %rdx, 0xb8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xc8(%rsp)
jmp 0xb883
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq 0xb8(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xc9ff(%rip), %rdx      # 0x182a8
movl 0x118(%rsp), %edi
callq 0xad9c
movq 0xb8(%rsp), %rdi
cmpq %r13, %rdi
je 0xb8d2
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x3250
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0xb8e9
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3250
movq 0x38(%rsp), %rdi
cmpq %rbp, %rdi
je 0xb900
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3250
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0xde02
movq (%rax), %r15
movq %r15, %rdi
callq 0x3330
testl %eax, %eax
jne 0xb95a
movq 0x110(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xdd9c
movq %r14, (%rax)
movq %r15, %rdi
callq 0x31e0
movq %rbx, %rdi
callq 0x31e0
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x3180
movl %eax, %edi
callq 0x3180
movq %rax, %r14
movq 0xb8(%rsp), %rdi
cmpq %r13, %rdi
je 0xb986
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0xb986
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0xb9a2
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0xb9a2
movq %rax, %r14
movq 0x38(%rsp), %rdi
cmpq %rbp, %rdi
je 0xba7d
movq 0x48(%rsp), %rsi
jmp 0xba5d
movq %rax, %r14
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb9e2
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0xb9e2
jmp 0xba7a
movq %rax, %r14
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xba08
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0xba08
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %rbp, %rdi
je 0xba24
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0xba24
movq %rax, %r14
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0xba40
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0xba40
movq %rax, %r14
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0xba7d
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0xba7d
jmp 0xba7a
movq %rax, %r14
movq %r15, %rdi
callq 0x31e0
jmp 0xba7d
jmp 0xba7a
jmp 0xba7a
movq %rax, %r14
movq %rbx, %rdi
callq 0x31e0
movq %r14, %rdi
callq 0x3400