// File: flastest[P]HeterogeneousParallelDijkstra/BGL_Dijkstra.cc
// Function: parallel_dijkstra_thread(std::vector<bool, std::allocator<bool>>&, int, 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, 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, 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>>>&, boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, boost::property<boost::edge_weight_t, int, boost::no_property>, boost::no_property, boost::listS> const&)
void parallel_dijkstra_thread(vector<bool>& done,
					int thread_id,
					offer_pqueue_t& offer_pq,
					distance_map_t& distances,
					mutex_map_t& distance_mutexes,
					mutex_map_t& predecessor_mutexes,
					predecessor_map_t& predecessors,
					const graph_t& graph)
{
	if (DEBUG_THREAD) print_thread_debug(thread_id, "starting thread", debug_file_stream);
	if (DEBUG) std::cout<<"starting a thread" <<std::endl;
	const auto weight = get(edge_weight, graph);
	if (DEBUG) std::cout<< "is thread done? it shouldn't be. This should be true " <<!done[thread_id]<<std::endl;
	while(!done[thread_id])
	{
		if (DEBUG_THREAD) 
		{
			print_thread_debug(thread_id, "this thread isn't done yet", debug_file_stream);
			std::string debug = offer_pq.empty() ? "offer_pq is empty" : "offer_pq isn't empty";
			print_thread_debug(thread_id, debug, debug_file_stream); 
		}
		if (DEBUG) std::cout <<"this thread isn't done yet" <<std::endl;
		if (DEBUG) std::cout <<"is the offer_pq empty? 1 for yes, 0 for no: " <<offer_pq.empty()<<std::endl;
		


		if(!offer_pq.empty())
		{
			if (DEBUG_THREAD) 
			{

				print_thread_debug(thread_id, "offer_pq isn't empty", debug_file_stream);
				print_thread_debug(thread_id, std::to_string(offer_pq.size())+" amount of offers in offer pqueue", debug_file_stream);
			}
			if(DEBUG) std::cout<<"the offer pq isn't empty."<<std::endl;

			bool offer_found = false;

			offer_t offer;
			{
				print_thread_debug(thread_id, "locking offer", debug_file_stream);
				if (DEBUG) std::cout<<"locking offer"<<std::endl;
				//std::lock_guard<std::mutex> guard(pq_mutex);
				if(!offer_pq.empty())
				{
					offer = offer_pq.top();
					offer_pq.pop();
					if (DEBUG_THREAD) print_thread_debug(thread_id, std::to_string(offer_pq.size())+" amount of offers in offer pqueue", debug_file_stream);
					if (DEBUG_THREAD) print_thread_debug(thread_id, "offer is locked. its node is "+std::to_string(offer.first)+" and its dist is " +std::to_string(offer.second), debug_file_stream);
					offer_found = true;
				}
				print_thread_debug(thread_id, "unlocking offer", debug_file_stream);
			}	


			if (offer_found)
			{
				if (DEBUG) std::cout<< "we've obtained offer"<<std::endl; 
				const auto vertex = offer.first;
				const auto offer_distance = offer.second;
				bool explore = false;

				if (DEBUG) std::cout<<"offer distance is "<<offer_distance<<std::endl;
				{
					std::lock_guard<std::mutex> guard(*distance_mutexes[vertex]);
					if (DEBUG_THREAD) print_thread_debug(thread_id, "offer distance is " +std::to_string(offer_distance) + " and the already done distance is " + std::to_string(distances[vertex]), debug_file_stream);
					if(DEBUG) std::cout<<"offer distance is "<<offer_distance <<" and distances[vertex] is "<<distances[vertex] <<std::endl;
					if(offer_distance < distances[vertex])
					{
						if (DEBUG) std::cout <<"updating distances of " <<vertex<< " to offer_distance" <<std::endl;
						if (DEBUG_THREAD) print_thread_debug(thread_id, "updating distance of " + std::to_string(vertex) + " to offer distance", debug_file_stream);
						distances[vertex] = offer_distance;
						explore = true;
					}
				}


				if (explore) 
				{

					auto [start, finish] = out_edges(vertex,graph);

					for(;start != finish; start++)
					{

						vertex_descriptor neighbor = target(*start, graph);

						float weight_of_edge = get(weight, *start);

						float vd = offer_distance + weight_of_edge;

						{
						}

						relax_vertex(neighbor, 
							vertex,
						   	vd,  
			   				offer_pq,
			   				distance_mutexes, 
			   				distances,
			   				predecessor_mutexes,
							predecessors,
			   				thread_id );
					}
				}
			}
		}
		else // priority  queue is empty
		{	

			if(DEBUG) std::cout<< "this thread is done!" <<std::endl;
			{
				std::lock_guard<std::mutex> guard(done_mutex);
				done[thread_id] = true;
			}

			//const struct timespec NANOSEC = { 0, 1 };
			//nanosleep(&NANOSEC, NULL);
			if (DEBUG_THREAD) print_thread_debug(thread_id, "this thread is done!", debug_file_stream);


			if (DEBUG)
			{
				std::cout << "length of done is "<<done.size()<<std::endl;
				std::cout << "done[0] is "<<done[0]<<std::endl;
				std::cout <<"thread id is" <<thread_id<<std::endl;
			}

			int i = 0;
			//make sure all the other threads are done too
			while(done[i] && i < done.size()) 
			{
				i++;
			}
			if(i == done.size())
			{
				return;
			} //still need to take care of this livelock TO DO TODO 
			done[thread_id] = false;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x6a0, %rsp            # imm = 0x6A0
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
testb $0x1, 0x227df(%rip)     # 0x3e310
je 0x1bbc6
movl -0xc(%rbp), %eax
movl %eax, -0x4fc(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0x4f8(%rbp)
callq 0x4530
movq -0x4f8(%rbp), %rdx
leaq 0xeddf(%rip), %rsi      # 0x2a93d
leaq -0x50(%rbp), %rdi
callq 0xb800
jmp 0x1bb69
movl -0x4fc(%rbp), %edi
leaq 0x227fa(%rip), %rdx     # 0x3e370
leaq -0x50(%rbp), %rsi
callq 0x1ab10
jmp 0x1bb81
leaq -0x50(%rbp), %rdi
callq 0x41e0
leaq -0x51(%rbp), %rdi
callq 0x4390
jmp 0x1bbc6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1bbb8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x41e0
leaq -0x51(%rbp), %rdi
callq 0x4390
jmp 0x1ce7a
testb $0x1, 0x22774(%rip)     # 0x3e341
je 0x1bbf1
movq 0x223f2(%rip), %rdi     # 0x3dfc8
leaq 0xed70(%rip), %rsi      # 0x2a94d
callq 0x4310
movq %rax, %rdi
movq 0x223ac(%rip), %rsi     # 0x3df98
callq 0x4370
movq 0x18(%rbp), %rsi
xorl %edi, %edi
callq 0x15570
movl %eax, -0x68(%rbp)
testb $0x1, 0x2273b(%rip)     # 0x3e341
je 0x1bc63
movq 0x223b9(%rip), %rdi     # 0x3dfc8
leaq 0xed49(%rip), %rsi      # 0x2a95f
callq 0x4310
movq %rax, -0x508(%rbp)
movq -0x8(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x1e310
movq %rax, -0x78(%rbp)
movq %rdx, -0x70(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x1e370
movq -0x508(%rbp), %rdi
xorb $-0x1, %al
movzbl %al, %esi
andl $0x1, %esi
callq 0x4540
movq %rax, %rdi
movq 0x2233a(%rip), %rsi     # 0x3df98
callq 0x4370
jmp 0x1bc65
movq -0x8(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x1e310
movq %rax, -0x88(%rbp)
movq %rdx, -0x80(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x1e370
xorb $-0x1, %al
testb $0x1, %al
jne 0x1bc94
jmp 0x1ce71
testb $0x1, 0x22675(%rip)     # 0x3e310
je 0x1be4e
movl -0xc(%rbp), %eax
movl %eax, -0x514(%rbp)
leaq -0xa9(%rbp), %rdi
movq %rdi, -0x510(%rbp)
callq 0x4530
movq -0x510(%rbp), %rdx
leaq 0xecca(%rip), %rsi      # 0x2a995
leaq -0xa8(%rbp), %rdi
callq 0xb800
jmp 0x1bcd9
movl -0x514(%rbp), %edi
leaq 0x2268a(%rip), %rdx     # 0x3e370
leaq -0xa8(%rbp), %rsi
callq 0x1ab10
jmp 0x1bcf4
leaq -0xa8(%rbp), %rdi
callq 0x41e0
leaq -0xa9(%rbp), %rdi
callq 0x4390
movq -0x18(%rbp), %rdi
callq 0x1e3a0
movb %al, %dl
leaq 0xec92(%rip), %rcx      # 0x2a9b0
leaq 0xec9d(%rip), %rax      # 0x2a9c2
testb %dl, %dl
cmovneq %rcx, %rax
movq %rax, -0x528(%rbp)
leaq -0xd1(%rbp), %rdi
movq %rdi, -0x520(%rbp)
callq 0x4530
movq -0x528(%rbp), %rsi
movq -0x520(%rbp), %rdx
leaq -0xd0(%rbp), %rdi
callq 0xb800
jmp 0x1bd61
leaq -0xd1(%rbp), %rdi
callq 0x4390
movl -0xc(%rbp), %eax
movl %eax, -0x52c(%rbp)
leaq -0xf8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x4150
jmp 0x1bd8b
movl -0x52c(%rbp), %edi
leaq 0x225d8(%rip), %rdx     # 0x3e370
leaq -0xf8(%rbp), %rsi
callq 0x1ab10
jmp 0x1bda6
leaq -0xf8(%rbp), %rdi
callq 0x41e0
leaq -0xd0(%rbp), %rdi
callq 0x41e0
jmp 0x1be4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1bde9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x41e0
leaq -0xa9(%rbp), %rdi
callq 0x4390
jmp 0x1ce7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xd1(%rbp), %rdi
callq 0x4390
jmp 0x1ce7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1be3d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x41e0
leaq -0xd0(%rbp), %rdi
callq 0x41e0
jmp 0x1ce7a
testb $0x1, 0x224ec(%rip)     # 0x3e341
je 0x1be79
movq 0x2216a(%rip), %rdi     # 0x3dfc8
leaq 0xeb30(%rip), %rsi      # 0x2a995
callq 0x4310
movq %rax, %rdi
movq 0x22124(%rip), %rsi     # 0x3df98
callq 0x4370
testb $0x1, 0x224c1(%rip)     # 0x3e341
je 0x1bec6
movq 0x2213f(%rip), %rdi     # 0x3dfc8
leaq 0xeb47(%rip), %rsi      # 0x2a9d7
callq 0x4310
movq %rax, -0x538(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1e3a0
movq -0x538(%rbp), %rdi
movzbl %al, %esi
andl $0x1, %esi
callq 0x4540
movq %rax, %rdi
movq 0x220d7(%rip), %rsi     # 0x3df98
callq 0x4370
movq -0x18(%rbp), %rdi
callq 0x1e3a0
testb $0x1, %al
jne 0x1cb4a
testb $0x1, 0x22432(%rip)     # 0x3e310
je 0x1c036
movl -0xc(%rbp), %eax
movl %eax, -0x544(%rbp)
leaq -0x119(%rbp), %rdi
movq %rdi, -0x540(%rbp)
callq 0x4530
movq -0x540(%rbp), %rdx
leaq 0xeab4(%rip), %rsi      # 0x2a9c2
leaq -0x118(%rbp), %rdi
callq 0xb800
jmp 0x1bf1c
movl -0x544(%rbp), %edi
leaq 0x22447(%rip), %rdx     # 0x3e370
leaq -0x118(%rbp), %rsi
callq 0x1ab10
jmp 0x1bf37
leaq -0x118(%rbp), %rdi
callq 0x41e0
leaq -0x119(%rbp), %rdi
callq 0x4390
movl -0xc(%rbp), %eax
movl %eax, -0x554(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1e3c0
movq %rax, %rsi
leaq -0x160(%rbp), %rdi
movq %rdi, -0x550(%rbp)
callq 0x1e0c0
movq -0x550(%rbp), %rsi
leaq 0xea7f(%rip), %rdx      # 0x2aa04
leaq -0x140(%rbp), %rdi
callq 0xaa10
jmp 0x1bf93
movl -0x554(%rbp), %edi
leaq 0x223d0(%rip), %rdx     # 0x3e370
leaq -0x140(%rbp), %rsi
callq 0x1ab10
jmp 0x1bfae
leaq -0x140(%rbp), %rdi
callq 0x41e0
leaq -0x160(%rbp), %rdi
callq 0x41e0
jmp 0x1c036
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1bfee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x41e0
leaq -0x119(%rbp), %rdi
callq 0x4390
jmp 0x1ce7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1c025
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x41e0
leaq -0x160(%rbp), %rdi
callq 0x41e0
jmp 0x1ce7a
testb $0x1, 0x22304(%rip)     # 0x3e341
je 0x1c061
movq 0x21f82(%rip), %rdi     # 0x3dfc8
leaq 0xe9d9(%rip), %rsi      # 0x2aa26
callq 0x4310
movq %rax, %rdi
movq 0x21f3c(%rip), %rsi     # 0x3df98
callq 0x4370
movb $0x0, -0x161(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x1e3e0
movl -0xc(%rbp), %eax
movl %eax, -0x564(%rbp)
leaq -0x199(%rbp), %rdi
movq %rdi, -0x560(%rbp)
callq 0x4530
movq -0x560(%rbp), %rdx
leaq 0xe9d4(%rip), %rsi      # 0x2aa72
leaq -0x198(%rbp), %rdi
callq 0xb800
jmp 0x1c0ac
movl -0x564(%rbp), %edi
leaq 0x222b7(%rip), %rdx     # 0x3e370
leaq -0x198(%rbp), %rsi
callq 0x1ab10
jmp 0x1c0c7
leaq -0x198(%rbp), %rdi
callq 0x41e0
leaq -0x199(%rbp), %rdi
callq 0x4390
testb $0x1, 0x2225b(%rip)     # 0x3e341
je 0x1c143
movq 0x21ed9(%rip), %rdi     # 0x3dfc8
leaq 0xe97c(%rip), %rsi      # 0x2aa72
callq 0x4310
movq %rax, %rdi
movq 0x21e93(%rip), %rsi     # 0x3df98
callq 0x4370
jmp 0x1c143
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1c132
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x41e0
leaq -0x199(%rbp), %rdi
callq 0x4390
jmp 0x1ce7a
movq -0x18(%rbp), %rdi
callq 0x1e3a0
testb $0x1, %al
jne 0x1c3b4
movq -0x18(%rbp), %rdi
callq 0x1e400
movq %rax, %rsi
leaq -0x178(%rbp), %rdi
callq 0x1e420
movq -0x18(%rbp), %rdi
callq 0x1e450
testb $0x1, 0x22194(%rip)     # 0x3e310
je 0x1c232
movl -0xc(%rbp), %eax
movl %eax, -0x574(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1e3c0
movq %rax, %rsi
leaq -0x1e0(%rbp), %rdi
movq %rdi, -0x570(%rbp)
callq 0x1e0c0
movq -0x570(%rbp), %rsi
leaq 0xe84c(%rip), %rdx      # 0x2aa04
leaq -0x1c0(%rbp), %rdi
callq 0xaa10
jmp 0x1c1c6
movl -0x574(%rbp), %edi
leaq 0x2219d(%rip), %rdx     # 0x3e370
leaq -0x1c0(%rbp), %rsi
callq 0x1ab10
jmp 0x1c1e1
leaq -0x1c0(%rbp), %rdi
callq 0x41e0
leaq -0x1e0(%rbp), %rdi
callq 0x41e0
jmp 0x1c232
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1c221
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0x41e0
leaq -0x1e0(%rbp), %rdi
callq 0x41e0
jmp 0x1ce7a
testb $0x1, 0x220d7(%rip)     # 0x3e310
je 0x1c3ad
movl -0xc(%rbp), %eax
movl %eax, -0x584(%rbp)
movq -0x178(%rbp), %rsi
leaq -0x260(%rbp), %rdi
movq %rdi, -0x580(%rbp)
callq 0x1e0c0
movq -0x580(%rbp), %rdx
leaq 0xe7d0(%rip), %rsi      # 0x2aa40
leaq -0x240(%rbp), %rdi
callq 0x1e070
jmp 0x1c27e
leaq 0xe7d9(%rip), %rdx      # 0x2aa5e
leaq -0x220(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0xaa10
jmp 0x1c29a
movss -0x170(%rbp), %xmm0
leaq -0x280(%rbp), %rdi
callq 0x1e1a0
jmp 0x1c2b0
leaq -0x200(%rbp), %rdi
leaq -0x220(%rbp), %rsi
leaq -0x280(%rbp), %rdx
callq 0xaa60
jmp 0x1c2cc
movl -0x584(%rbp), %edi
leaq 0x22097(%rip), %rdx     # 0x3e370
leaq -0x200(%rbp), %rsi
callq 0x1ab10
jmp 0x1c2e7
leaq -0x200(%rbp), %rdi
callq 0x41e0
leaq -0x280(%rbp), %rdi
callq 0x41e0
leaq -0x220(%rbp), %rdi
callq 0x41e0
leaq -0x240(%rbp), %rdi
callq 0x41e0
leaq -0x260(%rbp), %rdi
callq 0x41e0
jmp 0x1c3ad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1c39c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1c390
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1c384
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1c378
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x41e0
leaq -0x280(%rbp), %rdi
callq 0x41e0
leaq -0x220(%rbp), %rdi
callq 0x41e0
leaq -0x240(%rbp), %rdi
callq 0x41e0
leaq -0x260(%rbp), %rdi
callq 0x41e0
jmp 0x1ce7a
movb $0x1, -0x161(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x594(%rbp)
leaq -0x2a1(%rbp), %rdi
movq %rdi, -0x590(%rbp)
callq 0x4530
movq -0x590(%rbp), %rdx
leaq 0xe692(%rip), %rsi      # 0x2aa70
leaq -0x2a0(%rbp), %rdi
callq 0xb800
jmp 0x1c3ec
movl -0x594(%rbp), %edi
leaq 0x21f77(%rip), %rdx     # 0x3e370
leaq -0x2a0(%rbp), %rsi
callq 0x1ab10
jmp 0x1c407
leaq -0x2a0(%rbp), %rdi
callq 0x41e0
leaq -0x2a1(%rbp), %rdi
callq 0x4390
testb $0x1, -0x161(%rbp)
je 0x1cb45
testb $0x1, 0x21f0e(%rip)     # 0x3e341
je 0x1c490
movq 0x21b8c(%rip), %rdi     # 0x3dfc8
leaq 0xe63d(%rip), %rsi      # 0x2aa80
callq 0x4310
movq %rax, %rdi
movq 0x21b46(%rip), %rsi     # 0x3df98
callq 0x4370
jmp 0x1c490
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1c47f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x41e0
leaq -0x2a1(%rbp), %rdi
callq 0x4390
jmp 0x1ce7a
movq -0x178(%rbp), %rax
movq %rax, -0x2b0(%rbp)
movss -0x170(%rbp), %xmm0
movss %xmm0, -0x2b4(%rbp)
movb $0x0, -0x2b5(%rbp)
testb $0x1, 0x21e85(%rip)     # 0x3e341
je 0x1c4f0
movq 0x21b03(%rip), %rdi     # 0x3dfc8
leaq 0xe5c9(%rip), %rsi      # 0x2aa95
callq 0x4310
movq %rax, %rdi
movss -0x2b4(%rbp), %xmm0
callq 0x4280
movq %rax, %rdi
movq 0x21aad(%rip), %rsi     # 0x3df98
callq 0x4370
movq -0x28(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x1df60
movq %rax, %rdi
callq 0x1e040
movq %rax, %rsi
leaq -0x2c0(%rbp), %rdi
callq 0x1d9a0
testb $0x1, 0x21df2(%rip)     # 0x3e310
je 0x1c6bb
movl -0xc(%rbp), %eax
movl %eax, -0x598(%rbp)
movss -0x2b4(%rbp), %xmm0
leaq -0x340(%rbp), %rdi
callq 0x1e1a0
jmp 0x1c543
leaq 0xe54b(%rip), %rsi      # 0x2aa95
leaq -0x320(%rbp), %rdi
leaq -0x340(%rbp), %rdx
callq 0x1e070
jmp 0x1c55f
leaq 0xe542(%rip), %rdx      # 0x2aaa8
leaq -0x300(%rbp), %rdi
leaq -0x320(%rbp), %rsi
callq 0xaa10
jmp 0x1c57b
movq -0x20(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x1da20
movq %rax, -0x5a0(%rbp)
jmp 0x1c594
movq -0x5a0(%rbp), %rax
movss (%rax), %xmm0
leaq -0x360(%rbp), %rdi
callq 0x1e1a0
jmp 0x1c5ad
leaq -0x2e0(%rbp), %rdi
leaq -0x300(%rbp), %rsi
leaq -0x360(%rbp), %rdx
callq 0xaa60
jmp 0x1c5c9
movl -0x598(%rbp), %edi
leaq 0x21d9a(%rip), %rdx     # 0x3e370
leaq -0x2e0(%rbp), %rsi
callq 0x1ab10
jmp 0x1c5e4
leaq -0x2e0(%rbp), %rdi
callq 0x41e0
leaq -0x360(%rbp), %rdi
callq 0x41e0
leaq -0x300(%rbp), %rdi
callq 0x41e0
leaq -0x320(%rbp), %rdi
callq 0x41e0
leaq -0x340(%rbp), %rdi
callq 0x41e0
jmp 0x1c6bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1cb13
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1c6aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1c69e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1c692
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1c686
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x2e0(%rbp), %rdi
callq 0x41e0
leaq -0x360(%rbp), %rdi
callq 0x41e0
leaq -0x300(%rbp), %rdi
callq 0x41e0
leaq -0x320(%rbp), %rdi
callq 0x41e0
leaq -0x340(%rbp), %rdi
callq 0x41e0
jmp 0x1cb13
testb $0x1, 0x21c7f(%rip)     # 0x3e341
je 0x1c76d
movq 0x218f9(%rip), %rdi     # 0x3dfc8
leaq 0xe3bf(%rip), %rsi      # 0x2aa95
callq 0x4310
movq %rax, -0x5a8(%rbp)
jmp 0x1c6e4
movq -0x5a8(%rbp), %rdi
movss -0x2b4(%rbp), %xmm0
callq 0x4280
movq %rax, -0x5b0(%rbp)
jmp 0x1c701
movq -0x5b0(%rbp), %rdi
leaq 0xe3bc(%rip), %rsi      # 0x2aacb
callq 0x4310
movq %rax, -0x5b8(%rbp)
jmp 0x1c71d
movq -0x20(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x1da20
movq %rax, -0x5c0(%rbp)
jmp 0x1c736
movq -0x5b8(%rbp), %rdi
movq -0x5c0(%rbp), %rax
movss (%rax), %xmm0
callq 0x4280
movq %rax, -0x5c8(%rbp)
jmp 0x1c756
movq -0x5c8(%rbp), %rdi
movq 0x21834(%rip), %rsi     # 0x3df98
callq 0x4370
jmp 0x1c76b
jmp 0x1c76d
movss -0x2b4(%rbp), %xmm0
movss %xmm0, -0x5d4(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x1da20
movq %rax, -0x5d0(%rbp)
jmp 0x1c796
movss -0x5d4(%rbp), %xmm1
movq -0x5d0(%rbp), %rax
movss (%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x1c95e
testb $0x1, 0x21b88(%rip)     # 0x3e341
je 0x1c826
movq 0x21806(%rip), %rdi     # 0x3dfc8
leaq 0xe31d(%rip), %rsi      # 0x2aae6
callq 0x4310
movq %rax, -0x5e0(%rbp)
jmp 0x1c7d7
movq -0x5e0(%rbp), %rdi
movq -0x2b0(%rbp), %rsi
callq 0x40b0
movq %rax, -0x5e8(%rbp)
jmp 0x1c7f3
movq -0x5e8(%rbp), %rdi
leaq 0xe2fc(%rip), %rsi      # 0x2aafd
callq 0x4310
movq %rax, -0x5f0(%rbp)
jmp 0x1c80f
movq -0x5f0(%rbp), %rdi
movq 0x2177b(%rip), %rsi     # 0x3df98
callq 0x4370
jmp 0x1c824
jmp 0x1c826
testb $0x1, 0x21ae3(%rip)     # 0x3e310
je 0x1c91b
movl -0xc(%rbp), %eax
movl %eax, -0x5f4(%rbp)
movq -0x2b0(%rbp), %rsi
leaq -0x3c0(%rbp), %rdi
callq 0x1e0c0
jmp 0x1c851
leaq 0xe2b8(%rip), %rsi      # 0x2ab10
leaq -0x3a0(%rbp), %rdi
leaq -0x3c0(%rbp), %rdx
callq 0x1e070
jmp 0x1c86d
leaq 0xe2b2(%rip), %rdx      # 0x2ab26
leaq -0x380(%rbp), %rdi
leaq -0x3a0(%rbp), %rsi
callq 0xaa10
jmp 0x1c889
movl -0x5f4(%rbp), %edi
leaq 0x21ada(%rip), %rdx     # 0x3e370
leaq -0x380(%rbp), %rsi
callq 0x1ab10
jmp 0x1c8a4
leaq -0x380(%rbp), %rdi
callq 0x41e0
leaq -0x3a0(%rbp), %rdi
callq 0x41e0
leaq -0x3c0(%rbp), %rdi
callq 0x41e0
jmp 0x1c91b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1c90a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1c8fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x380(%rbp), %rdi
callq 0x41e0
leaq -0x3a0(%rbp), %rdi
callq 0x41e0
leaq -0x3c0(%rbp), %rdi
callq 0x41e0
jmp 0x1cb13
movss -0x2b4(%rbp), %xmm0
movss %xmm0, -0x604(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x1da20
movq %rax, -0x600(%rbp)
jmp 0x1c944
movq -0x600(%rbp), %rax
movss -0x604(%rbp), %xmm0
movss %xmm0, (%rax)
movb $0x1, -0x2b5(%rbp)
leaq -0x2c0(%rbp), %rdi
callq 0x1d9d0
testb $0x1, -0x2b5(%rbp)
je 0x1cb43
movq -0x2b0(%rbp), %rsi
movq 0x18(%rbp), %rdx
leaq -0x3e0(%rbp), %rdi
callq 0x12390
leaq -0x3e0(%rbp), %rdi
callq 0x1dc20
movq %rax, -0x3e8(%rbp)
leaq -0x3e0(%rbp), %rdi
callq 0x1dc40
movq %rax, -0x3f0(%rbp)
movq -0x3e8(%rbp), %rdi
movq -0x3f0(%rbp), %rsi
callq 0x124b0
testb $0x1, %al
jne 0x1c9d0
jmp 0x1cb41
movq -0x3e8(%rbp), %rsi
leaq -0x410(%rbp), %rdi
movq %rdi, -0x640(%rbp)
callq 0x12510
movq -0x640(%rbp), %rdi
movq 0x18(%rbp), %rsi
callq 0x124f0
movq %rax, -0x3f8(%rbp)
movq -0x3e8(%rbp), %rsi
leaq -0x430(%rbp), %rdi
movq %rdi, -0x638(%rbp)
callq 0x12510
movq -0x638(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x13f50
cvtsi2ssl (%rax), %xmm0
movss %xmm0, -0x414(%rbp)
movss -0x2b4(%rbp), %xmm0
movss -0x414(%rbp), %xmm1
addss %xmm1, %xmm0
movss %xmm0, -0x434(%rbp)
movq -0x3f8(%rbp), %rax
movq %rax, -0x630(%rbp)
movq -0x2b0(%rbp), %rax
movq %rax, -0x628(%rbp)
movss -0x434(%rbp), %xmm0
movss %xmm0, -0x61c(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x618(%rbp)
movq -0x28(%rbp), %rsi
leaq -0x468(%rbp), %rdi
movq %rdi, -0x610(%rbp)
callq 0x1e4a0
movq -0x630(%rbp), %rdi
movq -0x628(%rbp), %rsi
movss -0x61c(%rbp), %xmm0
movq -0x618(%rbp), %rdx
movq -0x610(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x30(%rbp), %r9
movq 0x10(%rbp), %r10
movl -0xc(%rbp), %r11d
movq %rsp, %rax
movl %r11d, 0x8(%rax)
movq %r10, (%rax)
callq 0x1b520
jmp 0x1cae6
leaq -0x468(%rbp), %rdi
callq 0x1e4d0
movq -0x3e8(%rbp), %rdi
xorl %esi, %esi
callq 0x1dcd0
movq %rax, -0x478(%rbp)
movq %rdx, -0x470(%rbp)
jmp 0x1c9b4
leaq -0x2c0(%rbp), %rdi
callq 0x1d9d0
jmp 0x1ce7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x468(%rbp), %rdi
callq 0x1e4d0
jmp 0x1ce7a
jmp 0x1cb43
jmp 0x1cb45
jmp 0x1ce6c
testb $0x1, 0x217f0(%rip)     # 0x3e341
je 0x1cb75
movq 0x2146e(%rip), %rdi     # 0x3dfc8
leaq 0xdfd8(%rip), %rsi      # 0x2ab39
callq 0x4310
movq %rax, %rdi
movq 0x21428(%rip), %rsi     # 0x3df98
callq 0x4370
leaq 0x219f4(%rip), %rsi     # 0x3e570
leaq -0x480(%rbp), %rdi
callq 0x1d9a0
movq -0x8(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x1e310
movq %rdx, -0x650(%rbp)
movq %rax, -0x648(%rbp)
jmp 0x1cba5
movq -0x650(%rbp), %rax
movq -0x648(%rbp), %rcx
movq %rcx, -0x490(%rbp)
movq %rax, -0x488(%rbp)
leaq -0x490(%rbp), %rdi
movl $0x1, %esi
callq 0x1e4f0
leaq -0x480(%rbp), %rdi
callq 0x1d9d0
testb $0x1, 0x2172b(%rip)     # 0x3e310
je 0x1ccac
movl -0xc(%rbp), %eax
movl %eax, -0x65c(%rbp)
leaq -0x4b1(%rbp), %rdi
movq %rdi, -0x658(%rbp)
callq 0x4530
movq -0x658(%rbp), %rdx
leaq 0xdf24(%rip), %rsi      # 0x2ab39
leaq -0x4b0(%rbp), %rdi
callq 0xb800
jmp 0x1cc23
movl -0x65c(%rbp), %edi
leaq 0x21740(%rip), %rdx     # 0x3e370
leaq -0x4b0(%rbp), %rsi
callq 0x1ab10
jmp 0x1cc3e
leaq -0x4b0(%rbp), %rdi
callq 0x41e0
leaq -0x4b1(%rbp), %rdi
callq 0x4390
jmp 0x1ccac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x480(%rbp), %rdi
callq 0x1d9d0
jmp 0x1ce7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1cc9b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x4b0(%rbp), %rdi
callq 0x41e0
leaq -0x4b1(%rbp), %rdi
callq 0x4390
jmp 0x1ce7a
testb $0x1, 0x2168e(%rip)     # 0x3e341
je 0x1cd89
movq 0x21308(%rip), %rdi     # 0x3dfc8
leaq 0xde87(%rip), %rsi      # 0x2ab4e
callq 0x4310
movq %rax, -0x670(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1e540
movq -0x670(%rbp), %rdi
movq %rax, %rsi
callq 0x40b0
movq %rax, %rdi
movq 0x212a3(%rip), %rsi     # 0x3df98
callq 0x4370
movq 0x212c7(%rip), %rdi     # 0x3dfc8
leaq 0xde59(%rip), %rsi      # 0x2ab61
callq 0x4310
movq %rax, -0x668(%rbp)
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1e310
movq %rax, -0x4c8(%rbp)
movq %rdx, -0x4c0(%rbp)
leaq -0x4c8(%rbp), %rdi
callq 0x1e370
movq -0x668(%rbp), %rdi
movzbl %al, %esi
andl $0x1, %esi
callq 0x4540
movq %rax, %rdi
movq 0x21241(%rip), %rsi     # 0x3df98
callq 0x4370
movq 0x21265(%rip), %rdi     # 0x3dfc8
leaq 0xde03(%rip), %rsi      # 0x2ab6d
callq 0x4310
movq %rax, %rdi
movl -0xc(%rbp), %esi
callq 0x4510
movq %rax, %rdi
movq 0x21214(%rip), %rsi     # 0x3df98
callq 0x4370
movl $0x0, -0x4cc(%rbp)
movq -0x8(%rbp), %rdi
movslq -0x4cc(%rbp), %rsi
callq 0x1e310
movq %rax, -0x4e0(%rbp)
movq %rdx, -0x4d8(%rbp)
leaq -0x4e0(%rbp), %rdi
callq 0x1e370
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x671(%rbp)
jne 0x1cdce
jmp 0x1cdfb
movslq -0x4cc(%rbp), %rax
movq %rax, -0x680(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1e540
movq %rax, %rcx
movq -0x680(%rbp), %rax
cmpq %rcx, %rax
setb %al
movb %al, -0x671(%rbp)
movb -0x671(%rbp), %al
testb $0x1, %al
jne 0x1ce07
jmp 0x1ce1b
movl -0x4cc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4cc(%rbp)
jmp 0x1cd93
movslq -0x4cc(%rbp), %rax
movq %rax, -0x688(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1e540
movq %rax, %rcx
movq -0x688(%rbp), %rax
cmpq %rcx, %rax
jne 0x1ce43
jmp 0x1ce71
movq -0x8(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x1e310
movq %rax, -0x4f0(%rbp)
movq %rdx, -0x4e8(%rbp)
leaq -0x4f0(%rbp), %rdi
xorl %esi, %esi
callq 0x1e4f0
jmp 0x1bc65
addq $0x6a0, %rsp            # imm = 0x6A0
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x4520
nopw %cs:(%rax,%rax)