// File: /workspace/github_cpp_makefile_star2_O3/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 0xdb94
movq (%rax), %rbx
movq %rbx, %rdi
callq 0x3330
testl %eax, %eax
jne 0xb6f6
leaq 0x10(%rsp), %rsi
movq %r13, %rdi
callq 0xd966
movss (%rax), %xmm0
ucomiss 0xc(%rsp), %xmm0
jbe 0xb6dc
cmpb $0x1, 0xd050(%rip)      # 0x18248
jne 0xb4c5
movq 0x10(%rsp), %r13
movl $0x1, %esi
cmpq $0xa, %r13
jb 0xb25d
movl $0x4, %esi
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
movq %r13, %rcx
cmpq $0x63, %rcx
jbe 0xb256
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0xb25b
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0xb25d
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0xb220
addl $-0x3, %esi
jmp 0xb25d
addl $-0x2, %esi
jmp 0xb25d
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 0xde23
leaq 0x731a(%rip), %rcx      # 0x125b2
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 0xb2d1
movq %rdx, 0x38(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x48(%rsp)
jmp 0xb2d9
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 0x72ca(%rip), %rsi      # 0x125c6
callq 0x3440
leaq 0x28(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb328
movq %rdx, 0x18(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x28(%rsp)
jmp 0xb32f
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 0xcc61(%rip), %rsi      # 0x17fb8
leaq 0x750b(%rip), %rcx      # 0x12869
leaq 0x78(%rsp), %rdi
movl $0x3a, %edx
movb $0x1, %al
callq 0xde9e
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %r8
movq 0x80(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %rbp, %rcx
je 0xb394
movq 0x28(%rsp), %rdi
movq 0x78(%rsp), %rsi
cmpq %rdi, %rax
jbe 0xb3bd
leaq 0x88(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0xb3b8
movq 0x88(%rsp), %rdi
cmpq %rdi, %rax
jbe 0xb3c9
leaq 0x18(%rsp), %rdi
callq 0x30c0
jmp 0xb3d7
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 0xb3fb
movq %rsi, 0x58(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x68(%rsp)
jmp 0xb401
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 0xce83(%rip), %rdx      # 0x182a8
leaq 0x58(%rsp), %rsi
movl 0x118(%rsp), %edi
callq 0xab40
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb451
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3250
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb472
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x3250
movq 0x18(%rsp), %rdi
cmpq %rbp, %rdi
je 0xb489
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3250
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0xb4a0
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3250
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0xb4c5
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 0xdbfa
cmpb $0x1, 0xcd5c(%rip)      # 0x18248
jne 0xb6a3
movq 0x10(%rsp), %r12
movl $0x1, %esi
cmpq $0xa, %r12
jb 0xb551
movl $0x4, %esi
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
movq %r12, %rcx
cmpq $0x63, %rcx
jbe 0xb54a
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0xb54f
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0xb551
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0xb514
addl $-0x3, %esi
jmp 0xb551
addl $-0x2, %esi
jmp 0xb551
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 0xde23
leaq 0x7053(%rip), %rcx      # 0x125d7
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 0xb5be
movq %rdx, 0x18(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x28(%rsp)
jmp 0xb5c6
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 0x6ff8(%rip), %rsi      # 0x125e1
callq 0x3440
leaq 0xc8(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb61e
movq %rdx, 0xb8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xc8(%rsp)
jmp 0xb626
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 0xcc5c(%rip), %rdx      # 0x182a8
movl 0x118(%rsp), %edi
callq 0xab40
movq 0xb8(%rsp), %rdi
cmpq %r13, %rdi
je 0xb675
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x3250
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0xb68c
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3250
movq 0x38(%rsp), %rdi
cmpq %rbp, %rdi
je 0xb6a3
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3250
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0xdb94
movq (%rax), %r15
movq %r15, %rdi
callq 0x3330
testl %eax, %eax
jne 0xb6fd
movq 0x110(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xdb2e
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 0xb729
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0xb729
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0xb745
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0xb745
movq %rax, %r14
movq 0x38(%rsp), %rdi
cmpq %rbp, %rdi
je 0xb820
movq 0x48(%rsp), %rsi
jmp 0xb800
movq %rax, %r14
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb785
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0xb785
jmp 0xb81d
movq %rax, %r14
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb7ab
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0xb7ab
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %rbp, %rdi
je 0xb7c7
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0xb7c7
movq %rax, %r14
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0xb7e3
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0xb7e3
movq %rax, %r14
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0xb820
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0xb820
jmp 0xb81d
movq %rax, %r14
movq %r15, %rdi
callq 0x31e0
jmp 0xb820
jmp 0xb81d
jmp 0xb81d
movq %rax, %r14
movq %rbx, %rdi
callq 0x31e0
movq %r14, %rdi
callq 0x3400