// File: lrq3000[P]rfrb/./src/fileHandler.cpp
// Function: FileHandler::buildMapHeuristic(std::vector<std::vector<Block, std::allocator<Block>>, std::allocator<std::vector<Block, std::allocator<Block>>>>&, std::vector<unsigned long, std::allocator<unsigned long>>&)
std::vector<std::vector<std::pair<bool, std::vector<size_t>>>>
FileHandler::buildMapHeuristic(std::vector<std::vector<Block>> &input, std::vector<size_t> &parityDist)
{
	//Initialization
	std::vector<std::vector<std::pair<bool, std::vector<size_t>>>> ret;
	ret.resize(inFiles.size());

	size_t maxCalls = input.at(0).size();
	std::vector<std::vector<Block>::iterator> iterators;
	for (auto &in : input)
	{
		iterators.push_back(in.begin());
		maxCalls = std::min(in.size(), maxCalls);
	}
	size_t curMin = -1;
	bool interestingStart=false;
	bool interestingEnd=false;
	std::vector<size_t> pushMe;

	std::vector<std::vector<size_t>> parityDistribution;
	for (size_t i = 0; i < inFiles.size(); ++i)
	{
		std::vector<size_t> tmp;
		for (size_t j = 0; j < inFiles.size(); ++j)
		{
			tmp.push_back(0);
		}
		parityDistribution.push_back(tmp);
	}
	while (maxCalls != 0)
	{
		maxCalls--;
		curMin = -1;
		for (auto &in : iterators)
		{
			curMin = std::min(curMin, (*in).startAdress);
		}
		interestingStart = true;
		pushMe.clear();
		size_t num=0;
		for (auto &in : iterators)
		{
			if ((*in).startAdress == curMin)
			{}
			else if ((*in).startAdress == curMin+1)
			{
				pushMe.push_back(num);
			}
			else
			{
				interestingStart=false;
			}
			++num;
		}
		if (interestingStart == true && (!(pushMe.empty())))
		{
			std::pair<bool, std::vector<size_t>> entry;
			entry = std::make_pair(true, pushMe);
			size_t modOp = (curMin) % inFiles.size();
			ret.at(modOp).push_back(entry);
		}

		//If an interesting start was found
		if (interestingStart == true)
		{
			size_t sAdress = curMin;
			curMin = -1;
			for (auto &in : iterators)
				curMin = std::min(curMin, (*in).entropies.size());
			for (size_t i = 1; i < curMin; ++i)
			{
				size_t pos=0;
				size_t par=0;
				float highest=0.0f;
				size_t en = (sAdress+i)%inFiles.size();
				for (auto &in : iterators)
				{
					if ((*in).startAdress == sAdress)
					{
						if ((*in).entropies.at(i) > highest)
						{
							highest = (*in).entropies.at(i);
							par = pos;
						}
					}
					else
					{
						if ((*in).entropies.at(i-1) > highest)
						{
							highest = (*in).entropies.at(i-1);
							par = pos;
						}
					}
					++pos;
				}
				parityDistribution.at(en).at(par) = parityDistribution.at(en).at(par)+1;
			}
		}

		curMin = -1;
		for (auto &in : iterators)
		{
			curMin = std::min(curMin, (*in).endAdress);
		}
		interestingEnd = true;
		pushMe.clear();
		num=0;
		for (auto &in : iterators)
		{
			if ((*in).endAdress == curMin)
			{
				pushMe.push_back(num);
				++in;
			}
			else if ((*in).endAdress == curMin+1)
			{
				++in;
			}
			else
			{
				interestingEnd=false;
			}
			++num;
		}

		//If an interesting end was found
		if (interestingEnd == true && pushMe.size()<inFiles.size())
		{
			std::pair<bool, std::vector<size_t>> entry;
			entry = std::make_pair(false, pushMe);
			size_t modOp = (curMin) % inFiles.size();
			ret.at(modOp).push_back(entry);
		}
	}

	//Build the hashMap
	std::map<std::vector<size_t>, size_t> hashMap;
	bool schlonz = true;
	for (size_t i = 0; i < ret.size();)
	{
		hashMap.clear();
		for (size_t j = 0; j < ret.at(i).size(); ++j)
		{
			if (ret.at(i).at(j).first == schlonz)
			{
				if (hashMap.find(ret.at(i).at(j).second) == hashMap.end())
				{
					hashMap.insert(std::pair<std::vector<size_t>, size_t>(ret.at(i).at(j).second, 0));
				}
				hashMap.at(ret.at(i).at(j).second) += 1;
			}
		}
		if (hashMap.size() == 1 && hashMap.begin()->first.size() > 1)
		{
			for (size_t j = 0; j < ret.at(i).size();)
			{
				if (ret.at(i).at(j).first == schlonz)
				{
					ret.at(i).erase(ret.at(i).begin()+j);
					continue;
				}
				++j;
			}
		}
		//Kill also all unnecessary entries
		for (std::map<std::vector<size_t>, size_t>::iterator j = hashMap.begin(); j != hashMap.end();)
		{
			bool killMe = false;
			for (std::map<std::vector<size_t>, size_t>::iterator x = j; x != hashMap.end();)
			{
				if (x == j)
				{
					++x;
					continue;
				}
				if (j->first.size() == x->first.size())
				{
					if (j->second >= x->second)
					{
						if (j->second == x->second)
							killMe = true;
						for (size_t kill = 0; kill < ret.at(i).size();)
						{
							if (ret.at(i).at(kill).first == schlonz && ret.at(i).at(kill).second == x->first)
							{
								ret.at(i).erase(ret.at(i).begin()+kill);
								continue;
							}
							++kill;
						}
						x = hashMap.erase(x);
						continue;
					}
					else
					{
						killMe = true;
					}
				}
				++x;
			}
			if (killMe == true)
			{
				for (size_t kill = 0; kill < ret.at(i).size();)
				{
					if (ret.at(i).at(kill).first == schlonz && ret.at(i).at(kill).second == j->first)
					{
						ret.at(i).erase(ret.at(i).begin()+kill);
						continue;
					}
					++kill;
				}
				j = hashMap.erase(j);
				continue;
			}
			++j;
		}
		if (schlonz == true)
		{
			schlonz = false;
		}
		else
		{
			schlonz = true;
			++i;
		}
	}

	//Parity distribution is estimated
	for (size_t i = 0; i < inFiles.size(); ++i)
	{
		size_t bestFit = 0;
		size_t highestScore=0;
		for (size_t j = 0; j < inFiles.size(); ++j)
		{
			//std::cout << parityDistribution.at(i).at(j) << "\t";
			if (parityDistribution.at(i).at(j) > highestScore)
			{
				highestScore = parityDistribution.at(i).at(j);
				bestFit = j;
			}
		}
		parityDist.push_back(bestFit);
		//std::cout << std::endl;
	}
	return ret;
}

// Assembly:
subq $0x6a8, %rsp            # imm = 0x6A8
movq %rdi, 0x290(%rsp)
movq %rdi, %rax
movq %rax, 0x280(%rsp)
movq %rdi, 0x6a0(%rsp)
movq %rsi, 0x698(%rsp)
movq %rdx, 0x690(%rsp)
movq %rcx, 0x688(%rsp)
movq 0x698(%rsp), %rax
movq %rax, 0x288(%rsp)
movb $0x0, 0x687(%rsp)
callq 0x19950
movq 0x288(%rsp), %rdi
addq $0x40, %rdi
callq 0x9d50
movq 0x290(%rsp), %rdi
movq %rax, %rsi
callq 0x19960
jmp 0x103ca
movq 0x690(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x19870
movq %rax, 0x278(%rsp)
jmp 0x103e5
movq 0x278(%rsp), %rdi
callq 0x1a670
movq %rax, 0x668(%rsp)
leaq 0x650(%rsp), %rdi
callq 0x1a690
movq 0x690(%rsp), %rax
movq %rax, 0x648(%rsp)
movq 0x648(%rsp), %rdi
callq 0x1a6a0
movq %rax, 0x640(%rsp)
movq 0x648(%rsp), %rdi
callq 0x1a6d0
movq %rax, 0x638(%rsp)
leaq 0x640(%rsp), %rdi
leaq 0x638(%rsp), %rsi
callq 0x1a700
testb $0x1, %al
jne 0x1045f
jmp 0x1052b
leaq 0x640(%rsp), %rdi
callq 0x1a740
movq %rax, 0x630(%rsp)
movq 0x630(%rsp), %rdi
callq 0x1a780
movq %rax, 0x628(%rsp)
leaq 0x650(%rsp), %rdi
leaq 0x628(%rsp), %rsi
callq 0x1a750
jmp 0x104a0
movq 0x630(%rsp), %rdi
callq 0x1a670
movq %rax, 0x620(%rsp)
leaq 0x620(%rsp), %rdi
leaq 0x668(%rsp), %rsi
callq 0xbe00
movq %rax, 0x270(%rsp)
jmp 0x104d4
movq 0x270(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x668(%rsp)
leaq 0x640(%rsp), %rdi
callq 0x1a7b0
jmp 0x10441
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x678(%rsp)
movl %eax, 0x674(%rsp)
jmp 0x11f1c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x678(%rsp)
movl %eax, 0x674(%rsp)
jmp 0x11ef0
movq $-0x1, 0x618(%rsp)
movb $0x0, 0x617(%rsp)
movb $0x0, 0x616(%rsp)
leaq 0x5f8(%rsp), %rdi
callq 0x19a20
leaq 0x5e0(%rsp), %rdi
callq 0x1a7d0
movq $0x0, 0x5d8(%rsp)
movq 0x288(%rsp), %rdi
movq 0x5d8(%rsp), %rax
movq %rax, 0x268(%rsp)
addq $0x40, %rdi
callq 0x9d50
movq %rax, %rcx
movq 0x268(%rsp), %rax
cmpq %rcx, %rax
jae 0x1068a
leaq 0x5c0(%rsp), %rdi
callq 0x19a20
movq $0x0, 0x5b8(%rsp)
movq 0x288(%rsp), %rdi
movq 0x5b8(%rsp), %rax
movq %rax, 0x260(%rsp)
addq $0x40, %rdi
callq 0x9d50
movq %rax, %rcx
movq 0x260(%rsp), %rax
cmpq %rcx, %rax
jae 0x1064d
movq $0x0, 0x5b0(%rsp)
leaq 0x5c0(%rsp), %rdi
leaq 0x5b0(%rsp), %rsi
callq 0x1a7e0
jmp 0x1060f
jmp 0x10611
movq 0x5b8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x5b8(%rsp)
jmp 0x105bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x678(%rsp)
movl %eax, 0x674(%rsp)
leaq 0x5c0(%rsp), %rdi
callq 0x19cb0
jmp 0x11ed6
leaq 0x5e0(%rsp), %rdi
leaq 0x5c0(%rsp), %rsi
callq 0x1a810
jmp 0x10664
leaq 0x5c0(%rsp), %rdi
callq 0x19cb0
movq 0x5d8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x5d8(%rsp)
jmp 0x1056d
jmp 0x1068c
cmpq $0x0, 0x668(%rsp)
je 0x1112e
movq 0x668(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x668(%rsp)
movq $-0x1, 0x618(%rsp)
leaq 0x650(%rsp), %rax
movq %rax, 0x5a8(%rsp)
movq 0x5a8(%rsp), %rdi
callq 0x1a880
movq %rax, 0x5a0(%rsp)
movq 0x5a8(%rsp), %rdi
callq 0x1a8b0
movq %rax, 0x598(%rsp)
leaq 0x5a0(%rsp), %rdi
leaq 0x598(%rsp), %rsi
callq 0x1a8e0
testb $0x1, %al
jne 0x10710
jmp 0x1078b
leaq 0x5a0(%rsp), %rdi
callq 0x1a920
movq %rax, 0x590(%rsp)
movq 0x590(%rsp), %rdi
callq 0x1a930
movq %rax, %rsi
addq $0x18, %rsi
leaq 0x618(%rsp), %rdi
callq 0xbe00
movq %rax, 0x258(%rsp)
jmp 0x10750
movq 0x258(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x618(%rsp)
leaq 0x5a0(%rsp), %rdi
callq 0x1a940
jmp 0x106f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x678(%rsp)
movl %eax, 0x674(%rsp)
jmp 0x11ed6
movb $0x1, 0x617(%rsp)
leaq 0x5f8(%rsp), %rdi
callq 0x1a2c0
movq $0x0, 0x588(%rsp)
leaq 0x650(%rsp), %rax
movq %rax, 0x580(%rsp)
movq 0x580(%rsp), %rdi
callq 0x1a880
movq %rax, 0x578(%rsp)
movq 0x580(%rsp), %rdi
callq 0x1a8b0
movq %rax, 0x570(%rsp)
leaq 0x578(%rsp), %rdi
leaq 0x570(%rsp), %rsi
callq 0x1a8e0
testb $0x1, %al
jne 0x10804
jmp 0x108a1
leaq 0x578(%rsp), %rdi
callq 0x1a920
movq %rax, 0x568(%rsp)
movq 0x568(%rsp), %rdi
callq 0x1a930
movq 0x18(%rax), %rax
cmpq 0x618(%rsp), %rax
jne 0x10836
jmp 0x1087b
movq 0x568(%rsp), %rdi
callq 0x1a930
movq 0x18(%rax), %rax
movq 0x618(%rsp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jne 0x10871
leaq 0x5f8(%rsp), %rdi
leaq 0x588(%rsp), %rsi
callq 0x1a450
jmp 0x1086f
jmp 0x10879
movb $0x0, 0x617(%rsp)
jmp 0x1087b
movq 0x588(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x588(%rsp)
leaq 0x578(%rsp), %rdi
callq 0x1a940
jmp 0x107e6
movb 0x617(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x109cf
leaq 0x5f8(%rsp), %rdi
callq 0x1a960
testb $0x1, %al
jne 0x109cf
leaq 0x548(%rsp), %rdi
callq 0x1a9b0
jmp 0x108da
movb $0x1, 0x527(%rsp)
leaq 0x528(%rsp), %rdi
leaq 0x527(%rsp), %rsi
leaq 0x5f8(%rsp), %rdx
callq 0x1a9f0
jmp 0x10901
leaq 0x548(%rsp), %rdi
leaq 0x528(%rsp), %rsi
movq %rsi, 0x240(%rsp)
callq 0x1aa30
movq 0x240(%rsp), %rdi
callq 0x1aa70
movq 0x288(%rsp), %rdi
movq 0x618(%rsp), %rax
movq %rax, 0x248(%rsp)
addq $0x40, %rdi
callq 0x9d50
movq 0x290(%rsp), %rdi
movq %rax, %rcx
movq 0x248(%rsp), %rax
xorl %edx, %edx
divq %rcx
movq %rdx, 0x518(%rsp)
movq 0x518(%rsp), %rsi
callq 0x19d40
movq %rax, 0x250(%rsp)
jmp 0x10983
movq 0x250(%rsp), %rdi
leaq 0x548(%rsp), %rsi
callq 0x19da0
jmp 0x1099a
leaq 0x548(%rsp), %rdi
callq 0x1aa70
jmp 0x109cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x678(%rsp)
movl %eax, 0x674(%rsp)
leaq 0x548(%rsp), %rdi
callq 0x1aa70
jmp 0x11ed6
movb 0x617(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x10de3
movq 0x618(%rsp), %rax
movq %rax, 0x510(%rsp)
movq $-0x1, 0x618(%rsp)
leaq 0x650(%rsp), %rax
movq %rax, 0x508(%rsp)
movq 0x508(%rsp), %rdi
callq 0x1a880
movq %rax, 0x500(%rsp)
movq 0x508(%rsp), %rdi
callq 0x1a8b0
movq %rax, 0x4f8(%rsp)
leaq 0x500(%rsp), %rdi
leaq 0x4f8(%rsp), %rsi
callq 0x1a8e0
testb $0x1, %al
jne 0x10a55
jmp 0x10acb
leaq 0x500(%rsp), %rdi
callq 0x1a920
movq %rax, 0x4f0(%rsp)
movq 0x4f0(%rsp), %rdi
callq 0x1a930
movq %rax, %rdi
callq 0x1aa90
movq %rax, 0x4e8(%rsp)
leaq 0x618(%rsp), %rdi
leaq 0x4e8(%rsp), %rsi
callq 0xbe00
movq %rax, 0x238(%rsp)
jmp 0x10aa6
movq 0x238(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x618(%rsp)
leaq 0x500(%rsp), %rdi
callq 0x1a940
jmp 0x10a3a
movq $0x1, 0x4e0(%rsp)
movq 0x4e0(%rsp), %rax
cmpq 0x618(%rsp), %rax
jae 0x10de1
movq 0x288(%rsp), %rdi
movq $0x0, 0x4d8(%rsp)
movq $0x0, 0x4d0(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x4cc(%rsp)
movq 0x510(%rsp), %rax
addq 0x4e0(%rsp), %rax
movq %rax, 0x230(%rsp)
addq $0x40, %rdi
callq 0x9d50
movq %rax, %rcx
movq 0x230(%rsp), %rax
xorl %edx, %edx
divq %rcx
movq %rdx, 0x4c0(%rsp)
leaq 0x650(%rsp), %rax
movq %rax, 0x4b8(%rsp)
movq 0x4b8(%rsp), %rdi
callq 0x1a880
movq %rax, 0x4b0(%rsp)
movq 0x4b8(%rsp), %rdi
callq 0x1a8b0
movq %rax, 0x4a8(%rsp)
leaq 0x4b0(%rsp), %rdi
leaq 0x4a8(%rsp), %rsi
callq 0x1a8e0
testb $0x1, %al
jne 0x10baa
jmp 0x10d23
leaq 0x4b0(%rsp), %rdi
callq 0x1a920
movq %rax, 0x4a0(%rsp)
movq 0x4a0(%rsp), %rdi
callq 0x1a930
movq 0x18(%rax), %rax
cmpq 0x510(%rsp), %rax
jne 0x10c6c
movq 0x4a0(%rsp), %rdi
callq 0x1a930
movq %rax, %rdi
movq 0x4e0(%rsp), %rsi
callq 0x1aab0
movq %rax, 0x228(%rsp)
jmp 0x10c05
movq 0x228(%rsp), %rax
movss (%rax), %xmm0
ucomiss 0x4cc(%rsp), %xmm0
jbe 0x10c67
movq 0x4a0(%rsp), %rdi
callq 0x1a930
movq %rax, %rdi
movq 0x4e0(%rsp), %rsi
callq 0x1aab0
movq %rax, 0x220(%rsp)
jmp 0x10c42
movq 0x220(%rsp), %rax
movss (%rax), %xmm0
movss %xmm0, 0x4cc(%rsp)
movq 0x4d8(%rsp), %rax
movq %rax, 0x4d0(%rsp)
jmp 0x10cfd
movq 0x4a0(%rsp), %rdi
callq 0x1a930
movq %rax, %rdi
movq 0x4e0(%rsp), %rsi
decq %rsi
callq 0x1aab0
movq %rax, 0x218(%rsp)
jmp 0x10c96
movq 0x218(%rsp), %rax
movss (%rax), %xmm0
ucomiss 0x4cc(%rsp), %xmm0
jbe 0x10cfb
movq 0x4a0(%rsp), %rdi
callq 0x1a930
movq %rax, %rdi
movq 0x4e0(%rsp), %rsi
decq %rsi
callq 0x1aab0
movq %rax, 0x210(%rsp)
jmp 0x10cd6
movq 0x210(%rsp), %rax
movss (%rax), %xmm0
movss %xmm0, 0x4cc(%rsp)
movq 0x4d8(%rsp), %rax
movq %rax, 0x4d0(%rsp)
jmp 0x10cfd
movq 0x4d8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x4d8(%rsp)
leaq 0x4b0(%rsp), %rdi
callq 0x1a940
jmp 0x10b8c
movq 0x4c0(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x1aaf0
movq %rax, 0x208(%rsp)
jmp 0x10d42
movq 0x208(%rsp), %rdi
movq 0x4d0(%rsp), %rsi
callq 0x19ad0
movq %rax, 0x200(%rsp)
jmp 0x10d61
movq 0x200(%rsp), %rax
movq (%rax), %rax
incq %rax
movq %rax, 0x1f0(%rsp)
movq 0x4c0(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x1aaf0
movq %rax, 0x1f8(%rsp)
jmp 0x10d96
movq 0x1f8(%rsp), %rdi
movq 0x4d0(%rsp), %rsi
callq 0x19ad0
movq %rax, 0x1e8(%rsp)
jmp 0x10db5
movq 0x1e8(%rsp), %rax
movq 0x1f0(%rsp), %rcx
movq %rcx, (%rax)
movq 0x4e0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x4e0(%rsp)
jmp 0x10ad7
jmp 0x10de3
movq $-0x1, 0x618(%rsp)
leaq 0x650(%rsp), %rax
movq %rax, 0x498(%rsp)
movq 0x498(%rsp), %rdi
callq 0x1a880
movq %rax, 0x490(%rsp)
movq 0x498(%rsp), %rdi
callq 0x1a8b0
movq %rax, 0x488(%rsp)
leaq 0x490(%rsp), %rdi
leaq 0x488(%rsp), %rsi
callq 0x1a8e0
testb $0x1, %al
jne 0x10e44
jmp 0x10ea6
leaq 0x490(%rsp), %rdi
callq 0x1a920
movq %rax, 0x480(%rsp)
movq 0x480(%rsp), %rdi
callq 0x1a930
movq %rax, %rsi
addq $0x28, %rsi
leaq 0x618(%rsp), %rdi
callq 0xbe00
movq %rax, 0x1e0(%rsp)
jmp 0x10e84
movq 0x1e0(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x618(%rsp)
leaq 0x490(%rsp), %rdi
callq 0x1a940
jmp 0x10e29
movb $0x1, 0x616(%rsp)
leaq 0x5f8(%rsp), %rdi
callq 0x1a2c0
movq $0x0, 0x588(%rsp)
leaq 0x650(%rsp), %rax
movq %rax, 0x478(%rsp)
movq 0x478(%rsp), %rdi
callq 0x1a880
movq %rax, 0x470(%rsp)
movq 0x478(%rsp), %rdi
callq 0x1a8b0
movq %rax, 0x468(%rsp)
leaq 0x470(%rsp), %rdi
leaq 0x468(%rsp), %rsi
callq 0x1a8e0
testb $0x1, %al
jne 0x10f1f
jmp 0x10fd6
leaq 0x470(%rsp), %rdi
callq 0x1a920
movq %rax, 0x460(%rsp)
movq 0x460(%rsp), %rdi
callq 0x1a930
movq 0x28(%rax), %rax
cmpq 0x618(%rsp), %rax
jne 0x10f75
leaq 0x5f8(%rsp), %rdi
leaq 0x588(%rsp), %rsi
callq 0x1a450
jmp 0x10f66
movq 0x460(%rsp), %rdi
callq 0x1ab30
jmp 0x10fb0
movq 0x460(%rsp), %rdi
callq 0x1a930
movq 0x28(%rax), %rax
movq 0x618(%rsp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jne 0x10fa6
movq 0x460(%rsp), %rdi
callq 0x1ab30
jmp 0x10fae
movb $0x0, 0x616(%rsp)
jmp 0x10fb0
movq 0x588(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x588(%rsp)
leaq 0x470(%rsp), %rdi
callq 0x1a940
jmp 0x10f01
movb 0x616(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x11129
leaq 0x5f8(%rsp), %rdi
callq 0x1a170
movq 0x288(%rsp), %rdi
movq %rax, 0x1d8(%rsp)
addq $0x40, %rdi
callq 0x9d50
movq %rax, %rcx
movq 0x1d8(%rsp), %rax
cmpq %rcx, %rax
jae 0x11129
leaq 0x440(%rsp), %rdi
callq 0x1a9b0
jmp 0x11034
movb $0x0, 0x41f(%rsp)
leaq 0x420(%rsp), %rdi
leaq 0x41f(%rsp), %rsi
leaq 0x5f8(%rsp), %rdx
callq 0x1a9f0
jmp 0x1105b
leaq 0x440(%rsp), %rdi
leaq 0x420(%rsp), %rsi
movq %rsi, 0x1c0(%rsp)
callq 0x1aa30
movq 0x1c0(%rsp), %rdi
callq 0x1aa70
movq 0x288(%rsp), %rdi
movq 0x618(%rsp), %rax
movq %rax, 0x1c8(%rsp)
addq $0x40, %rdi
callq 0x9d50
movq 0x290(%rsp), %rdi
movq %rax, %rcx
movq 0x1c8(%rsp), %rax
xorl %edx, %edx
divq %rcx
movq %rdx, 0x410(%rsp)
movq 0x410(%rsp), %rsi
callq 0x19d40
movq %rax, 0x1d0(%rsp)
jmp 0x110dd
movq 0x1d0(%rsp), %rdi
leaq 0x440(%rsp), %rsi
callq 0x19da0
jmp 0x110f4
leaq 0x440(%rsp), %rdi
callq 0x1aa70
jmp 0x11129
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x678(%rsp)
movl %eax, 0x674(%rsp)
leaq 0x440(%rsp), %rdi
callq 0x1aa70
jmp 0x11ed6
jmp 0x1068c
leaq 0x3e0(%rsp), %rdi
callq 0x1ab50
movb $0x1, 0x3df(%rsp)
movq $0x0, 0x3d0(%rsp)
movq 0x290(%rsp), %rdi
movq 0x3d0(%rsp), %rax
movq %rax, 0x1b8(%rsp)
callq 0x19d20
movq %rax, %rcx
movq 0x1b8(%rsp), %rax
cmpq %rcx, %rax
jae 0x11d0c
leaq 0x3e0(%rsp), %rdi
callq 0x1ab60
movq $0x0, 0x3c8(%rsp)
movq 0x290(%rsp), %rdi
movq 0x3c8(%rsp), %rax
movq %rax, 0x1a8(%rsp)
movq 0x3d0(%rsp), %rsi
callq 0x19d40
movq %rax, 0x1b0(%rsp)
jmp 0x111c8
movq 0x1b0(%rsp), %rdi
callq 0x19d80
movq %rax, %rcx
movq 0x1a8(%rsp), %rax
cmpq %rcx, %rax
jae 0x1147b
movq 0x290(%rsp), %rdi
movq 0x3d0(%rsp), %rsi
callq 0x19d40
movq %rax, 0x1a0(%rsp)
jmp 0x11208
movq 0x1a0(%rsp), %rdi
movq 0x3c8(%rsp), %rsi
callq 0x19e10
movq %rax, 0x198(%rsp)
jmp 0x11227
movq 0x198(%rsp), %rax
movb (%rax), %al
andb $0x1, %al
movzbl %al, %eax
movb 0x3df(%rsp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x11460
movq 0x290(%rsp), %rdi
movq 0x3d0(%rsp), %rsi
callq 0x19d40
movq %rax, 0x190(%rsp)
jmp 0x1126a
movq 0x190(%rsp), %rdi
movq 0x3c8(%rsp), %rsi
callq 0x19e10
movq %rax, 0x188(%rsp)
jmp 0x11289
movq 0x188(%rsp), %rsi
addq $0x8, %rsi
leaq 0x3e0(%rsp), %rdi
callq 0x1ab90
movq %rax, 0x180(%rsp)
jmp 0x112ac
movq 0x180(%rsp), %rax
movq %rax, 0x3c0(%rsp)
leaq 0x3e0(%rsp), %rdi
callq 0x1abc0
movq %rax, 0x3b8(%rsp)
leaq 0x3c0(%rsp), %rdi
leaq 0x3b8(%rsp), %rsi
callq 0x1ab70
testb $0x1, %al
jne 0x112ef
jmp 0x113ed
movq 0x290(%rsp), %rdi
movq 0x3d0(%rsp), %rsi
callq 0x19d40
movq %rax, 0x178(%rsp)
jmp 0x1130e
movq 0x178(%rsp), %rdi
movq 0x3c8(%rsp), %rsi
callq 0x19e10
movq %rax, 0x170(%rsp)
jmp 0x1132d
movq 0x170(%rsp), %rsi
addq $0x8, %rsi
movl $0x0, 0x394(%rsp)
leaq 0x398(%rsp), %rdi
leaq 0x394(%rsp), %rdx
callq 0x1ac40
jmp 0x1135b
leaq 0x3e0(%rsp), %rdi
leaq 0x398(%rsp), %rsi
callq 0x1abf0
movb %dl, 0x167(%rsp)
movq %rax, 0x168(%rsp)
jmp 0x11381
movb 0x167(%rsp), %al
movq 0x168(%rsp), %rcx
movq %rcx, 0x380(%rsp)
movb %al, 0x388(%rsp)
leaq 0x398(%rsp), %rdi
callq 0x1ac80
jmp 0x113ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x678(%rsp)
movl %eax, 0x674(%rsp)
jmp 0x11ec9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x678(%rsp)
movl %eax, 0x674(%rsp)
leaq 0x398(%rsp), %rdi
callq 0x1ac80
jmp 0x11ec9
movq 0x290(%rsp), %rdi
movq 0x3d0(%rsp), %rsi
callq 0x19d40
movq %rax, 0x158(%rsp)
jmp 0x1140c
movq 0x158(%rsp), %rdi
movq 0x3c8(%rsp), %rsi
callq 0x19e10
movq %rax, 0x150(%rsp)
jmp 0x1142b
movq 0x150(%rsp), %rsi
addq $0x8, %rsi
leaq 0x3e0(%rsp), %rdi
callq 0x1ac90
movq %rax, 0x148(%rsp)
jmp 0x1144e
movq 0x148(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x11462
movq 0x3c8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x3c8(%rsp)
jmp 0x11199
leaq 0x3e0(%rsp), %rdi
callq 0x1ad40
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x1, %rcx
movb %al, 0x147(%rsp)
jne 0x114d2
leaq 0x3e0(%rsp), %rdi
callq 0x1ad50
movq %rax, 0x378(%rsp)
leaq 0x378(%rsp), %rdi
callq 0x1ad80
movq %rax, %rdi
callq 0x1a170
cmpq $0x1, %rax
seta %al
movb %al, 0x147(%rsp)
movb 0x147(%rsp), %al
testb $0x1, %al
jne 0x114e2
jmp 0x11674
movq $0x0, 0x370(%rsp)
movq 0x290(%rsp), %rdi
movq 0x370(%rsp), %rax
movq %rax, 0x130(%rsp)
movq 0x3d0(%rsp), %rsi
callq 0x19d40
movq %rax, 0x138(%rsp)
jmp 0x1151d
movq 0x138(%rsp), %rdi
callq 0x19d80
movq %rax, %rcx
movq 0x130(%rsp), %rax
cmpq %rcx, %rax
jae 0x11672
movq 0x290(%rsp), %rdi
movq 0x3d0(%rsp), %rsi
callq 0x19d40
movq %rax, 0x128(%rsp)
jmp 0x1155d
movq 0x128(%rsp), %rdi
movq 0x370(%rsp), %rsi
callq 0x19e10
movq %rax, 0x120(%rsp)
jmp 0x1157c
movq 0x120(%rsp), %rax
movb (%rax), %al
andb $0x1, %al
movzbl %al, %eax
movb 0x3df(%rsp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x11659
movq 0x290(%rsp), %rdi
movq 0x3d0(%rsp), %rsi
callq 0x19d40
movq %rax, 0x118(%rsp)
jmp 0x115bf
movq 0x290(%rsp), %rdi
movq 0x3d0(%rsp), %rsi
callq 0x19d40
movq %rax, 0x110(%rsp)
jmp 0x115de
movq 0x110(%rsp), %rdi
callq 0x1a0c0
movq %rax, 0x358(%rsp)
movq 0x370(%rsp), %rsi
leaq 0x358(%rsp), %rdi
callq 0x1ae10
movq %rax, 0x360(%rsp)
leaq 0x368(%rsp), %rdi
leaq 0x360(%rsp), %rsi
callq 0x1ae50
movq 0x118(%rsp), %rdi
movq 0x368(%rsp), %rsi
callq 0x1ada0
movq %rax, 0x108(%rsp)
jmp 0x11644
movq 0x108(%rsp), %rax
movq %rax, 0x350(%rsp)
jmp 0x114ee
movq 0x370(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x370(%rsp)
jmp 0x114ee
jmp 0x11674
leaq 0x3e0(%rsp), %rdi
callq 0x1ad50
movq %rax, 0x348(%rsp)
leaq 0x3e0(%rsp), %rdi
callq 0x1abc0
movq %rax, 0x340(%rsp)
leaq 0x348(%rsp), %rdi
leaq 0x340(%rsp), %rsi
callq 0x1ae90
testb $0x1, %al
jne 0x116bc
jmp 0x11cd0
movb $0x0, 0x33f(%rsp)
movq 0x348(%rsp), %rax
movq %rax, 0x330(%rsp)
leaq 0x3e0(%rsp), %rdi
callq 0x1abc0
movq %rax, 0x328(%rsp)
leaq 0x330(%rsp), %rdi
leaq 0x328(%rsp), %rsi
callq 0x1ae90
testb $0x1, %al
jne 0x11707
jmp 0x11a79
leaq 0x330(%rsp), %rdi
leaq 0x348(%rsp), %rsi
callq 0x1ab70
testb $0x1, %al
jne 0x11722
jmp 0x11731
leaq 0x330(%rsp), %rdi
callq 0x1aeb0
jmp 0x116d4
leaq 0x348(%rsp), %rdi
callq 0x1ad80
movq %rax, %rdi
callq 0x1a170
movq %rax, 0x100(%rsp)
leaq 0x330(%rsp), %rdi
callq 0x1ad80
movq %rax, %rdi
callq 0x1a170
movq %rax, %rcx
movq 0x100(%rsp), %rax
cmpq %rcx, %rax
jne 0x11a67
leaq 0x348(%rsp), %rdi
callq 0x1ad80
movq 0x18(%rax), %rax
movq %rax, 0xf8(%rsp)
leaq 0x330(%rsp), %rdi
callq 0x1ad80
movq %rax, %rcx
movq 0xf8(%rsp), %rax
cmpq 0x18(%rcx), %rax
jb 0x11a5d
leaq 0x348(%rsp), %rdi
callq 0x1ad80
movq 0x18(%rax), %rax
movq %rax, 0xf0(%rsp)
leaq 0x330(%rsp), %rdi
callq 0x1ad80
movq %rax, %rcx
movq 0xf0(%rsp), %rax
cmpq 0x18(%rcx), %rax
jne 0x117f1
movb $0x1, 0x33f(%rsp)
movq $0x0, 0x320(%rsp)
movq 0x290(%rsp), %rdi
movq 0x320(%rsp), %rax
movq %rax, 0xe0(%rsp)
movq 0x3d0(%rsp), %rsi
callq 0x19d40
movq %rax, 0xe8(%rsp)
jmp 0x1182c
movq 0xe8(%rsp), %rdi
callq 0x19d80
movq %rax, %rcx
movq 0xe0(%rsp), %rax
cmpq %rcx, %rax
jae 0x11a09
movq 0x290(%rsp), %rdi
movq 0x3d0(%rsp), %rsi
callq 0x19d40
movq %rax, 0xd8(%rsp)
jmp 0x1186c
movq 0xd8(%rsp), %rdi
movq 0x320(%rsp), %rsi
callq 0x19e10
movq %rax, 0xd0(%rsp)
jmp 0x1188b
movq 0xd0(%rsp), %rax
movb (%rax), %al
andb $0x1, %al
movzbl %al, %eax
movb 0x3df(%rsp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x119f0
movq 0x290(%rsp), %rdi
movq 0x3d0(%rsp), %rsi
callq 0x19d40
movq %rax, 0xc8(%rsp)
jmp 0x118ce
movq 0xc8(%rsp), %rdi
movq 0x320(%rsp), %rsi
callq 0x19e10
movq %rax, 0xc0(%rsp)
jmp 0x118ed
movq 0xc0(%rsp), %rax
addq $0x8, %rax
movq %rax, 0xb0(%rsp)
leaq 0x330(%rsp), %rdi
callq 0x1ad80
movq 0xb0(%rsp), %rdi
movq %rax, %rsi
callq 0x1aee0
movb %al, 0xbf(%rsp)
jmp 0x11927
movb 0xbf(%rsp), %al
testb $0x1, %al
jne 0x11937
jmp 0x119f0
movq 0x290(%rsp), %rdi
movq 0x3d0(%rsp), %rsi
callq 0x19d40
movq %rax, 0xa8(%rsp)
jmp 0x11956
movq 0x290(%rsp), %rdi
movq 0x3d0(%rsp), %rsi
callq 0x19d40
movq %rax, 0xa0(%rsp)
jmp 0x11975
movq 0xa0(%rsp), %rdi
callq 0x1a0c0
movq %rax, 0x308(%rsp)
movq 0x320(%rsp), %rsi
leaq 0x308(%rsp), %rdi
callq 0x1ae10
movq %rax, 0x310(%rsp)
leaq 0x318(%rsp), %rdi
leaq 0x310(%rsp), %rsi
callq 0x1ae50
movq 0xa8(%rsp), %rdi
movq 0x318(%rsp), %rsi
callq 0x1ada0
movq %rax, 0x98(%rsp)
jmp 0x119db
movq 0x98(%rsp), %rax
movq %rax, 0x300(%rsp)
jmp 0x117fd
movq 0x320(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x320(%rsp)
jmp 0x117fd
movq 0x330(%rsp), %rax
movq %rax, 0x2f0(%rsp)
movq 0x2f0(%rsp), %rsi
leaq 0x3e0(%rsp), %rdi
callq 0x1af70
movq %rax, 0x90(%rsp)
jmp 0x11a38
movq 0x90(%rsp), %rax
movq %rax, 0x2f8(%rsp)
movq 0x2f8(%rsp), %rax
movq %rax, 0x330(%rsp)
jmp 0x116d4
movb $0x1, 0x33f(%rsp)
jmp 0x11a67
leaq 0x330(%rsp), %rdi
callq 0x1aeb0
jmp 0x116d4
movb 0x33f(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x11cbe
movq $0x0, 0x2e8(%rsp)
movq 0x290(%rsp), %rdi
movq 0x2e8(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x3d0(%rsp), %rsi
callq 0x19d40
movq %rax, 0x88(%rsp)
jmp 0x11ac9
movq 0x88(%rsp), %rdi
callq 0x19d80
movq %rax, %rcx
movq 0x80(%rsp), %rax
cmpq %rcx, %rax
jae 0x11c70
movq 0x290(%rsp), %rdi
movq 0x3d0(%rsp), %rsi
callq 0x19d40
movq %rax, 0x78(%rsp)
jmp 0x11b06
movq 0x78(%rsp), %rdi
movq 0x2e8(%rsp), %rsi
callq 0x19e10
movq %rax, 0x70(%rsp)
jmp 0x11b1f
movq 0x70(%rsp), %rax
movb (%rax), %al
andb $0x1, %al
movzbl %al, %eax
movb 0x3df(%rsp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x11c57
movq 0x290(%rsp), %rdi
movq 0x3d0(%rsp), %rsi
callq 0x19d40
movq %rax, 0x68(%rsp)
jmp 0x11b5c
movq 0x68(%rsp), %rdi
movq 0x2e8(%rsp), %rsi
callq 0x19e10
movq %rax, 0x60(%rsp)
jmp 0x11b75
movq 0x60(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x50(%rsp)
leaq 0x348(%rsp), %rdi
callq 0x1ad80
movq 0x50(%rsp), %rdi
movq %rax, %rsi
callq 0x1aee0
movb %al, 0x5f(%rsp)
jmp 0x11ba3
movb 0x5f(%rsp), %al
testb $0x1, %al
jne 0x11bb0
jmp 0x11c57
movq 0x290(%rsp), %rdi
movq 0x3d0(%rsp), %rsi
callq 0x19d40
movq %rax, 0x48(%rsp)
jmp 0x11bcc
movq 0x290(%rsp), %rdi
movq 0x3d0(%rsp), %rsi
callq 0x19d40
movq %rax, 0x40(%rsp)
jmp 0x11be8
movq 0x40(%rsp), %rdi
callq 0x1a0c0
movq %rax, 0x2d0(%rsp)
movq 0x2e8(%rsp), %rsi
leaq 0x2d0(%rsp), %rdi
callq 0x1ae10
movq %rax, 0x2d8(%rsp)
leaq 0x2e0(%rsp), %rdi
leaq 0x2d8(%rsp), %rsi
callq 0x1ae50
movq 0x48(%rsp), %rdi
movq 0x2e0(%rsp), %rsi
callq 0x1ada0
movq %rax, 0x38(%rsp)
jmp 0x11c45
movq 0x38(%rsp), %rax
movq %rax, 0x2c8(%rsp)
jmp 0x11a9a
movq 0x2e8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2e8(%rsp)
jmp 0x11a9a
movq 0x348(%rsp), %rax
movq %rax, 0x2b8(%rsp)
movq 0x2b8(%rsp), %rsi
leaq 0x3e0(%rsp), %rdi
callq 0x1af70
movq %rax, 0x30(%rsp)
jmp 0x11c9c
movq 0x30(%rsp), %rax
movq %rax, 0x2c0(%rsp)
movq 0x2c0(%rsp), %rax
movq %rax, 0x348(%rsp)
jmp 0x11689
leaq 0x348(%rsp), %rdi
callq 0x1aeb0
jmp 0x11689
movb 0x3df(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x11ceb
movb $0x0, 0x3df(%rsp)
jmp 0x11d07
movb $0x1, 0x3df(%rsp)
movq 0x3d0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x3d0(%rsp)
jmp 0x1114f
movq $0x0, 0x2b0(%rsp)
movq 0x288(%rsp), %rdi
movq 0x2b0(%rsp), %rax
movq %rax, 0x28(%rsp)
addq $0x40, %rdi
callq 0x9d50
movq %rax, %rcx
movq 0x28(%rsp), %rax
cmpq %rcx, %rax
jae 0x11e81
movq $0x0, 0x2a8(%rsp)
movq $0x0, 0x2a0(%rsp)
movq $0x0, 0x298(%rsp)
movq 0x288(%rsp), %rdi
movq 0x298(%rsp), %rax
movq %rax, 0x20(%rsp)
addq $0x40, %rdi
callq 0x9d50
movq %rax, %rcx
movq 0x20(%rsp), %rax
cmpq %rcx, %rax
jae 0x11e4f
movq 0x2b0(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x1aaf0
movq %rax, 0x18(%rsp)
jmp 0x11db6
movq 0x18(%rsp), %rdi
movq 0x298(%rsp), %rsi
callq 0x19ad0
movq %rax, 0x10(%rsp)
jmp 0x11dcf
movq 0x10(%rsp), %rax
movq (%rax), %rax
cmpq 0x2a0(%rsp), %rax
jbe 0x11e34
movq 0x2b0(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x1aaf0
movq %rax, 0x8(%rsp)
jmp 0x11dfd
movq 0x8(%rsp), %rdi
movq 0x298(%rsp), %rsi
callq 0x19ad0
movq %rax, (%rsp)
jmp 0x11e15
movq (%rsp), %rax
movq (%rax), %rax
movq %rax, 0x2a0(%rsp)
movq 0x298(%rsp), %rax
movq %rax, 0x2a8(%rsp)
jmp 0x11e36
movq 0x298(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x298(%rsp)
jmp 0x11d6b
movq 0x688(%rsp), %rdi
leaq 0x2a8(%rsp), %rsi
callq 0x1a450
jmp 0x11e66
jmp 0x11e68
movq 0x2b0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2b0(%rsp)
jmp 0x11d18
movb $0x1, 0x687(%rsp)
leaq 0x3e0(%rsp), %rdi
callq 0x1afb0
leaq 0x5e0(%rsp), %rdi
callq 0x1afc0
leaq 0x5f8(%rsp), %rdi
callq 0x19cb0
leaq 0x650(%rsp), %rdi
callq 0x1b020
testb $0x1, 0x687(%rsp)
jne 0x11f0c
jmp 0x11eff
leaq 0x3e0(%rsp), %rdi
callq 0x1afb0
leaq 0x5e0(%rsp), %rdi
callq 0x1afc0
leaq 0x5f8(%rsp), %rdi
callq 0x19cb0
leaq 0x650(%rsp), %rdi
callq 0x1b020
jmp 0x11f1c
movq 0x290(%rsp), %rdi
callq 0x1a4f0
movq 0x280(%rsp), %rax
addq $0x6a8, %rsp            # imm = 0x6A8
retq
movq 0x290(%rsp), %rdi
callq 0x1a4f0
movq 0x678(%rsp), %rdi
callq 0x6750
nopw %cs:(%rax,%rax)