LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]optimal-seed-solver/HashTree.cc
// Function: HashTree::~HashTree()
HashTree::~HashTree() {
	for (int i = 0; i < 1 << (2 * hashLength); i++) {
		if (root[i] != NULL) {
			delete root[i];
			root[i] = NULL;
		}
	}

	if (checkdb != NULL) {
		delete[] checkdb;
		checkdb = NULL;
	}

	if (root != NULL) {
		delete[] root;
		root = NULL;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x320(%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x4be6
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x320(%rbx), %rax
movq $0x0, (%rax,%r14,8)
incq %r14
movb (%rbx), %cl
addb %cl, %cl
movl %r14d, %eax
shrl %cl, %eax
testl %eax, %eax
je 0x4bc1
movq 0x310(%rbx), %r15
testq %r15, %r15
je 0x4c4d
leaq -0x8(%r15), %r14
movq -0x8(%r15), %r12
testq %r12, %r12
je 0x4c2f
addq $-0x268, %r15           # imm = 0xFD98
imulq $0x268, %r12, %r13      # imm = 0x268
leaq (%r15,%r13), %rdi
callq 0x7fda
addq $-0x268, %r13           # imm = 0xFD98
jne 0x4c1d
imulq $0x268, %r12, %rsi      # imm = 0x268
addq $0x8, %rsi
movq %r14, %rdi
callq 0x3490
movq $0x0, 0x310(%rbx)
movq 0x320(%rbx), %rdi
testq %rdi, %rdi
je 0x4c69
callq 0x3330
movq $0x0, 0x320(%rbx)
leaq 0x328(%rbx), %rdi
callq 0x6e0e
leaq 0x318(%rbx), %rdi
callq 0x8bb6
leaq 0xa8(%rbx), %rdi
callq 0x7fda
leaq 0x68(%rbx), %rdi
callq 0x7206
leaq 0x38(%rbx), %rdi
callq 0x7256
addq $0x8, %rbx
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7256
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]optimal-seed-solver/HashTree.cc
// Function: HashTree::checkDouble(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, unsigned int, unsigned int)
void HashTree::checkDouble(string& DNA, unsigned int chrNum, unsigned int location) {
	bool leaf = true;

	if (DNA.find('M') != string::npos) {
		int pos = DNA.find('M');
		DNA[pos] = 'A';
		checkDouble(DNA, chrNum, location);
		DNA[pos] = 'C';
		checkDouble(DNA, chrNum, location);
		DNA[pos] = 'M';

		leaf = false;
	}

	if (DNA.find('R') != string::npos) {
		int pos = DNA.find('R');
		DNA[pos] = 'A';
		checkDouble(DNA, chrNum, location);
		DNA[pos] = 'G';
		checkDouble(DNA, chrNum, location);
		DNA[pos] = 'R';

		leaf = false;
	}

	//Add DNA to database unless we have resolved all cases
	if (leaf)
		addEntry(DNA, chrNum, location);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
movl $0x4d, %esi
xorl %edx, %edx
callq 0x3340
movq %r14, %rdi
cmpq $-0x1, %rax
je 0x5454
movl $0x4d, %esi
xorl %edx, %edx
callq 0x3340
movslq %eax, %r12
movq (%r14), %rax
movb $0x41, (%rax,%r12)
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x53ce
movq (%r14), %rax
movb $0x43, (%rax,%r12)
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x53ce
movq (%r14), %rax
movb $0x4d, (%rax,%r12)
movq %r14, %rdi
movl $0x52, %esi
xorl %edx, %edx
callq 0x3340
cmpq $-0x1, %rax
jne 0x5466
jmp 0x54ae
movl $0x52, %esi
xorl %edx, %edx
callq 0x3340
cmpq $-0x1, %rax
je 0x54b7
movq %r14, %rdi
movl $0x52, %esi
xorl %edx, %edx
callq 0x3340
movslq %eax, %r12
movq (%r14), %rax
movb $0x41, (%rax,%r12)
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x53ce
movq (%r14), %rax
movb $0x47, (%rax,%r12)
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x53ce
movq (%r14), %rax
movb $0x52, (%rax,%r12)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
movl %ebx, %ecx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4cb4
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]optimal-seed-solver/HashTree.cc
// Function: HashTree::query(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned int)
void HashTree::query(string DNA, unsigned int threshold) {
	hashVal = hashgen.calculateHash(DNA, hashLength);
	queryCursor = root[hashVal];
	length = hashLength;

	TreeNode* nextCursor;

	hitLeaf = false;

	if (queryCursor == NULL || queryCursor->isLeaf() || queryCursor->getLocNum() <= threshold ) {
		hitLeaf = true;
		return;
	}

	while (length < DNA.length() ) {


		switch (DNA[length]) {
			case 'A':
				nextCursor = queryCursor->getA();
				break;
			case 'C':
				nextCursor = queryCursor->getC();
				break;
			case 'G':
				nextCursor = queryCursor->getG();
				break;
			case 'T':
				nextCursor = queryCursor->getT();
				break;
			default:
				cerr << "unrecognized character: " << DNA[length] << endl;
				break;
		}

		queryCursor = nextCursor;
		length++;

		if (queryCursor == NULL || queryCursor->isLeaf() || queryCursor->getLocNum() <= threshold ) {
			hitLeaf = true;
			return;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
addq $0x318, %rdi            # imm = 0x318
movl (%r14), %edx
callq 0x8b32
movl %eax, 0x340(%r14)
movq 0x320(%r14), %rcx
movl %eax, %eax
movq (%rcx,%rax,8), %rdi
movq %rdi, 0x348(%r14)
movl (%r14), %eax
movl %eax, 0x344(%r14)
movb $0x0, 0x350(%r14)
testq %rdi, %rdi
je 0x5918
movq (%rdi), %rax
callq *0x28(%rax)
testb %al, %al
jne 0x5918
movq 0x348(%r14), %rcx
cmpl %ebx, 0x8(%rcx)
jbe 0x5918
movq 0x77c3(%rip), %r12      # 0xcff0
movl 0x344(%r14), %eax
cmpq %rax, 0x8(%r15)
jbe 0x5920
movq (%r15), %rdx
movzbl (%rdx,%rax), %edx
cmpl $0x46, %edx
jg 0x5861
cmpl $0x41, %edx
je 0x58db
cmpl $0x43, %edx
jne 0x5871
movq 0x20(%rcx), %r13
jmp 0x58e5
cmpl $0x47, %edx
je 0x58e1
cmpl $0x54, %edx
jne 0x5871
movq 0x30(%rcx), %r13
jmp 0x58e5
movl $0x18, %edx
movq %r12, %rdi
leaq 0x3956(%rip), %rsi      # 0x91d6
callq 0x32d0
movl 0x344(%r14), %eax
movq (%r15), %rcx
movb (%rcx,%rax), %al
movb %al, 0x7(%rsp)
movl $0x1, %edx
movq %r12, %rdi
leaq 0x7(%rsp), %rsi
callq 0x32d0
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x3250
movsbl %al, %esi
movq %rbp, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31c0
movl 0x344(%r14), %eax
jmp 0x58e5
movq 0x18(%rcx), %r13
jmp 0x58e5
movq 0x28(%rcx), %r13
movq %r13, 0x348(%r14)
incl %eax
movl %eax, 0x344(%r14)
testq %r13, %r13
je 0x5918
movq (%r13), %rax
movq %r13, %rdi
callq *0x28(%rax)
testb %al, %al
jne 0x5918
movq 0x348(%r14), %rcx
cmpl %ebx, 0x8(%rcx)
ja 0x582d
movb $0x1, 0x350(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]optimal-seed-solver/HashTree.cc
// Function: HashTree::estimateFreqLength(unsigned int, unsigned int)
unsigned int HashTree::estimateFreqLength(unsigned int hash, unsigned int freqThreshold/*, string DNA*/) {
	assert(hash < static_cast<unsigned int>(1 << (2 * hashLength) ) );

	TreeNode* base = root[hash];

	if (base == NULL || base->getLocNum() <= freqThreshold)
		return static_cast<unsigned int>(hashLength);

	unsigned long long freqSum = 0;
	freqSum = estimateFreqLengthHelper(base, freqThreshold, freqSum, hashLength/*, DNA*/);

	return (freqSum - 1) / base->getLocNum() + 1;
}

// Assembly:
pushq %rbx
movl (%rdi), %eax
leal (%rax,%rax), %ecx
movl %esi, %r8d
shrl %cl, %r8d
testl %r8d, %r8d
jne 0x5998
movq 0x320(%rdi), %rcx
movl %esi, %esi
movq (%rcx,%rsi,8), %rbx
testq %rbx, %rbx
je 0x5996
cmpl %edx, 0x8(%rbx)
jbe 0x5996
movq %rbx, %rsi
xorl %ecx, %ecx
movl %eax, %r8d
callq 0x59b8
decq %rax
movl 0x8(%rbx), %ecx
xorl %edx, %edx
divq %rcx
incl %eax
popq %rbx
retq
leaq 0x3850(%rip), %rdi      # 0x91ef
leaq 0x37b3(%rip), %rsi      # 0x9159
leaq 0x387b(%rip), %rcx      # 0x9228
movl $0x1dc, %edx            # imm = 0x1DC
callq 0x3190
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]optimal-seed-solver/HashTree.cc
// Function: HashTree::estimateFreqLengthHelper(TreeNode*, unsigned int, unsigned long long, unsigned int)
unsigned long long HashTree::estimateFreqLengthHelper(TreeNode* node, unsigned int freqThreshold, unsigned long long freqSum, unsigned int curLength/*, string DNA*/) {
	if (node == NULL) {
		//cout << DNA << " curLength: " << curLength << " NULL." << endl;
		return freqSum;
	}

	if (node->getLocNum() <= freqThreshold || node->isLeaf() ) {
		//cout << DNA << " curLength: " << curLength << " frequency: " << node->getLocNum() << endl;
		return freqSum + (unsigned long long) curLength * node->getLocNum();
	}

	freqSum = estimateFreqLengthHelper(node->getA(), freqThreshold, freqSum, curLength + 1/*, DNA + 'A'*/);
	freqSum = estimateFreqLengthHelper(node->getC(), freqThreshold, freqSum, curLength + 1/*, DNA + 'C'*/);
	freqSum = estimateFreqLengthHelper(node->getG(), freqThreshold, freqSum, curLength + 1/*, DNA + 'G'*/);
	freqSum = estimateFreqLengthHelper(node->getT(), freqThreshold, freqSum, curLength + 1/*, DNA + 'T'*/);

	return freqSum;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r12
testq %rsi, %rsi
je 0x5a43
movl %r8d, %ebx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
movl 0x8(%r14), %eax
cmpl %ebp, %eax
jbe 0x5a38
movq (%r14), %rax
movq %r14, %rdi
callq *0x28(%rax)
testb %al, %al
jne 0x5a34
movq 0x18(%r14), %rsi
incl %ebx
movq %r15, %rdi
movl %ebp, %edx
movq %r12, %rcx
movl %ebx, %r8d
callq 0x59b8
movq 0x20(%r14), %rsi
movq %r15, %rdi
movl %ebp, %edx
movq %rax, %rcx
movl %ebx, %r8d
callq 0x59b8
movq 0x28(%r14), %rsi
movq %r15, %rdi
movl %ebp, %edx
movq %rax, %rcx
movl %ebx, %r8d
callq 0x59b8
movq %rax, %r12
movq 0x30(%r14), %r14
testq %r14, %r14
jne 0x59d3
jmp 0x5a43
movl 0x8(%r14), %eax
movl %ebx, %ecx
movl %eax, %eax
imulq %rcx, %rax
addq %rax, %r12
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]optimal-seed-solver/HashTree.cc
// Function: HashTree::averageFreqDepth(unsigned int, unsigned int)
unsigned int HashTree::averageFreqDepth(unsigned int hash, unsigned int depth)
{
	assert(hash < static_cast<unsigned int>(1 << (2 * hashLength) ) );

	TreeNode* base = root[hash];

	if (base == NULL)
		return 0;

	unsigned long long weightedSum = 0;
	weightedSum = averageFreqDepthHelp(base, depth, weightedSum, 0);

	return weightedSum / base->getLocNum();
}

// Assembly:
pushq %rbx
movb (%rdi), %cl
addb %cl, %cl
movl %esi, %eax
shrl %cl, %eax
testl %eax, %eax
jne 0x5a8a
movq 0x320(%rdi), %rax
movl %esi, %ecx
movq (%rax,%rcx,8), %rbx
testq %rbx, %rbx
je 0x5a86
movq %rbx, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x5aaa
movl 0x8(%rbx), %ecx
xorl %edx, %edx
divq %rcx
jmp 0x5a88
xorl %eax, %eax
popq %rbx
retq
leaq 0x375e(%rip), %rdi      # 0x91ef
leaq 0x36c1(%rip), %rsi      # 0x9159
leaq 0x37cf(%rip), %rcx      # 0x926e
movl $0x1fe, %edx            # imm = 0x1FE
callq 0x3190
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]optimal-seed-solver/HashTree.cc
// Function: HashTree::averageFreqDepthHelp(TreeNode*, unsigned int, unsigned long long, unsigned int)
unsigned long long HashTree::averageFreqDepthHelp(TreeNode* node, unsigned int depth, unsigned long long weightedSum, unsigned int currDepth/*, string DNA*/) {
	if (node == NULL) {
		return weightedSum;
	}

	if(currDepth == depth || (node->isLeaf() && currDepth < depth))
	{
		unsigned long long freq =  node->getLocNum();
		return freq * freq + weightedSum;
	}
	else
	{
		weightedSum = averageFreqDepthHelp(node->getA(), depth, weightedSum, currDepth + 1/*, DNA + 'A'*/);
		weightedSum = averageFreqDepthHelp(node->getC(), depth, weightedSum, currDepth + 1/*, DNA + 'C'*/);
		weightedSum = averageFreqDepthHelp(node->getG(), depth, weightedSum, currDepth + 1/*, DNA + 'G'*/);
		weightedSum = averageFreqDepthHelp(node->getT(), depth, weightedSum, currDepth + 1/*, DNA + 'T'*/);
	}

	return weightedSum;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r12
testq %rsi, %rsi
je 0x5b31
movl %r8d, %ebx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
cmpl %ebx, %ebp
je 0x5b26
movq (%r14), %rax
movq %r14, %rdi
callq *0x28(%rax)
cmpl %ebp, %ebx
jae 0x5ada
testb %al, %al
jne 0x5b26
movq 0x18(%r14), %rsi
incl %ebx
movq %r15, %rdi
movl %ebp, %edx
movq %r12, %rcx
movl %ebx, %r8d
callq 0x5aaa
movq 0x20(%r14), %rsi
movq %r15, %rdi
movl %ebp, %edx
movq %rax, %rcx
movl %ebx, %r8d
callq 0x5aaa
movq 0x28(%r14), %rsi
movq %r15, %rdi
movl %ebp, %edx
movq %rax, %rcx
movl %ebx, %r8d
callq 0x5aaa
movq %rax, %r12
movq 0x30(%r14), %r14
testq %r14, %r14
jne 0x5ac5
jmp 0x5b31
movl 0x8(%r14), %eax
imulq %rax, %rax
addq %rax, %r12
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]optimal-seed-solver/HashTree.cc
// Function: HashTree::calculateLenToFreqTable()
void HashTree::calculateLenToFreqTable()
{
	unsigned int tableWidth = fullLength - hashLength + 1;
	unsigned int tableHeight = 1 << (2 * hashLength);

	vector< vector<unsigned int> > hashLenTable (tableHeight, vector<unsigned>(tableWidth));

	for(int i = 0; i < static_cast<int>(tableHeight); i++)
		for(int j=0; j<tableWidth; j++)
			hashLenTable[i][j] = averageFreqDepth(i, j);

	this->hashLenTable = hashLenTable;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movl (%rdi), %ebp
movl 0x4(%rdi), %r14d
subl %ebp, %r14d
incl %r14d
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
movq %r14, %rsi
callq 0x6e62
addl %ebp, %ebp
movl $0x1, %r15d
movl %ebp, %ecx
shll %cl, %r15d
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x6(%rsp), %rcx
movq %r15, %rsi
callq 0x6eee
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x5ba8
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
xorl %r12d, %r12d
testl %r14d, %r14d
je 0x5bda
leaq (%r12,%r12,2), %rbp
xorl %r13d, %r13d
movq %rbx, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x5a50
movq 0x20(%rsp), %rcx
movq (%rcx,%rbp,8), %rcx
movl %eax, (%rcx,%r13,4)
incq %r13
cmpq %r13, %r14
jne 0x5bb7
incq %r12
cmpq %r15, %r12
jne 0x5bab
addq $0x328, %rbx            # imm = 0x328
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x6f86
leaq 0x20(%rsp), %rdi
callq 0x6e0e
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5c32
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x5c3f
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
jmp 0x5c3f
movq %rax, %rbx
jmp 0x5c3f
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x6e0e
movq %rbx, %rdi
callq 0x3450
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]optimal-seed-solver/HashTree.cc
// Function: HashTree::printHashLenTable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void HashTree::printHashLenTable(string filename)
{
	std::ofstream f;
	f.open(filename.c_str(), ios::out | ios::binary);

	unsigned int tableWidth = fullLength - hashLength + 1;
	unsigned int tableHeight = 1 << (2 * hashLength);
	if(&hashLenTable != NULL)
	{
		for(int i = 0; i < static_cast<int>(tableHeight); i++)
		{
			f << "Index: " << i << " ";
			for(int j = 0; j < static_cast<int>(tableWidth); j++)
			{
				f << hashLenTable[i][j] << "\t";
			}
			f << "\n";
		}
	}
	else
		cout << "Empty table. " << endl;

	f.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x3420
movq (%r14), %rsi
movq %r15, %rdi
movl $0x14, %edx
callq 0x3050
movl (%rbx), %eax
movl 0x4(%rbx), %r13d
subl %eax, %r13d
incl %r13d
addl %eax, %eax
movl %eax, 0xc(%rsp)
xorl %r14d, %r14d
leaq 0x18(%rsp), %r12
leaq 0x361d(%rip), %r15      # 0x92ba
movl $0x7, %edx
movq %r12, %rdi
leaq 0x3606(%rip), %rsi      # 0x92b2
callq 0x32d0
movq %r12, %rdi
movl %r14d, %esi
callq 0x3430
movl $0x1, %edx
movq %rax, %rdi
leaq 0x36e3(%rip), %rsi      # 0x93ae
callq 0x32d0
movq %r14, 0x10(%rsp)
testl %r13d, %r13d
jle 0x5d15
movq 0x10(%rsp), %rax
leaq (%rax,%rax,2), %rbp
xorl %r14d, %r14d
movq 0x328(%rbx), %rax
movq (%rax,%rbp,8), %rax
movl (%rax,%r14,4), %esi
movq %r12, %rdi
callq 0x31b0
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x32d0
incq %r14
cmpq %r14, %r13
jne 0x5ce6
movl $0x1, %edx
movq %r12, %rdi
leaq 0x3342(%rip), %rsi      # 0x9066
callq 0x32d0
movq 0x10(%rsp), %r14
incq %r14
movl %r14d, %eax
movl 0xc(%rsp), %ecx
shrl %cl, %eax
testl %eax, %eax
je 0x5c9d
leaq 0x18(%rsp), %rdi
callq 0x3380
movq 0x726d(%rip), %rax      # 0xcfc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x20(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x18(%rsp,%rcx)
callq 0x3210
leaq 0x110(%rsp), %rdi
callq 0x30f0
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5d96
jmp 0x5d96
jmp 0x5d96
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x33a0
movq %rbx, %rdi
callq 0x3450
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]optimal-seed-solver/HashTree.cc
// Function: HashTree::storeHashLenTable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void HashTree::storeHashLenTable(string filename)
{
	unsigned int tableWidth = fullLength - hashLength + 1;
	unsigned int tableHeight = 1 << (2 * hashLength);

	if(&hashLenTable == NULL)
		cout << "Empty table. " << endl;

	std::ofstream f;
	f.open(filename.c_str(), ios::out | ios::binary);

	int hl[] = {(int)(fullLength - hashLength + 1)};
	int fl[] = {(int)(1 << (2 * hashLength))};

	f.write((char*)&hl, sizeof(int));
	f.write((char*)&fl, sizeof(int));

	for(int i = 0; i < static_cast<int>(tableHeight); i++)
		for(int j = 0; j < static_cast<int>(tableWidth); j++)
		{
			int h[] = {(int)(hashLenTable[i][j])};
			f.write((char*)&h, sizeof(int));
		}
	f.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rsi, %r14
movq %rdi, %rbx
movl (%rdi), %ebp
movl 0x4(%rdi), %r12d
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0x3420
movq (%r14), %rsi
movq %r15, %rdi
movl $0x14, %edx
callq 0x3050
movl (%rbx), %ecx
movl 0x4(%rbx), %eax
subl %ecx, %eax
incl %eax
leaq 0x24(%rsp), %rsi
movl %eax, (%rsi)
addl %ecx, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, 0x20(%rsp)
leaq 0x28(%rsp), %rdi
movl $0x4, %edx
callq 0x3350
leaq 0x28(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movl $0x4, %edx
callq 0x3350
subl %ebp, %r12d
incl %r12d
addl %ebp, %ebp
movl %ebp, 0x14(%rsp)
movl %r12d, 0x18(%rsp)
movl %r12d, %r13d
movq $0x0, 0x8(%rsp)
leaq 0x28(%rsp), %r14
leaq 0x1c(%rsp), %r15
cmpl $0x0, 0x18(%rsp)
jle 0x5e89
movq 0x8(%rsp), %rax
leaq (%rax,%rax,2), %r12
xorl %ebp, %ebp
movq 0x328(%rbx), %rax
movq (%rax,%r12,8), %rax
movl (%rax,%rbp,4), %eax
movl %eax, 0x1c(%rsp)
movl $0x4, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3350
incq %rbp
cmpq %rbp, %r13
jne 0x5e5f
movq 0x8(%rsp), %rcx
incq %rcx
movq %rcx, %rax
movq %rcx, 0x8(%rsp)
movl 0x14(%rsp), %ecx
shrl %cl, %eax
testl %eax, %eax
je 0x5e4d
leaq 0x28(%rsp), %rdi
callq 0x3380
movq 0x710c(%rip), %rax      # 0xcfc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x30(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x28(%rsp,%rcx)
callq 0x3210
leaq 0x120(%rsp), %rdi
callq 0x30f0
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5ef5
jmp 0x5ef5
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x33a0
movq %rbx, %rdi
callq 0x3450
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]optimal-seed-solver/HashTree.cc
// Function: HashTree::readHashLenTable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void HashTree::readHashLenTable(string filename)
{
	std::ifstream f;
	f.open(filename.c_str(),  ios::in | ios::binary);
	if(f.is_open())
	{
		f.seekg(0, ios::beg);

		int curr[1];
		f.read((char*)(&curr), sizeof(int));
		unsigned int tableWidth = (unsigned int)(curr[0]);

		int curr2[1];
		f.read((char*)(&curr2), sizeof(int));
		unsigned int tableHeight = (unsigned int)(curr2[0]);

		vector< vector <unsigned int> > hashLenTable (tableHeight,
			vector<unsigned int>(tableWidth));

		for(int i=0; i<tableHeight; i++)
			for(int j=0; j<tableWidth; j++)
			{
				int curr[1];
				f.read((char*)(&curr), sizeof(int));
				hashLenTable[i][j] = (unsigned int)(curr[0]);
			}

		this->hashLenTable = hashLenTable;
		f.close();
		return;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x50(%rsp), %r15
movq %r15, %rdi
callq 0x32c0
movq (%r14), %rsi
movq %r15, %rdi
movl $0xc, %edx
callq 0x3180
leaq 0xc8(%rsp), %rdi
callq 0x30b0
testb %al, %al
je 0x605e
leaq 0x50(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3370
leaq 0x50(%rsp), %rdi
leaq 0xc(%rsp), %rsi
movl $0x4, %edx
callq 0x3310
movl 0xc(%rsp), %r14d
leaq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movl $0x4, %edx
callq 0x3310
movl 0x8(%rsp), %r15d
leaq 0x10(%rsp), %rdi
leaq 0x7(%rsp), %rdx
movq %r14, %rsi
callq 0x6e62
movq %rbx, 0x28(%rsp)
leaq 0x38(%rsp), %rdi
leaq 0x10(%rsp), %rdx
leaq 0x6(%rsp), %rcx
movq %r15, %rsi
callq 0x6eee
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x5fd8
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq %r15, 0x30(%rsp)
testq %r15, %r15
je 0x6034
xorl %ebp, %ebp
leaq 0x50(%rsp), %r12
leaq 0x10(%rsp), %r13
testl %r14d, %r14d
je 0x602a
leaq (,%rbp,2), %rbx
addq %rbp, %rbx
xorl %r15d, %r15d
movl $0x4, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x3310
movl 0x10(%rsp), %eax
movq 0x38(%rsp), %rcx
movq (%rcx,%rbx,8), %rcx
movl %eax, (%rcx,%r15,4)
incq %r15
cmpq %r15, %r14
jne 0x6001
incq %rbp
cmpq 0x30(%rsp), %rbp
jne 0x5fee
movq 0x28(%rsp), %rdi
addq $0x328, %rdi            # imm = 0x328
leaq 0x38(%rsp), %rsi
callq 0x6f86
leaq 0x50(%rsp), %rdi
callq 0x3090
leaq 0x38(%rsp), %rdi
callq 0x6e0e
leaq 0x50(%rsp), %rdi
callq 0x30c0
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x60b0
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
jmp 0x60b0
jmp 0x609e
jmp 0x609e
jmp 0x609e
jmp 0x60a3
movq %rax, %rbx
jmp 0x60b0
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x6e0e
leaq 0x50(%rsp), %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x3450
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]optimal-seed-solver/HashTree.cc
// Function: HashTree::calculateFreqMap()
void HashTree::calculateFreqMap()
{
	/*
	 * Map which stores <freq, numfreq > pairs
	 */
	map <unsigned int, unsigned long long> freqMap;
	unsigned int cfreq;
	freqMap.clear();
	if(&hashLenTable != NULL)
	{
		unsigned int counter = 0;
		/* Iterate through the table */
		for(int i = 0; i < 1 << (2 * hashLength); i++)
		{
			for(int j = 0; j < (fullLength - hashLength + 1); j++)
			{
				counter++;

				cfreq = hashLenTable[i][j];
				/* Increase counter */
				if (freqMap.find(cfreq) == freqMap.end())
					freqMap[cfreq] = 1;
				else
					freqMap[cfreq]++;

				/* We only want the first element with frequency 1
				   since we are guaranteed the rest are 1. */
				if(cfreq == 1)
					break;
			}
		}
		this->freqMap = freqMap;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %r12
movl $0x0, (%r12)
xorl %r13d, %r13d
movq %r13, 0x8(%r12)
movq %r12, 0x10(%r12)
movq %r12, 0x18(%r12)
movq %r13, 0x20(%r12)
leaq 0x8(%rsp), %rdi
callq 0x7b46
movl (%rbx), %eax
leaq 0x4(%rsp), %r15
movl 0x4(%rbx), %ecx
incl %ecx
cmpl %eax, %ecx
jne 0x6125
incq %r13
leal (%rax,%rax), %ecx
movl %r13d, %edx
shrl %cl, %edx
testl %edx, %edx
je 0x6108
jmp 0x61d0
leaq (,%r13,2), %rbp
addq %r13, %rbp
xorl %r14d, %r14d
movq 0x328(%rbx), %rax
movq (%rax,%rbp,8), %rax
movl (%rax,%r14,4), %eax
movl %eax, 0x4(%rsp)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x6185
movq %r12, %r8
movq %r8, %rcx
movq %rdi, %rdx
movl 0x20(%rdi), %esi
xorl %edi, %edi
cmpl %eax, %esi
setb %dil
movq %rdx, %r8
cmovbq %rcx, %r8
movq 0x10(%rdx,%rdi,8), %rdi
testq %rdi, %rdi
jne 0x6153
cmpq %r12, %r8
je 0x6185
cmpl %eax, %esi
cmovbq %rcx, %rdx
cmpl 0x20(%rdx), %eax
jae 0x61be
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x7124
movq $0x1, (%rax)
cmpl $0x1, 0x4(%rsp)
movl (%rbx), %eax
je 0x6111
incq %r14
movl 0x4(%rbx), %ecx
subl %eax, %ecx
incl %ecx
cmpq %rcx, %r14
jb 0x6133
jmp 0x6111
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x7124
incq (%rax)
jmp 0x6199
addq $0x8, %rbx
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x72a6
leaq 0x8(%rsp), %rdi
callq 0x7256
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x61fc
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x7256
movq %rbx, %rdi
callq 0x3450
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]optimal-seed-solver/HashTree.cc
// Function: HashTree::searchCDFFreqMap(double)
int HashTree::searchCDFFreqMap(double val)
{
	int ret_freq = -1;
	for(map<unsigned int, double>::iterator i = cdfFreqMap.begin(); i != cdfFreqMap.end(); i++)
	{
		if(val <= cdfFreqMap[i->first])
		{
			ret_freq = i->second;
		}
	}
	return ret_freq;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movsd %xmm0, (%rsp)
movq 0x80(%rdi), %r14
leaq 0x70(%rdi), %r15
cmpq %r15, %r14
je 0x6481
movq %rdi, %rbx
addq $0x68, %rbx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
leaq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x718a
movsd (%rax), %xmm0
ucomisd (%rsp), %xmm0
jb 0x646f
cvttsd2si 0x28(%r14), %ebp
movq %r14, %rdi
callq 0x31d0
movq %rax, %r14
cmpq %r15, %rax
jne 0x6452
jmp 0x6486
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]optimal-seed-solver/HashTree.cc
// Function: HashTree::storeTreeHelp(TreeNode*, std::basic_ofstream<char, std::char_traits<char>>&)
void HashTree::storeTreeHelp(TreeNode * toOut, ofstream &f)
{
	if (toOut == NULL || toOut -> getLocNum() == 0)
	{
		int c[] = {0};
		f.write((char*)(&c), sizeof(int));
	}
	else
	{
		int c[] = {(int) toOut->getLocNum()};
		f.write((char*)&c, sizeof(int));
		storeTreeHelp(toOut->getA(), f);
		storeTreeHelp(toOut->getC(), f);
		storeTreeHelp(toOut->getG(), f);
		storeTreeHelp(toOut->getT(), f);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
testq %rsi, %rsi
je 0x6a8e
movq %rsi, %r15
movl 0x8(%rsi), %eax
testl %eax, %eax
je 0x6a8e
movq %rdi, %r14
leaq 0x8(%rsp), %rsi
movl %eax, (%rsi)
movl $0x4, %edx
movq %rbx, %rdi
callq 0x3350
movq 0x18(%r15), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x6a1e
movq 0x20(%r15), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x6a1e
movq 0x28(%r15), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x6a1e
movq 0x30(%r15), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x6a1e
jmp 0x6aa6
leaq 0xc(%rsp), %rsi
movl $0x0, (%rsi)
movl $0x4, %edx
movq %rbx, %rdi
callq 0x3350
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]optimal-seed-solver/HashTree.cc
// Function: HashTree::storeTree(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void HashTree::storeTree(string dbName)
{
	std::ofstream f;
	f.open(dbName.c_str(),ios::out | ios::binary);

	int hl[] = {(int) hashLength};
	int fl[] = {(int) fullLength};

	f.write((char*)&hl, sizeof(int));
	f.write((char*)&fl, sizeof(int));

	for (int toPrint=0; toPrint< 1 << (2 * hashLength); toPrint++)
	{
		storeTreeHelp(root[toPrint], f);
	}
	f.close();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x3420
movq (%r14), %rsi
movq %r15, %rdi
movl $0x14, %edx
callq 0x3050
movl (%rbx), %eax
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
movl 0x4(%rbx), %eax
movl %eax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
movl $0x4, %edx
callq 0x3350
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movl $0x4, %edx
callq 0x3350
xorl %r15d, %r15d
leaq 0x10(%rsp), %r14
movq 0x320(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x6a1e
incq %r15
movb (%rbx), %cl
addb %cl, %cl
movl %r15d, %eax
shrl %cl, %eax
testl %eax, %eax
je 0x6b1a
leaq 0x10(%rsp), %rdi
callq 0x3380
movq 0x646f(%rip), %rax      # 0xcfc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x18(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x10(%rsp,%rcx)
callq 0x3210
leaq 0x108(%rsp), %rdi
callq 0x30f0
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r14
popq %r15
retq
jmp 0x6b8d
jmp 0x6b8d
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x33a0
movq %rbx, %rdi
callq 0x3450
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]optimal-seed-solver/HashTree.cc
// Function: HashTree::readBinaryTree(TreeNode*&, std::basic_ifstream<char, std::char_traits<char>>&)
void HashTree::readBinaryTree(TreeNode *&p, ifstream &fin) {
	//TODO: handle exceptions
	int curr[1];
	fin.read((char*)curr, sizeof(int));
	unsigned int currNum = (unsigned int)(curr[0]);
	if(currNum == 0)
		return;
	else
	{
		TreeNode *a = NULL;
		TreeNode *c = NULL;
		TreeNode *g = NULL;
		TreeNode *t = NULL;

		readBinaryTree(a, fin);
		readBinaryTree(c, fin);
		readBinaryTree(g, fin);
		readBinaryTree(t, fin);
		if (a == NULL && c == NULL && g == NULL && t == NULL) {
			p = new LeafNode(currNum);
		}
		else {
			p = new TreeNode(currNum);
			p->setA(a);
			p->setC(c);
			p->setG(g);
			p->setT(t);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x1c(%rsp), %r12
movl $0x4, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x3310
movl (%r12), %r12d
testl %r12d, %r12d
je 0x6cd7
movq %rbx, 0x8(%rsp)
xorl %eax, %eax
leaq 0x10(%rsp), %rcx
movq %rax, (%rcx)
movq %rcx, %rsi
leaq 0x30(%rsp), %r13
movq %rax, (%r13)
leaq 0x28(%rsp), %rbp
movq %rax, (%rbp)
leaq 0x20(%rsp), %rbx
movq %rax, (%rbx)
movq %r15, %rdi
movq %r14, %rdx
callq 0x6ba2
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x6ba2
movq %r15, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x6ba2
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x6ba2
leaq 0x10(%rsp), %rax
movq (%rax), %r14
movq (%r13), %r15
movq (%rbp), %r13
movq (%rbx), %rbx
movq %rbx, %xmm0
movq %r13, %xmm1
punpcklqdq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0]
movq %r15, %xmm0
movq %r14, %xmm2
punpcklqdq %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0]
por %xmm1, %xmm2
pxor %xmm0, %xmm0
pcmpeqd %xmm0, %xmm2
movmskps %xmm2, %eax
xorl $0xf, %eax
je 0x6ca9
movl $0x38, %edi
callq 0x3270
leaq 0x6078(%rip), %rcx      # 0xcd08
movq %rcx, (%rax)
movl %r12d, 0x8(%rax)
movq %r14, 0x18(%rax)
movq %r15, 0x20(%rax)
movq %r13, 0x28(%rax)
movq %rbx, 0x30(%rax)
jmp 0x6ccf
movl $0x40, %edi
callq 0x3270
movl %r12d, 0x8(%rax)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x18(%rax)
movdqu %xmm0, 0x28(%rax)
leaq 0x607c(%rip), %rcx      # 0xcd48
movq %rcx, (%rax)
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]optimal-seed-solver/HashTree.cc
// Function: HashTree::loadTree(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void HashTree::loadTree(string dbName)
{
	std::ifstream f;
	f.open(dbName.c_str(),ios::in | ios::binary);
	if(f.is_open())
	{
		f.seekg(0, ios::beg);

		int curr[1];
		f.read((char*)(&curr), sizeof(int));
		unsigned int hashLength = (unsigned int)(curr[0]);

		int curr2[1];
		f.read((char*)(&curr2), sizeof(int));
		unsigned int fullLength = (unsigned int)(curr2[0]);

		this->hashLength = hashLength;
		this->fullLength = fullLength;

		unsigned int tbsize = 1 << (2 * hashLength);
		this->root = new TreeNode*[tbsize];

		for (int i = 0; i < tbsize; i++)
			this->root[i] = NULL;

		for(int i = 0; i < tbsize; i++)
		{
			readBinaryTree(this->root[i], f);
		}

		f.close();
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x32c0
movq (%r14), %rsi
movq %r15, %rdi
movl $0xc, %edx
callq 0x3180
leaq 0x80(%rsp), %rdi
callq 0x30b0
testb %al, %al
je 0x6dd7
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3370
leaq 0x8(%rsp), %rdi
leaq 0x4(%rsp), %rsi
movl $0x4, %edx
callq 0x3310
movl 0x4(%rsp), %ebp
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
movl $0x4, %edx
callq 0x3310
movl (%rsp), %eax
movl %ebp, (%rbx)
movl %eax, 0x4(%rbx)
addl %ebp, %ebp
movl $0x1, %r15d
movl %ebp, %ecx
shll %cl, %r15d
leaq (,%r15,8), %rdi
callq 0x3030
movq %rax, 0x320(%rbx)
xorl %eax, %eax
movq 0x320(%rbx), %rcx
movq $0x0, (%rcx,%rax,8)
incq %rax
cmpq %rax, %r15
jne 0x6d90
xorl %r12d, %r12d
leaq 0x8(%rsp), %r14
movq 0x320(%rbx), %rsi
addq %r12, %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x6ba2
addq $0x8, %r12
decq %r15
jne 0x6daf
leaq 0x8(%rsp), %rdi
callq 0x3090
leaq 0x8(%rsp), %rdi
callq 0x30c0
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6df9
jmp 0x6df9
jmp 0x6df9
jmp 0x6df9
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x3450
// File: /workspace/github_cpp_makefile_star2_O3/AnthonyCalandra[P]chip8-emu/src/keypad.cc
// Function: Keypad::isPressed(char)
bool Keypad::isPressed(const char keyCode) {
  auto keyState = this->keymap.find(keyCode);
  if (keyState == this->keymap.end()) {
    return false;
  } else {
    return keyState->second;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq -0x1(%rbp), %rax
movb %sil, (%rax)
movq %rax, %rsi
callq 0x3ba6
testq %rax, %rax
je 0x3b5d
movb 0x9(%rax), %al
jmp 0x3b5f
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/AnthonyCalandra[P]chip8-emu/src/sdlutils.cc
// Function: gameLoop(SDL_Window*, SDL_Renderer*)
void gameLoop(SDL_Window* window, SDL_Renderer* renderer) {
  SDL_Event event;
  buffer.clear();
  while (!quit) {
    while (SDL_PollEvent(&event)) {
      if (event.type == SDL_QUIT) {
        quit = true;
      }

      if (event.type == SDL_KEYDOWN) {
        SDL_Keycode keyCode = event.key.keysym.sym;
        if (isChip8KeyEvent(keyCode)) {
          const char* keyName = SDL_GetKeyName(keyCode);
          keypad.pressedDown(keyName[0]);
          if (!keySent) {
            keyPressPromise.set_value(keyName[0]);
            keySent = true;
          }
        }
      } else if (event.type == SDL_KEYUP) {
        SDL_Keycode keyCode = event.key.keysym.sym;
        if (isChip8KeyEvent(keyCode)) {
          const char* keyName = SDL_GetKeyName(keyCode);
          keypad.pressedUp(keyName[0]);
        }
      }
    }

    if (drawFlag) {
      renderTexture(renderer, buffer, 0, 0);
      SDL_RenderPresent(renderer);
      drawFlag = false;
    }

    SDL_Delay(5);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
leaq 0xb429(%rip), %rdi      # 0xf330
callq 0x4b5c
movb 0xd447(%rip), %al       # 0x11359
testb $0x1, %al
jne 0x402b
leaq -0x68(%rbp), %r14
leaq 0xb3d3(%rip), %r12      # 0xf2f8
leaq -0x29(%rbp), %r15
movq %r14, %rdi
callq 0x31c0
testl %eax, %eax
je 0x3fe6
movl -0x68(%rbp), %eax
cmpl $0x301, %eax            # imm = 0x301
je 0x3fb4
cmpl $0x300, %eax            # imm = 0x300
je 0x3f5b
cmpl $0x100, %eax            # imm = 0x100
jne 0x3f29
movb $0x1, %al
xchgb %al, 0xd400(%rip)       # 0x11359
jmp 0x3f29
movl -0x54(%rbp), %edi
leal -0x30(%rdi), %eax
cmpl $0xa, %eax
setae %al
leal -0x61(%rdi), %ecx
cmpl $0x6, %ecx
setae %cl
testb %cl, %al
jne 0x3f29
callq 0x33c0
movq %rax, %r13
movsbl (%rax), %esi
movq %r12, %rdi
callq 0x3b86
movb 0xd3cd(%rip), %al       # 0x1135a
testb $0x1, %al
jne 0x3f29
movb (%r13), %al
movb %al, -0x29(%rbp)
leaq 0xd3c1(%rip), %rdi      # 0x11360
movq %r15, %rsi
callq 0x4258
movb $0x1, %al
xchgb %al, 0xd3ab(%rip)       # 0x1135a
jmp 0x3f29
movl -0x54(%rbp), %edi
leal -0x30(%rdi), %eax
cmpl $0xa, %eax
setae %al
leal -0x61(%rdi), %ecx
cmpl $0x6, %ecx
setae %cl
testb %cl, %al
jne 0x3f29
callq 0x33c0
movsbl (%rax), %esi
movq %r12, %rdi
callq 0x3b66
jmp 0x3f29
movb 0xd36c(%rip), %al       # 0x11358
testb $0x1, %al
je 0x4013
movq %rbx, %rdi
leaq 0xb336(%rip), %rsi      # 0xf330
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x403a
movq %rbx, %rdi
callq 0x30a0
xorl %eax, %eax
xchgb %al, 0xd345(%rip)       # 0x11358
movl $0x5, %edi
callq 0x3230
movb 0xd336(%rip), %al       # 0x11359
testb $0x1, %al
je 0x3f29
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/AnthonyCalandra[P]chip8-emu/src/videobuffer.cc
// Function: VideoBuffer::getBuffer()
VideoBufferType VideoBuffer::getBuffer() {
  this->mutex.lock();
  VideoBufferType copyBuffer = this->buffer;
  this->mutex.unlock();
  return copyBuffer;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x2000(%rsi), %r14
movq %r14, %rdi
callq 0x3430
testl %eax, %eax
jne 0x4be5
movl $0x2000, %edx           # imm = 0x2000
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3280
movq %r14, %rdi
callq 0x3260
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x31e0
// File: /workspace/github_cpp_makefile_star2_O3/AnthonyCalandra[P]chip8-emu/src/cpu.cc
// Function: executeChipCpu(Registers, MemoryStore, Stack)
void executeChipCpu(Registers registers, MemoryStore memory, Stack stack) {
  while (!quit) {
    performCpuCycle(registers, memory, stack);
    // Sleep for about 60 times a second.
    std::this_thread::sleep_for(std::chrono::milliseconds(15));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0xa751(%rip), %r13      # 0x11359
movb (%r13), %al
testb $0x1, %al
jne 0x6c62
movq %rdi, %rbx
leaq 0x1010(%rbp), %r14
leaq 0x10(%rbp), %r15
leaq -0x38(%rbp), %r12
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x6948
movq $0x0, -0x38(%rbp)
movq $0xe4e1c0, -0x30(%rbp)  # imm = 0xE4E1C0
movq %r12, %rdi
movq %r12, %rsi
callq 0x3100
cmpl $-0x1, %eax
jne 0x6c5a
callq 0x3060
cmpl $0x4, (%rax)
je 0x6c40
movb (%r13), %al
testb $0x1, %al
je 0x6c22
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlvis/flow.cpp
// Function: PortalFlow(portal_t*)
void            PortalFlow(portal_t* p)
{
    threaddata_t    data;
    unsigned        i;

    if (p->status != stat_working)
        Error("PortalFlow: reflowed");

    p->visbits = (byte*)calloc(1, g_bitbytes);

    memset(&data, 0, sizeof(data));
    data.leafvis = p->visbits;
    data.base = p;

    data.pstack_head.head = &data.pstack_head;
    data.pstack_head.portal = p;
    data.pstack_head.source = p->winding;
    data.pstack_head.portalplane = &p->plane;
    for (i = 0; i < g_bitlongs; i++)
    {
        ((long*)data.pstack_head.mightsee)[i] = ((long*)p->mightsee)[i];
    }
    RecursiveLeafFlow(p->leaf, &data, &data.pstack_head);

#ifdef ZHLT_NETVIS
    p->fromclient = g_clientid;
#endif
    p->status = stat_done;
#ifdef ZHLT_NETVIS
    Flag_VIS_DONE_PORTAL(g_visportalindex);
#endif
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x14f0, %rsp           # imm = 0x14F0
movq %rdi, %rbx
cmpl $0x1, 0x20(%rdi)
je 0xc81f
leaq 0x8c90(%rip), %rdi      # 0x154a8
xorl %eax, %eax
callq 0x8cb4
leaq 0x2092f72(%rip), %rax   # 0x209f798
movl (%rax), %esi
movl $0x1, %edi
callq 0x3160
movq %rax, %r15
movq %rax, 0x28(%rbx)
leaq 0x10(%rsp), %r14
movl $0x14e0, %edx           # imm = 0x14E0
movq %r14, %rdi
xorl %esi, %esi
callq 0x3120
movq %r15, -0x10(%r14)
movq %rbx, -0x8(%r14)
movq %r14, 0x1000(%r14)
movq %rbx, 0x1010(%r14)
movq 0x18(%rbx), %rax
movq %rax, 0x1018(%r14)
movq %rbx, 0x14c8(%r14)
leaq 0x2092f20(%rip), %rax   # 0x209f79c
movl (%rax), %eax
testq %rax, %rax
je 0xc89a
movq 0x30(%rbx), %rcx
xorl %edx, %edx
movq (%rcx,%rdx,8), %rsi
movq %rsi, 0x10(%rsp,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0xc889
movl 0x10(%rbx), %edi
movq %rsp, %rsi
movq %r14, %rdx
callq 0xc8bc
movl $0x2, 0x20(%rbx)
addq $0x14f0, %rsp           # imm = 0x14F0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlvis/flow.cpp
// Function: SimpleFlood(unsigned char*, int, unsigned char*, unsigned int*)
static void     SimpleFlood(byte* const srcmightsee, const int leafnum, byte* const portalsee, unsigned int* const c_leafsee)
{
    unsigned        i;
    leaf_t*         leaf;
    portal_t*       p;

    {
        const unsigned  offset = leafnum >> 3;
        const unsigned  bit = (1 << (leafnum & 7));
    
        if (srcmightsee[offset] & bit)
        {
            return;
        }
        else
        {
            srcmightsee[offset] |= bit;
        }
    }

    (*c_leafsee)++;
    leaf = &g_leafs[leafnum];

    for (i = 0; i < leaf->numportals; i++)
    {
        p = leaf->portals[i];
        if (!portalsee[p - g_portals])
        {
            continue;
        }
        SimpleFlood(srcmightsee, p->leaf, portalsee, c_leafsee);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
movl %esi, %eax
sarl $0x3, %eax
movl %esi, %ecx
andb $0x7, %cl
movl $0x1, %edx
shll %cl, %edx
movzbl (%rdi,%rax), %ecx
movl %esi, %edi
andl $0x7, %edi
btl %edi, %ecx
jb 0xd036
orb %cl, %dl
movb %dl, (%r15,%rax)
incl (%rbx)
leaq 0x20927ab(%rip), %rax   # 0x209f770
movq (%rax), %r12
movslq %esi, %rax
imulq $0x810, %rax, %rcx      # imm = 0x810
movl (%r12,%rcx), %eax
testl %eax, %eax
je 0xd036
addq %rcx, %r12
leaq 0x2092784(%rip), %rcx   # 0x209f768
movq (%rcx), %rcx
xorl %ebp, %ebp
movabsq $-0x71c71c71c71c71c7, %r13 # imm = 0x8E38E38E38E38E39
movq 0x10(%r12,%rbp,8), %rdx
movq %rdx, %rsi
subq %rcx, %rsi
sarq $0x3, %rsi
imulq %r13, %rsi
cmpb $0x0, (%r14,%rsi)
je 0xd02c
movl 0x10(%rdx), %esi
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xcf7f
leaq 0x2092743(%rip), %rax   # 0x209f768
movq (%rax), %rcx
movl (%r12), %eax
incq %rbp
movl %eax, %edx
cmpq %rdx, %rbp
jb 0xcff3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlvis/vis.cpp
// Function: SaveVisData(char const*)
void		SaveVisData(const char *filename)
{
	int i;
	FILE *fp = fopen(filename, "wb");

	if(!fp)
		return;

	SafeWrite(fp, g_dvisdata, (vismap_p - g_dvisdata));

	// BUG BUG BUG!
	// Leaf offsets need to be saved too!!!!
	for(i = 0; i < g_numleafs; i++)
	{
		SafeWrite(fp, &g_dleafs[i].visofs, sizeof(int));
	}

	fclose(fp);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x4869(%rip), %rsi      # 0x139a6
callq 0x32a0
testq %rax, %rax
je 0xf1ae
movq %rax, %rbx
movl 0x20e0670(%rip), %edx   # 0x20ef7c0
leaq 0x15179(%rip), %rsi     # 0x242d0
subl %esi, %edx
movq %rax, %rdi
callq 0x85cc
leaq 0xa1519c(%rip), %r15    # 0xa24304
cmpl $0x0, (%r15)
jle 0xf19b
leaq 0xa1519b(%rip), %r14    # 0xa24310
addq $0x4, %r14
xorl %r12d, %r12d
movq %rbx, %rdi
movq %r14, %rsi
movl $0x4, %edx
callq 0x85cc
incq %r12
movslq (%r15), %rax
addq $0x1c, %r14
cmpq %rax, %r12
jl 0xf17c
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3220
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlvis/vis.cpp
// Function: VisLeafnumForPoint(float const*)
int        VisLeafnumForPoint(const vec3_t point)
{
    int             nodenum;
    vec_t           dist;
    dnode_t*        node;
    dplane_t*       plane;

    nodenum = 0;
    while (nodenum >= 0)
    {
        node = &g_dnodes[nodenum];
        plane = &g_dplanes[node->planenum];
        dist = DotProduct(point, plane->normal) - plane->dist;
        if (dist >= 0.0)
        {
            nodenum = node->children[0];
        }
        else
        {
            nodenum = node->children[1];
        }
    }

    return -nodenum - 2;
}

// Assembly:
movss (%rdi), %xmm0
movss 0x4(%rdi), %xmm1
movss 0x8(%rdi), %xmm2
xorl %edx, %edx
leaq 0x10b507f(%rip), %rax   # 0x10c4250
leaq 0xaf5068(%rip), %rcx    # 0xb04240
xorps %xmm3, %xmm3
movl %edx, %edx
leaq (%rdx,%rdx,2), %rdx
leaq (%rax,%rdx,8), %rdx
movslq (%rdx), %rsi
leaq (%rsi,%rsi,4), %rsi
movss 0x4(%rcx,%rsi,4), %xmm4
mulss %xmm1, %xmm4
movss (%rcx,%rsi,4), %xmm5
mulss %xmm0, %xmm5
addss %xmm4, %xmm5
movss 0x8(%rcx,%rsi,4), %xmm4
mulss %xmm2, %xmm4
addss %xmm5, %xmm4
subss 0xc(%rcx,%rsi,4), %xmm4
xorl %esi, %esi
ucomiss %xmm3, %xmm4
setb %sil
movswl 0x4(%rdx,%rsi,2), %edx
testl %edx, %edx
jns 0xf1db
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
subl %edx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlvis/zones.cpp
// Function: Zones::getZoneFromBounds(BoundingBox const&)
UINT32 Zones::getZoneFromBounds(const BoundingBox& bounds)
{
    UINT32 x;
    for (x=0; x<m_ZoneCount; x++)
    {
        if (m_ZoneBounds[x].testSuperset(bounds))
        {
            return x;
        }
    }
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, 0x8(%rdi)
je 0x10d10
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
xorl %ebx, %ebx
movq 0x20(%r15), %rsi
addq %r12, %rsi
movq %r14, %rdi
callq 0x112c4
testb %al, %al
jne 0x10d12
incq %rbx
movl 0x8(%r15), %eax
addq $0x18, %r12
cmpq %rax, %rbx
jb 0x10ced
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlvis/zones.cpp
// Function: Zones::getZoneFromWinding(Winding const&)
UINT32 Zones::getZoneFromWinding(const Winding& winding)
{
    UINT32          x;
    BoundingBox     bounds;

    for (x=0; x<winding.m_NumPoints; x++)
    {
        bounds.add(winding.m_Points[x]);
    }

    return getZoneFromBounds(bounds);
}

// Assembly:
subq $0x18, %rsp
movaps 0x4575(%rip), %xmm0     # 0x152a0
movaps %xmm0, (%rsp)
movsd 0x4549(%rip), %xmm0     # 0x15280
movsd %xmm0, 0x10(%rsp)
movl 0x8(%rsi), %ecx
testq %rcx, %rcx
je 0x10dc4
movq 0x10(%rsi), %rax
shlq $0x2, %rcx
leaq (%rcx,%rcx,2), %rcx
movss 0x458b(%rip), %xmm0     # 0x152e4
movss 0x457f(%rip), %xmm1     # 0x152e0
xorl %edx, %edx
movaps %xmm1, %xmm2
movaps %xmm0, %xmm3
movaps %xmm1, %xmm4
movaps %xmm0, %xmm5
movss (%rax,%rdx), %xmm6
minss %xmm6, %xmm1
movss %xmm1, (%rsp)
maxss %xmm6, %xmm0
movss %xmm0, 0xc(%rsp)
movss 0x4(%rax,%rdx), %xmm6
minss %xmm6, %xmm2
movss %xmm2, 0x4(%rsp)
maxss %xmm6, %xmm3
movss %xmm3, 0x10(%rsp)
movss 0x8(%rax,%rdx), %xmm6
minss %xmm6, %xmm4
movss %xmm4, 0x8(%rsp)
maxss %xmm6, %xmm5
movss %xmm5, 0x14(%rsp)
addq $0xc, %rdx
cmpq %rdx, %rcx
jne 0x10d6f
movq %rsp, %rsi
callq 0x10cd4
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlvis/zones.h
// Function: Zones::Zones(unsigned int)
Zones(UINT32 ZoneCount)
    {
        m_ZoneCount = ZoneCount + 1;    // Zone 0 is used for all points outside all nodes
        m_ZoneVisMatrix = new bool[m_ZoneCount * m_ZoneCount];
        memset(m_ZoneVisMatrix, 0, sizeof(bool) * m_ZoneCount * m_ZoneCount);
        m_ZonePtrs = new bool*[m_ZoneCount];
        m_ZoneBounds = new BoundingBox[m_ZoneCount];

        UINT32 x;
        bool* dstPtr = m_ZoneVisMatrix;
        bool** srcPtr = m_ZonePtrs;
        for (x=0; x<m_ZoneCount; x++, srcPtr++, dstPtr += m_ZoneCount)
        {
            *srcPtr = dstPtr;
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r12d
movq %rdi, %r14
leaq 0x9b82(%rip), %rax      # 0x1ad80
movq %rax, (%rdi)
leal 0x1(%r12), %ebp
movl %ebp, 0x8(%rdi)
movl %ebp, %edi
imull %edi, %edi
callq 0x3040
movq %rax, %rbx
movq %rax, 0x10(%r14)
movq %rbp, %rdx
imulq %rbp, %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0x3120
leaq (,%rbp,8), %r13
movq %r13, %rdi
callq 0x3040
movq %rax, %r15
movq %rax, 0x18(%r14)
leaq (,%rbp,2), %rax
addq %rbp, %rax
leaq 0x8(,%rax,8), %rdi
callq 0x3040
leaq 0x8(%rax), %rcx
movq %rbp, (%rax)
incl %r12d
jne 0x1126c
movq %rcx, 0x20(%r14)
jmp 0x112b5
leaq (,%r13,2), %rdx
addq %r13, %rdx
xorl %esi, %esi
movaps 0x4020(%rip), %xmm0     # 0x152a0
movsd 0x3ff8(%rip), %xmm1     # 0x15280
movups %xmm0, 0x8(%rax,%rsi)
movsd %xmm1, 0x18(%rax,%rsi)
addq $0x18, %rsi
cmpq %rsi, %rdx
jne 0x11288
movq %rcx, 0x20(%r14)
testq %rbp, %rbp
je 0x112b5
xorl %eax, %eax
movq %rbx, (%r15,%rax,8)
addq %rbp, %rbx
incq %rax
cmpl %eax, %ebp
jne 0x112a7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq