LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/lrq3000[P]rfrb/./src/fileHandler.cpp
// Function: FileHandler::addImage(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void FileHandler::addImage(std::string path)
{
	if (inFiles.size()==0)
	{
		maxBufferSize = (BUFLENGTH/1+1)/2*2;
		maxBufferSize = maxBufferSize/BLOCKSIZE;
		maxBufferSize = maxBufferSize*BLOCKSIZE;
		maxBufferSize = std::min(maxBufferSize,256*1024*1024);
		FileReader *a = new FileReader(path,maxBufferSize);
		inFiles.push_back(a);
	}
	else
	{
		FileReader *a = new FileReader(path,maxBufferSize);
		inFiles.push_back(a);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %r12
movq %rdi, %r14
leaq 0x40(%rdi), %rbx
movq 0x48(%rdi), %rax
cmpq 0x40(%rdi), %rax
je 0x89ea
movl $0x2b8, %edi            # imm = 0x2B8
callq 0x53d0
movq %rax, %r15
leaq 0x20(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x7f0e
movslq 0x14a02(%rip), %rdx     # 0x1d3d8
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0x107b2
movq 0x10(%rsp), %rdi
jmp 0x8a39
movl $0x10000000, 0x149e4(%rip) # imm = 0x10000000
movl $0x2b8, %edi            # imm = 0x2B8
callq 0x53d0
movq %rax, %r15
leaq 0x40(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0x7f0e
movslq 0x149b1(%rip), %rdx     # 0x1d3d8
leaq 0x30(%rsp), %rsi
movq %r15, %rdi
callq 0x107b2
movq 0x30(%rsp), %rdi
cmpq %r13, %rdi
je 0x8a43
callq 0x5390
movq %r15, 0x8(%rsp)
movq 0x48(%r14), %rsi
cmpq 0x50(%r14), %rsi
je 0x8a5c
movq %r15, (%rsi)
addq $0x8, 0x48(%r14)
jmp 0x8a69
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0xe226
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x30(%rsp), %rdi
jmp 0x8a8b
jmp 0x8a97
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x8a9a
callq 0x5390
jmp 0x8a9a
movq %rax, %rbx
movq %r15, %rdi
callq 0x5390
movq %rbx, %rdi
callq 0x5650
// File: /workspace/github_cpp_makefile_star2_O3/lrq3000[P]rfrb/./src/fileReader.cpp
// Function: FileReader::setOffset(unsigned long)
void FileReader::setOffset(size_t off)
{
	offset = off - getGlobalAdress();
	while (static_cast<size_t>(offset)+blockSize > getNumberOfElements())
	{
		reloadBuffer();
		offset = off - getGlobalAdress();
	}
	this->readSize = std::min(blockSize, getNumberOfElements()-offset);
	block = &getBuffer()[offset];
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
callq 0x11572
movq %r14, %r15
subq %rax, %r15
movq %r15, 0x2a8(%rbx)
addq 0x2b0(%rbx), %r15
movq %rbx, %rdi
callq 0x11528
movq %rbx, %rdi
cmpq %rax, %r15
jbe 0x108c0
callq 0x108fe
movq %rbx, %rdi
jmp 0x1088d
callq 0x11528
subq 0x2a8(%rbx), %rax
movq 0x2b0(%rbx), %rcx
cmpq %rcx, %rax
cmovaeq %rcx, %rax
movq %rax, 0x2a0(%rbx)
movq %rbx, %rdi
callq 0x11538
addq 0x2a8(%rbx), %rax
movq %rax, 0x298(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/lrq3000[P]rfrb/./src/fileReader.cpp
// Function: FileReader::reloadBuffer()
bool FileReader::reloadBuffer()
{
	bool ret = Buffered_FileReader::reloadBuffer();
	offset = 0;
	block = Buffered_FileReader::getBuffer();
	readSize = std::min(blockSize, Buffered_FileReader::getNumberOfElements()-blockSize);
	return ret;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x112da
movl %eax, %ebp
movq $0x0, 0x2a8(%rbx)
movq %rbx, %rdi
callq 0x11538
movq %rax, 0x298(%rbx)
movq %rbx, %rdi
callq 0x11528
movq 0x2b0(%rbx), %rcx
subq %rcx, %rax
cmpq %rcx, %rax
cmovaeq %rcx, %rax
movq %rax, 0x2a0(%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lrq3000[P]rfrb/./src/fileReader.cpp
// Function: FileReader::calcEntropyOfCurrentBlock()
float FileReader::calcEntropyOfCurrentBlock()
{
	float ret = 0.0f;
	unsigned int possibleVals[256]={};
	for (unsigned int i = 0; i < readSize; ++i)
	{
		possibleVals[(unsigned char)block[i]] += 1;
	}
	float tmp;
	if (possibleVals[0] == readSize)
		return 0.0f;
	for (unsigned int i = 0; i < 256; ++i)
	{
		tmp = (float)possibleVals[i]/(float)readSize;
		if (tmp>0)
			ret += -tmp * std::log2(tmp);
	}
	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movq %rdi, %rbx
leaq 0x10(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x51e0
movq 0x2a0(%rbx), %rax
xorps %xmm1, %xmm1
testq %rax, %rax
je 0x10a5e
movq 0x298(%rbx), %rcx
xorl %edx, %edx
movzbl (%rcx,%rdx), %esi
incl 0x10(%rsp,%rsi,4)
incq %rdx
movl %edx, %esi
cmpq %rsi, %rax
ja 0x109c6
movl 0x10(%rsp), %ecx
cmpq %rcx, %rax
je 0x10a5e
xorps %xmm2, %xmm2
xorl %r14d, %r14d
xorps %xmm1, %xmm1
movq 0x2a0(%rbx), %rax
testq %rax, %rax
js 0x10a00
xorps %xmm3, %xmm3
cvtsi2ss %rax, %xmm3
jmp 0x10a18
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm3, %xmm3
cvtsi2ss %rax, %xmm3
addss %xmm3, %xmm3
movl 0x10(%rsp,%r14,4), %eax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
divss %xmm3, %xmm0
ucomiss %xmm2, %xmm0
jbe 0x10a52
movss %xmm1, 0xc(%rsp)
movss %xmm0, 0x8(%rsp)
callq 0x54c0
xorps %xmm2, %xmm2
movss 0xc(%rsp), %xmm1
mulss 0x8(%rsp), %xmm0
subss %xmm0, %xmm1
incq %r14
cmpq $0x100, %r14            # imm = 0x100
jne 0x109ea
movaps %xmm1, %xmm0
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/lrq3000[P]rfrb/./src/fileReader.cpp
// Function: FileReader::emptyBlock()
bool FileReader::emptyBlock()
{
	char *tmp = getBuffer();
	for (size_t i = 0; i < getNumberOfElements(); ++i)
		if (tmp[i] > 0)
			return false;
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x11538
movq %rax, %r14
movq %rbx, %rdi
callq 0x11528
testq %rax, %rax
je 0x10aab
xorl %r15d, %r15d
cmpb $0x0, (%r14,%r15)
setle %bpl
jg 0x10aae
incq %r15
movq %rbx, %rdi
callq 0x11528
cmpq %rax, %r15
jb 0x10a8e
jmp 0x10aae
movb $0x1, %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/lrq3000[P]rfrb/./src/fileReader.cpp
// Function: FileReader::findFirstNonemptyBlock()
int64_t FileReader::findFirstNonemptyBlock()
{
	while (newBlock()==true)
	{
		for (size_t j = 0; j < readSize; ++j)
		{
			if (block[j] > 0)
			{
				return (int64_t)getCurrentAdress();
			}
		}
	}
	return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
callq 0x10b20
movq $-0x1, %rbx
testb %al, %al
je 0x10b16
movq 0x2a0(%r14), %rax
testq %rax, %rax
je 0x10af7
movq 0x298(%r14), %rcx
xorl %edx, %edx
cmpb $0x0, (%rcx,%rdx)
jg 0x10b01
incq %rdx
cmpq %rdx, %rax
jne 0x10ae9
movq %r14, %rdi
callq 0x10b20
jmp 0x10ad0
movq 0x2a8(%r14), %r15
movq %r14, %rdi
callq 0x11572
movq %rax, %rbx
addq %r15, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/lrq3000[P]rfrb/./src/fileReader.cpp
// Function: FileReader::newBlock()
bool FileReader::newBlock()
{
	offset += readSize;
	readSize = std::min(getNumberOfElements(), std::min(blockSize, getNumberOfElements()-offset));
	if (readSize == 0)
	{
		bool ret = reloadBuffer();
		block = getBuffer();
		return ret;
	}
	block = &getBuffer()[offset];
	return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x2a0(%rdi), %rax
addq %rax, 0x2a8(%rdi)
callq 0x11528
movq %rax, %r14
movq %rbx, %rdi
callq 0x11528
subq 0x2a8(%rbx), %rax
movq 0x2b0(%rbx), %rcx
cmpq %rcx, %rax
cmovaeq %rcx, %rax
cmpq %r14, %rax
cmovaeq %r14, %rax
movq %rax, 0x2a0(%rbx)
movq %rbx, %rdi
testq %rax, %rax
je 0x10b81
callq 0x11538
addq 0x2a8(%rbx), %rax
movb $0x1, %bpl
jmp 0x10b90
callq 0x108fe
movl %eax, %ebp
movq %rbx, %rdi
callq 0x11538
movq %rax, 0x298(%rbx)
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lrq3000[P]rfrb/./src/fileReader.cpp
// Function: FileReader::findFirstEmptyBlock()
int64_t FileReader::findFirstEmptyBlock()
{
	while (newBlock()==true)
	{
		bool zero = true;
		for (size_t j = 0; j < readSize; ++j)
		{
			if (block[j] > 0)
			{
				zero = false;
				break;
			}
		}
		if (zero == true)
			return (int64_t)getCurrentAdress();
	}
	return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
callq 0x10b20
movq $-0x1, %rbx
testb %al, %al
je 0x10c0c
movq 0x2a0(%r14), %rax
testq %rax, %rax
je 0x10bf7
movq 0x298(%r14), %rcx
xorl %edx, %edx
cmpb $0x0, (%rcx,%rdx)
jg 0x10bed
incq %rdx
cmpq %rdx, %rax
jne 0x10bdd
jmp 0x10bf7
movq %r14, %rdi
callq 0x10b20
jmp 0x10bc4
movq 0x2a8(%r14), %r15
movq %r14, %rdi
callq 0x11572
movq %rax, %rbx
addq %r15, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/lrq3000[P]rfrb/./src/fileReader.cpp
// Function: FileReader::reset()
void FileReader::reset()
{
	Buffered_FileReader::reset();
	offset = 0;
	readSize = std::min(blockSize, Buffered_FileReader::getNumberOfElements());
	block = Buffered_FileReader::getBuffer();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x1157a
movq $0x0, 0x2a8(%rbx)
movq %rbx, %rdi
callq 0x11528
movq 0x2b0(%rbx), %rcx
cmpq %rcx, %rax
cmovbq %rax, %rcx
movq %rcx, 0x2a0(%rbx)
movq %rbx, %rdi
callq 0x11538
movq %rax, 0x298(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/lrq3000[P]rfrb/./src/fileReader.cpp
// Function: FileReader::printBlock()
void FileReader::printBlock()
{
	for (unsigned int i = 0; i < readSize; i = i+16)
	{
		for (int j = 0; j < 16; ++j)
		{
			if (block[i+j] == 0)
			{
				std::cout << ".";
			}
			else
				std::cout << block[i+j];
		}
		std::cout << std::endl;
	}
}

// Assembly:
cmpq $0x0, 0x2a0(%rdi)
je 0x10d37
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r13d, %r13d
movq 0xc308(%rip), %r14      # 0x1cfb0
leaq 0x516c(%rip), %r15      # 0x15e1b
leaq 0x7(%rsp), %r12
movl %r13d, %r13d
xorl %ebp, %ebp
movq 0x298(%rbx), %rax
addq %r13, %rax
movb (%rbp,%rax), %al
testb %al, %al
je 0x10cdc
movb %al, 0x7(%rsp)
movl $0x1, %edx
movq %r14, %rdi
movq %r12, %rsi
jmp 0x10ce7
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x5450
incq %rbp
cmpq $0x10, %rbp
jne 0x10cb9
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5260
addl $0x10, %r13d
cmpq %r13, 0x2a0(%rbx)
ja 0x10cb4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lrq3000[P]rfrb/./src/bufferedFileReader.cpp
// Function: Buffered_FileReader::Buffered_FileReader(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned long)
Buffered_FileReader::Buffered_FileReader(std::string path, size_t size) : m_path(path), m_bufferSize(size)
{
	m_fs.open(m_path.c_str(), std::ifstream::in | std::ifstream::binary);

	if (!(m_fs))
	{
		std::cerr << "ERROR FileReader::FileReader - Couldnt open file: " << path << std::endl;
		exit(EXIT_FAILURE);
	}
	//Get filesize
	m_fs.seekg(0,m_fs.end);
	m_fileSize = m_fs.tellg();
	m_fs.seekg(0,m_fs.beg);

	m_loadBuffer = new char[m_bufferSize];
	m_workBuffer = new char[m_bufferSize];

	m_elements = m_loadedElements = 0;
	m_globalAdress = 0;
	reloadBuffer();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
callq 0x5440
leaq 0x210(%rbx), %r14
leaq 0x220(%rbx), %r13
movq %r13, 0x210(%rbx)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x7f0e
movq %r12, 0x230(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x260(%rbx)
movups %xmm0, 0x270(%rbx)
movups %xmm0, 0x280(%rbx)
movq $0x0, 0x290(%rbx)
movq 0x210(%rbx), %rsi
movq %rbx, %rdi
movl $0xc, %edx
callq 0x5230
movq (%rbx), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%rbx,%rax)
jne 0x11264
movq %rbx, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x54f0
movq %rbx, %rdi
callq 0x5640
movq %rax, 0x208(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x54f0
movq 0x230(%rbx), %r15
movq %r15, %rdi
callq 0x5030
movq %rax, 0x250(%rbx)
movq %r15, %rdi
callq 0x5030
movq %rax, 0x258(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x238(%rbx)
movq $0x0, 0x248(%rbx)
movq %rbx, %rdi
callq 0x112da
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0xbd85(%rip), %rdi      # 0x1cff0
leaq 0x4516(%rip), %rsi      # 0x15788
movl $0x32, %edx
callq 0x5450
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq 0xbd66(%rip), %rdi      # 0x1cff0
callq 0x5450
movq %rax, %rdi
callq 0x5190
movl $0x1, %edi
callq 0x5480
jmp 0x112a8
movq %rax, %r15
jmp 0x112c9
movq %rax, %r15
movq 0x268(%rbx), %rdi
testq %rdi, %rdi
je 0x112bc
callq 0xde06
movq (%r14), %rdi
cmpq %r13, %rdi
je 0x112c9
callq 0x5390
movq %rbx, %rdi
callq 0x50d0
movq %r15, %rdi
callq 0x5650
nop
// File: /workspace/github_cpp_makefile_star2_O3/lrq3000[P]rfrb/./src/bufferedFileReader.cpp
// Function: Buffered_FileReader::reset()
void Buffered_FileReader::reset()
{
	m_localMtx.lock();
	m_fs.clear();
	m_fs.seekg(0, m_fs.beg);
	m_elements = m_loadedElements = 0;
	m_globalAdress = 0;
	m_localMtx.unlock();
	reloadBuffer();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x270(%rdi), %r14
movq %r14, %rdi
callq 0x5540
testl %eax, %eax
jne 0x115dd
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
xorl %esi, %esi
callq 0x5610
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x54f0
xorps %xmm0, %xmm0
movups %xmm0, 0x238(%rbx)
movq $0x0, 0x248(%rbx)
movq %r14, %rdi
callq 0x52a0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x112da
movl %eax, %edi
callq 0x5240
// File: /workspace/github_cpp_makefile_star2_O3/lrq3000[P]rfrb/./src/bufferedFileReader.cpp
// Function: Buffered_FileReader::closeFile()
void Buffered_FileReader::closeFile()
{
	m_localMtx.lock();
	if (m_fs.is_open())
	{
		m_fs.close();
	}
	m_localMtx.unlock();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x270(%rdi), %rbx
movq %rbx, %rdi
callq 0x5540
testl %eax, %eax
jne 0x11622
leaq 0x78(%r14), %rdi
callq 0x50c0
testb %al, %al
je 0x11613
movq %r14, %rdi
callq 0x50a0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x52a0
movl %eax, %edi
callq 0x5240
nop
// File: /workspace/github_cpp_makefile_star2_O3/lrq3000[P]rfrb/./src/fileWriter.cpp
// Function: FileWriter::FileWriter(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned long)
FileWriter::FileWriter(std::string path, size_t bufferS)
{
	outPath = path;
	init = true;
	bufferSize = bufferS;
	workBuffer = new char[bufferSize];
	writeBuffer = new char[bufferSize];
	pos = 0;
	startTime = endTime = 0.0f;
	written = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
callq 0x5620
leaq 0x200(%rbx), %r14
leaq 0x210(%rbx), %r13
movq %r13, 0x200(%rbx)
xorl %eax, %eax
movq %rax, 0x208(%rbx)
movb $0x0, 0x210(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x258(%rbx)
movups %xmm0, 0x268(%rbx)
movups %xmm0, 0x278(%rbx)
movq %rax, 0x288(%rbx)
movq %r14, %rdi
movq %r12, %rsi
callq 0x51d0
movb $0x1, 0x240(%rbx)
movq %r15, 0x238(%rbx)
movq %r15, %rdi
callq 0x5030
movq %rax, 0x290(%rbx)
movq %r15, %rdi
callq 0x5030
movq %rax, 0x298(%rbx)
xorl %eax, %eax
movq %rax, 0x248(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x220(%rbx)
movq %rax, 0x230(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r15
movq 0x288(%rbx), %rdi
testq %rdi, %rdi
je 0x11b9a
callq 0xde06
movq (%r14), %rdi
cmpq %r13, %rdi
je 0x11ba7
callq 0x5390
movq %rbx, %rdi
callq 0x5550
movq %r15, %rdi
callq 0x5650
nop
// File: /workspace/github_cpp_makefile_star2_O3/lrq3000[P]rfrb/./src/fileWriter.cpp
// Function: FileWriter::getTransferRate()
double FileWriter::getTransferRate()
{
	double tmp = endTime - startTime;
	tmp = written/(double)tmp;
	tmp /= 1024.0f;
	tmp *= 1000.0f;
	tmp /= 1024.0f;
	tmp *= 1000.0f;
	return tmp;
}

// Assembly:
movsd 0x228(%rdi), %xmm1
subsd 0x220(%rdi), %xmm1
movsd 0x230(%rdi), %xmm2
unpcklps 0x2421(%rip), %xmm2     # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x2429(%rip), %xmm2     # 0x140a0
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
addsd %xmm2, %xmm0
divsd %xmm1, %xmm0
movsd 0x23e9(%rip), %xmm1     # 0x14078
mulsd %xmm1, %xmm0
movsd 0x3dc5(%rip), %xmm2     # 0x15a60
mulsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
mulsd %xmm2, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O3/lrq3000[P]rfrb/./src/fileWriter.cpp
// Function: FileWriter::writeToFile(char*, unsigned long)
bool FileWriter::writeToFile(char *buf, size_t size)
{
	//Buffer is written async
	size_t counter = 0;
	while (counter < size)
	{
		if (pos >= bufferSize)
		{
			//If the first buffer should be written, the file has to be opened
			if (init == true)
			{
				startTime = endTime = timeU();
				fs.open(outPath.c_str(), std::fstream::out);
				if (!(fs))
				{
					std::cerr << "ERROR FileWriter::FileWriter - Couldnt open file: " << outPath << std::endl;
					exit(EXIT_FAILURE);
				}
				init = false;
			}
			if (writeAsync() == false)
			{
				std::cerr << "Something went terribly wrong! " << std::endl;
				return false;
			}
			continue;
		}
		workBuffer[pos] = buf[counter];
		++pos;
		++counter;
	}
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rdx, %rdx
je 0x11d98
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x200(%rdi), %rax
movq %rax, (%rsp)
movb $0x1, %bl
xorl %ebp, %ebp
leaq 0x8(%rsp), %r13
movq 0x248(%r12), %rax
cmpq 0x238(%r12), %rax
jb 0x11d72
cmpb $0x1, 0x240(%r12)
jne 0x11d5f
movq %r13, %rdi
xorl %esi, %esi
callq 0x55c0
imulq $0xf4240, 0x8(%rsp), %rax # imm = 0xF4240
addq 0x10(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x228(%r12)
movsd %xmm0, 0x220(%r12)
movq 0x200(%r12), %rsi
movq %r12, %rdi
movl $0x10, %edx
callq 0x5060
movq (%r12), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%r12,%rax)
jne 0x11da9
movb $0x0, 0x240(%r12)
movq %r12, %rdi
callq 0x11e02
testb $0x1, %bl
jne 0x11cdc
jmp 0x11d98
movb (%r15,%rbp), %cl
movq 0x290(%r12), %rdx
movb %cl, (%rdx,%rax)
incq 0x248(%r12)
incq %rbp
cmpq %r14, %rbp
setb %bl
jne 0x11cdc
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xb240(%rip), %rdi      # 0x1cff0
leaq 0x3cd9(%rip), %rsi      # 0x15a90
callq 0x53c0
movq %rax, %rdi
movq (%rsp), %rsi
callq 0x5320
movq %rax, %rdi
callq 0x5190
movl $0x1, %edi
callq 0x5480
// File: /workspace/github_cpp_makefile_star2_O3/lrq3000[P]rfrb/./src/fileWriter.cpp
// Function: FileWriter::closeFile()
bool FileWriter::closeFile()
{
	//Check if file is open
	if (fs.is_open())
	{
		writeAsync();
		localMtx.lock();
		fs.close();
		localMtx.unlock();
		//Using Unix, the hashsums are calculated
#ifndef WINDOWS
		std::string sys = "md5sum ";
		sys += outPath;
		std::cout << std::endl;
		std::cout << "Hash5 for " << outPath << ":" << std::endl;
		if (system(sys.c_str()))
		{}
		std::cout << std::endl;
#endif
	}
	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
addq $0x70, %rdi
callq 0x50c0
testb %al, %al
je 0x121d2
movq %rbx, %rdi
callq 0x11e02
leaq 0x258(%rbx), %r14
movq %r14, %rdi
callq 0x5540
testl %eax, %eax
jne 0x121de
movq %rbx, %rdi
callq 0x5510
movq %r14, %rdi
callq 0x52a0
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x2a23(%rip), %rsi      # 0x14ae9
leaq 0x2a23(%rip), %rdx      # 0x14af0
movq %rsp, %r14
movq %r14, %rdi
callq 0xe190
movq 0x200(%rbx), %rsi
movq 0x208(%rbx), %rdx
movq %r14, %rdi
callq 0x5100
movq 0xaebb(%rip), %rdi      # 0x1cfb0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %esi
movq 0xaea0(%rip), %rdi      # 0x1cfb0
callq 0x5040
movq %rax, %rdi
callq 0x5260
movq 0xae8c(%rip), %rdi      # 0x1cfb0
leaq 0x29c6(%rip), %rsi      # 0x14af1
movl $0xa, %edx
callq 0x5450
movq 0x200(%rbx), %rsi
movq 0x208(%rbx), %rdx
movq 0xae66(%rip), %rbx      # 0x1cfb0
movq %rbx, %rdi
callq 0x5450
movq %rax, %r14
leaq 0x241d(%rip), %rsi      # 0x14579
movl $0x1, %edx
movq %rax, %rdi
callq 0x5450
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5260
movq (%rsp), %rdi
callq 0x52f0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %esi
movq 0xadf9(%rip), %rdi      # 0x1cfb0
callq 0x5040
movq %rax, %rdi
callq 0x5260
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x121d2
callq 0x5390
movb $0x1, %al
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movl %eax, %edi
callq 0x5240
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x121f6
callq 0x5390
movq %rbx, %rdi
callq 0x5650
// File: /workspace/github_cpp_makefile_star2_O3/lrq3000[P]rfrb/./src/fileWriter.cpp
// Function: FileWriter::setPath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void FileWriter::setPath(std::string path)
{
	closeFile();
	pos = 0;
	outPath = path;
	init = true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x1206a
movq $0x0, 0x248(%r14)
leaq 0x200(%r14), %rdi
movq %rbx, %rsi
callq 0x51d0
movb $0x1, 0x240(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/lrq3000[P]rfrb/./src/fileWriter.cpp
// Function: FileWriter::write()
bool FileWriter::write()
{
	//If file is valid, write
	mtx.lock();
	if(fs.is_open() && fs.good())
	{
		fs.write(writeBuffer, toWrite);
		written += toWrite;
		endTime = timeU();
	}
	mtx.unlock();

	if (fs.bad())
	{
		std::cerr << "Writer is bad" << std::endl;
		return false;
	}
	return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0xb13c(%rip), %rdi      # 0x1d3b0
callq 0x5540
testl %eax, %eax
jne 0x12354
leaq 0x70(%rbx), %rdi
callq 0x50c0
testb %al, %al
je 0x122e5
movq (%rbx), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x20(%rbx,%rax)
jne 0x122e5
movq 0x250(%rbx), %rdx
movq 0x298(%rbx), %rsi
movq %rbx, %rdi
callq 0x54e0
movq 0x250(%rbx), %rax
addq %rax, 0x230(%rbx)
movq %rsp, %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x55c0
imulq $0xf4240, (%r14), %rax  # imm = 0xF4240
addq 0x8(%r14), %rax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x228(%rbx)
leaq 0xb0c4(%rip), %rdi      # 0x1d3b0
callq 0x52a0
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x20(%rbx,%rax), %ebp
testb $0x1, %bpl
je 0x12344
movq 0xace7(%rip), %rbx      # 0x1cff0
leaq 0x37b3(%rip), %rsi      # 0x15ac3
movl $0xd, %edx
movq %rbx, %rdi
callq 0x5450
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5260
testb $0x1, %bpl
sete %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl %eax, %edi
callq 0x5240
nop
// File: /workspace/github_cpp_makefile_star2_O3/lrq3000[P]rfrb/./src/raidRecover.cpp
// Function: RaidRecover::RaidRecover(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
RaidRecover::RaidRecover(std::string inPath, std::string outPath)
{
	outP = outPath;
	inP = inPath;
	handle = new FileHandler(inPath, outPath);
	system = new RaidSystem(handle);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, 0x10(%rsp)
movq %rax, (%rdi)
xorl %eax, %eax
movq %rax, 0x8(%rdi)
movb %al, 0x10(%rdi)
leaq 0x20(%rdi), %r14
leaq 0x30(%rdi), %rcx
movq %rcx, 0x8(%rsp)
movq %rcx, 0x20(%rdi)
movq %rax, 0x28(%rdi)
movb %al, 0x30(%rdi)
movq %rdx, %rsi
callq 0x51d0
movq %r14, %rdi
movq %r13, %rsi
callq 0x51d0
movl $0x68, %edi
callq 0x53d0
movq %rax, %r15
leaq 0x48(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq 0x38(%rsp), %rdi
callq 0x7f0e
leaq 0x28(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq 0x18(%rsp), %rdi
callq 0x7f0e
leaq 0x38(%rsp), %rsi
leaq 0x18(%rsp), %rdx
movq %r15, %rdi
callq 0x82ca
movq %r15, 0x40(%rbx)
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0x12810
callq 0x5390
movq 0x38(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1281f
callq 0x5390
movl $0x30, %edi
callq 0x53d0
movq %rax, %r15
movq 0x40(%rbx), %rsi
movq %rax, %rdi
callq 0x5b96
movq %r15, 0x48(%rbx)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x12875
movq %rax, %r12
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0x12864
callq 0x5390
jmp 0x12864
movq %rax, %r12
movq 0x38(%rsp), %rdi
cmpq %rbp, %rdi
je 0x12878
callq 0x5390
jmp 0x12878
movq %rax, %r12
movq %r15, %rdi
callq 0x5390
jmp 0x12885
movq %rax, %r12
movq (%r14), %rdi
cmpq 0x8(%rsp), %rdi
je 0x12894
callq 0x5390
movq (%rbx), %rdi
cmpq 0x10(%rsp), %rdi
je 0x128a3
callq 0x5390
movq %r12, %rdi
callq 0x5650
nop
// File: /workspace/github_cpp_makefile_star2_O3/lrq3000[P]rfrb/./src/raidRecover.cpp
// Function: RaidRecover::RaidRecover(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
RaidRecover::RaidRecover(std::vector<std::string> paths, std::string outPath)
{
	outP = outPath;
	handle = new FileHandler(outPath);
	for (size_t i = 0; i < paths.size(); ++i)
	{
		handle->addImage(paths.at(i));
	}
	system = new RaidSystem(handle);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r13
leaq 0x10(%rdi), %rax
movq %rax, 0x10(%rsp)
movq %rax, (%rdi)
xorl %eax, %eax
movq %rax, 0x8(%rdi)
movb %al, 0x10(%rdi)
leaq 0x30(%rdi), %rcx
movq %rcx, 0x8(%rsp)
movq %rcx, 0x20(%rdi)
movq %rax, 0x28(%rdi)
movb %al, 0x30(%rdi)
movq %rdx, %rsi
movq %rdi, (%rsp)
callq 0x51d0
movl $0x68, %edi
callq 0x53d0
movq %rax, %r15
leaq 0x48(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq 0x38(%rsp), %rdi
callq 0x7f0e
leaq 0x38(%rsp), %rsi
movq %r15, %rdi
callq 0x81b6
movq %r15, 0x40(%r13)
movq 0x38(%rsp), %rdi
cmpq %rbx, %rdi
je 0x12944
callq 0x5390
movq (%r14), %rax
cmpq %rax, 0x8(%r14)
je 0x129b3
movl $0x8, %ebp
leaq 0x28(%rsp), %r13
xorl %ebx, %ebx
leaq 0x18(%rsp), %r15
movq (%rsp), %rcx
movq 0x40(%rcx), %r12
movq %r13, 0x18(%rsp)
movq -0x8(%rax,%rbp), %rsi
movq (%rax,%rbp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x7f0e
movq %r12, %rdi
movq %r15, %rsi
callq 0x8982
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0x12999
callq 0x5390
incq %rbx
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
addq $0x20, %rbp
cmpq %rcx, %rbx
jb 0x1295e
movl $0x30, %edi
movq (%rsp), %r13
callq 0x53d0
movq %rax, %r15
movq 0x40(%r13), %rsi
movq %rax, %rdi
callq 0x5b96
movq %r15, 0x48(%r13)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x129f9
movq %rax, %r14
movq 0x38(%rsp), %rdi
cmpq %rbx, %rdi
je 0x129fc
callq 0x5390
jmp 0x129fc
movq %rax, %r14
movq %r15, %rdi
jmp 0x12a15
jmp 0x12a03
movq %rax, %r14
jmp 0x12a1a
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0x12a1a
callq 0x5390
movq (%rsp), %rax
movq 0x20(%rax), %rdi
cmpq 0x8(%rsp), %rdi
je 0x12a2e
callq 0x5390
movq (%rsp), %rax
movq (%rax), %rdi
cmpq 0x10(%rsp), %rdi
je 0x12a41
callq 0x5390
movq %r14, %rdi
callq 0x5650
nop
// File: /workspace/github_cpp_makefile_star2_O3/lrq3000[P]rfrb/./src/raidRecover.cpp
// Function: RaidRecover::run()
void RaidRecover::run()
{
	//Set name for recovered dataImage
	std::string o = outP+"dataImage.dd";

	//Start with analysing the case und recover lost data (if possible)
	bool found = system->raidCheck(o);
	std::cout << std::endl;

	//Check if everything went fine
	if (found==true)
		std::cout << "Recovery successful!" << std::endl;
	else
		std::cout << "Recovery was aborted!" << std::endl;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rdi), %rsi
movq 0x8(%rdi), %rdx
addq %rsi, %rdx
movq %rsp, %r14
movq %r14, %rdi
callq 0x7f0e
leaq 0x32bd(%rip), %rsi      # 0x15d56
movq %r14, %rdi
callq 0x5680
movq 0x48(%rbx), %rbx
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0x7f0e
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x602e
movl %eax, %ebx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x12ae2
callq 0x5390
movq 0xa4c7(%rip), %rdi      # 0x1cfb0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %esi
movq 0xa4ac(%rip), %rdi      # 0x1cfb0
callq 0x5040
movq %rax, %rdi
callq 0x5260
leaq 0x324b(%rip), %rax      # 0x15d63
leaq 0x3259(%rip), %rsi      # 0x15d78
testb %bl, %bl
cmovneq %rax, %rsi
movzbl %bl, %edx
xorq $0x15, %rdx
movq 0xa47d(%rip), %rbx      # 0x1cfb0
movq %rbx, %rdi
callq 0x5450
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %esi
movq 0xa457(%rip), %rdi      # 0x1cfb0
callq 0x5040
movq %rax, %rdi
callq 0x5260
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x12b74
callq 0x5390
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x12b97
callq 0x5390
jmp 0x12b97
jmp 0x12b94
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x12ba5
callq 0x5390
movq %rbx, %rdi
callq 0x5650
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/ericprud[P]sean-parent-concept-based-polymorphism/./doc-library.hh
// Function: draw(history_t const&, std::ostream&, unsigned long)
void draw(const history_t& h, std::ostream& out, size_t position)
    {
        out << std::string(position, ' ') << "<history>" << std::endl;
        for (const auto& doc : h.documents)
            draw(doc, out, position + 2);
        out << std::string(position, ' ') << "</history>" << std::endl;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
leaq -0x38(%rbp), %r13
movq %r13, -0x10(%r13)
leaq -0x48(%rbp), %rdi
movq %rdx, %rsi
movl $0x20, %edx
callq 0x2120
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %rbx, %rdi
callq 0x2110
movq %rax, %r12
leaq 0x18c8(%rip), %rsi      # 0x40a5
movl $0x9, %edx
movq %rax, %rdi
callq 0x2110
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x20e0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2090
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x2827
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2100
movq (%r15), %r12
movq 0x8(%r15), %r13
cmpq %r13, %r12
je 0x284e
leaq 0x2(%r14), %r15
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2c60
addq $0x18, %r12
cmpq %r13, %r12
jne 0x2837
leaq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %r15
movq %r15, (%rdi)
movq %r14, %rsi
movl $0x20, %edx
callq 0x2120
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %rbx, %rdi
callq 0x2110
movq %rax, %rbx
leaq 0x182f(%rip), %rsi      # 0x40af
movl $0xa, %edx
movq %rax, %rdi
callq 0x2110
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2090
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x28c9
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2100
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x28da
movq %rax, %rbx
jmp 0x2905
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
jne 0x28f9
jmp 0x2905
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x2905
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2100
movq %rbx, %rdi
callq 0x2180
nop
// File: /workspace/github_cpp_makefile_star2_O3/ericprud[P]sean-parent-concept-based-polymorphism/./doc-library.hh
// Function: draw(document_t const&, std::ostream&, unsigned long)
void draw(const document_t& doc, std::ostream& out, size_t position)
    {
        out << std::string(position, ' ') << "<document>" << std::endl;
        for (const auto& ptr : doc.drawable_ptrs)
            ptr.binding->call_draw(out, position + 2);
        out << std::string(position, ' ') << "</document>" << std::endl;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
leaq -0x38(%rbp), %r13
movq %r13, -0x10(%r13)
leaq -0x48(%rbp), %rdi
movq %rdx, %rsi
movl $0x20, %edx
callq 0x2120
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %rbx, %rdi
callq 0x2110
movq %rax, %r12
leaq 0x140d(%rip), %rsi      # 0x40ba
movl $0xa, %edx
movq %rax, %rdi
callq 0x2110
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x20e0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2090
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x2cf7
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2100
movq (%r15), %r12
movq 0x8(%r15), %r13
cmpq %r13, %r12
je 0x2d20
leaq 0x2(%r14), %r15
movq (%r12), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
movq %r15, %rdx
callq *0x10(%rax)
addq $0x10, %r12
cmpq %r13, %r12
jne 0x2d07
leaq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %r15
movq %r15, (%rdi)
movq %r14, %rsi
movl $0x20, %edx
callq 0x2120
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %rbx, %rdi
callq 0x2110
movq %rax, %rbx
leaq 0x1373(%rip), %rsi      # 0x40c5
movl $0xb, %edx
movq %rax, %rdi
callq 0x2110
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2090
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x2d9b
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2100
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2dac
movq %rax, %rbx
jmp 0x2dd7
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
jne 0x2dcb
jmp 0x2dd7
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x2dd7
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2100
movq %rbx, %rdi
callq 0x2180
nop
// File: /workspace/github_cpp_makefile_star2_O3/khedoros[P]khednes/main.cpp
// Function: get_choice(rom&)
unsigned int get_choice(rom& cart) {
    unsigned int choice = 0;
    while(choice < 1 || choice > cart.get_song_count()) {
        cout<<"Choose a song number between 1 and "<<dec<<cart.get_song_count()<<": ";
        cout.flush();
        cin>>choice;
    }
    return choice;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4(%rsp), %rax
movl $0x0, (%rax)
xorl %r14d, %r14d
movq 0x13627(%rip), %r15     # 0x1bfb0
leaq 0xb982(%rip), %r12      # 0x14312
leaq 0xd22e(%rip), %r13      # 0x15bc5
movq 0x1363a(%rip), %rbp     # 0x1bfd8
testl %r14d, %r14d
je 0x89b0
movq %rbx, %rdi
callq 0x9f88
cmpl %eax, %r14d
jbe 0x8a15
movl $0x23, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x4410
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x18(%r15,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%r15,%rax)
movq %rbx, %rdi
callq 0x9f88
movl %eax, %esi
movq %r15, %rdi
callq 0x4280
movl $0x2, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x4410
movq %r15, %rdi
callq 0x4290
movq %rbp, %rdi
leaq 0x4(%rsp), %rsi
callq 0x4600
movl 0x4(%rsp), %r14d
jmp 0x899e
movl 0x4(%rsp), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/khedoros[P]khednes/main.cpp
// Function: init_nsf(rom&, mem&, cpu&, unsigned int)
bool init_nsf(rom& cart, mem& memi, cpu& cpui, unsigned int choice = 1) {
    cout<<"Playing song "<<dec<<choice<<" out of "<<cart.get_song_count()<<endl;
    cpui.reset(cart.get_rst_addr());
    cpui.set_acc(choice-1);
    cpui.set_x(0);
    for(int i=0;i<0x800;++i)
        memi.write(i,0);
    for(int i=0x6000;i<0x8000;++i)
        memi.write(i,0);
    for(int i=0x4000;i<0x4014;++i)
        memi.write(i,0);
    memi.write(0x4015, 0x0f);
    memi.write(0x4017, 0x40);
    cart.reset_map();
    int ret = 1;
    while(ret) {
        ret = cpui.run_next_op();
        if(ret < 0) return false;
    }
    cpui.reset(cart.get_nmi_addr());
    cout<<"I think I init'ed the program properly."<<endl;
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
movq 0x1356b(%rip), %rbx     # 0x1bfb0
leaq 0xb8ea(%rip), %rsi      # 0x14336
movl $0xd, %edx
movq %rbx, %rdi
callq 0x4410
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rbx,%rax)
movl %ebp, %esi
movq %rbx, %rdi
callq 0x4280
movq %rax, %r13
leaq 0xb8c2(%rip), %rsi      # 0x14344
movl $0x8, %edx
movq %rax, %rdi
callq 0x4410
movq %r15, %rdi
callq 0x9f88
movl %eax, %esi
movq %r13, %rdi
callq 0x4280
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x4390
movsbl %al, %esi
movq %r13, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4290
movq %r15, %rdi
callq 0xa006
movq %r14, %rdi
movl %eax, %esi
callq 0xcd50
decl %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0xcd5a
xorl %ebp, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0xcd54
movq %r12, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0xab46
incl %ebp
cmpl $0x800, %ebp            # imm = 0x800
jne 0x8af5
movl $0x6000, %ebp           # imm = 0x6000
movq %r12, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0xab46
incl %ebp
cmpl $0x8000, %ebp           # imm = 0x8000
jne 0x8b10
movl $0x4000, %ebp           # imm = 0x4000
movq %r12, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0xab46
incl %ebp
cmpl $0x4014, %ebp           # imm = 0x4014
jne 0x8b2b
movq %r12, %rdi
movl $0x4015, %esi           # imm = 0x4015
movl $0xf, %edx
callq 0xab46
movq %r12, %rdi
movl $0x4017, %esi           # imm = 0x4017
movl $0x40, %edx
callq 0xab46
movq %r15, %rdi
callq 0xa084
movl $0x1, %eax
movl %eax, %ebp
testl %eax, %eax
je 0x8b86
movq %r14, %rdi
callq 0xb97e
testl %eax, %eax
jns 0x8b72
jmp 0x8bd3
movq %r15, %rdi
callq 0xa00e
movq %r14, %rdi
movl %eax, %esi
callq 0xcd50
leaq 0xb7ae(%rip), %rsi      # 0x1434d
movl $0x27, %edx
movq %rbx, %rdi
callq 0x4410
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4390
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4290
testl %ebp, %ebp
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/khedoros[P]khednes/rom.cpp
// Function: rom::rom(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
rom::rom(std::string filename, int m) : file(filename), mapper_num(m) {
    valid=load(filename);
    if(valid) {
        print_info();
    }
    else {
        printf("Trying to load as NSF instead\n");
        valid=load_nsf(filename);
        if(nsf) {
            print_nsf_info();
        }
        else {
            print_info();
        }
        if(!valid) {
            printf("Problem loading %s. Make sure it exists and you can read it.\n",filename.c_str());
            exit(1);
        }
    }
    //printf("CHR_PAGE_SIZE: %d sizeof crom: %d crom pages: %d",CHR_PAGE_SIZE,crom_pages,CHR_PAGE_SIZE*crom_pages);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r13
movq %rdi, %r12
leaq 0x10(%rdi), %rbx
leaq 0x28(%rdi), %r14
leaq 0x40(%rdi), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x60(%rdi)
movups %xmm0, 0x50(%rdi)
movups %xmm0, 0x40(%rdi)
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movq %rsi, 0x70(%rdi)
movl %edx, 0x90(%rdi)
callq 0x8dfc
movb %al, 0x8(%r12)
testb %al, %al
je 0x8d6c
movq %r12, %rdi
callq 0x933a
jmp 0x8dad
leaq 0xbac3(%rip), %rdi      # 0x14836
callq 0x4540
movq %r12, %rdi
movq %r13, %rsi
callq 0x96d6
movb %al, 0x8(%r12)
cmpb $0x1, 0xce(%r12)
jne 0x8d9d
movq %r12, %rdi
callq 0x9cd2
jmp 0x8da5
movq %r12, %rdi
callq 0x933a
cmpb $0x0, 0x8(%r12)
je 0x8db7
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq (%r13), %rsi
leaq 0xb69a(%rip), %rdi      # 0x1445c
xorl %eax, %eax
callq 0x4050
movl $0x1, %edi
callq 0x4420
movq %rax, %r13
movq 0x58(%r12), %rdi
testq %rdi, %rdi
je 0x8de5
callq 0x4380
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x4690
movq %r13, %rdi
callq 0x4610
nop
// File: /workspace/github_cpp_makefile_star2_O3/khedoros[P]khednes/mem.cpp
// Function: mem::mem(rom&, ppu&, apu&)
mem::mem(rom &romi, ppu &ppui,apu &apui) : cart(romi), pu(ppui), snd(apui), cycle(0), mouse_x(0), mouse_y(0) {
    ram.resize(0x800);
    sram.resize(0x2000);
    read_from.resize(0x10000, false);
    written_to.resize(0x10000, false);
    for(int i=0;i<8;i++) {
        joy1_buttons[i]=false;
    }
    if(cart.has_sram()) {
        return;
        string infile = cart.filename();
        infile += ".sav";
        cout<<"Trying to open "<<infile<<endl;
        ifstream inf;
        inf.open(infile.c_str());
        if(inf.is_open()) {
            inf.seekg(0,ios::end);
            size_t filesize = inf.tellg();
            inf.seekg(0,ios::beg);
            if(filesize == 0x2000) {
                inf.read(reinterpret_cast<char *>(&(sram[0])), 0x2000);
                cout<<"Loaded "<<infile<<" as save game."<<endl;
            }
            inf.close();
        }
        else cout<<"Couldn't open "<<infile<<" for input."<<endl;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r13
movq %rsi, (%rdi)
movq %rdx, 0x8(%rdi)
movq %rcx, 0x10(%rdi)
movl $0x0, 0x18(%rdi)
leaq 0x20(%rdi), %rbx
leaq 0x38(%rdi), %r14
leaq 0x80(%rdi), %r15
leaq 0x98(%rdi), %r12
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x40(%rdi)
movups %xmm0, 0x68(%rdi)
movups %xmm0, 0x78(%rdi)
movups %xmm0, 0x88(%rdi)
movups %xmm0, 0x98(%rdi)
movq $0x0, 0xa8(%rdi)
movl $0x800, %esi            # imm = 0x800
movq %rbx, %rdi
callq 0xa0bc
movl $0x2000, %esi           # imm = 0x2000
movq %r14, %rdi
callq 0xa0bc
leaq 0xc(%rsp), %rdx
movl $0x0, (%rdx)
movl $0x10000, %esi          # imm = 0x10000
movq %r15, %rdi
callq 0xad0c
leaq 0x8(%rsp), %rdx
movl $0x0, (%rdx)
movl $0x10000, %esi          # imm = 0x10000
movq %r12, %rdi
callq 0xad0c
movb $0x0, 0x70(%r13)
movq (%r13), %rdi
callq 0x9f7a
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0xa636
jmp 0xa636
movq %rax, %r13
movq (%r12), %rdi
testq %rdi, %rdi
je 0xa647
callq 0x4380
movq (%r15), %rdi
testq %rdi, %rdi
je 0xa654
callq 0x4380
movq (%r14), %rdi
testq %rdi, %rdi
je 0xa661
callq 0x4380
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xa66e
callq 0x4380
movq %r13, %rdi
callq 0x4610
// File: /workspace/github_cpp_makefile_star2_O3/khedoros[P]khednes/mem.cpp
// Function: mem::sendkeyup(SDL_Scancode)
void mem::sendkeyup(SDL_Scancode test) {
        //util::debug(ORIGIN,"Key up! (%04x)\n",test);
        switch(test) {
                case SDL_SCANCODE_A:
                        joy1_buttons[6]=false; //left
                        break;
                case SDL_SCANCODE_D:
                        joy1_buttons[7]=false; //right
                        break;
                case SDL_SCANCODE_G:
                        joy1_buttons[2]=false; //select
                        break;
                case SDL_SCANCODE_H:
                        joy1_buttons[3]=false; //start
                        break;
                case SDL_SCANCODE_K:
                        joy1_buttons[1]=false; //b
                        break;
                case SDL_SCANCODE_L:
                        joy1_buttons[0]=false; //a
                        break;
                case SDL_SCANCODE_S:
                        joy1_buttons[5]=false; //down
                        break;
                case SDL_SCANCODE_W:
                        joy1_buttons[4]=false; //up
                        break;
                case SDL_SCANCODE_GRAVE:
                        pu.speedup(false);
                        break;
                case SDL_SCANCODE_X:
                        joy2_trigger=0;
                        break;
                case SDL_SCANCODE_Z:
                        joy2_light=8;
                        break;
                default: //don't really care about the rest of the values =)
                        break;
        }
}

// Assembly:
leal -0x4(%rsi), %eax
cmpl $0xb, %eax
ja 0xa7c3
leaq 0xa183(%rip), %rcx      # 0x14938
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
andb $-0x41, 0x70(%rdi)
retq
leal -0x16(%rsi), %eax
cmpl $0x7, %eax
ja 0xa7e0
leaq 0xa196(%rip), %rcx      # 0x14968
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
andb $-0x21, 0x70(%rdi)
retq
cmpl $0x35, %esi
jne 0xa81d
movq 0x8(%rdi), %rdi
xorl %esi, %esi
jmp 0xfbb4
andb $-0x3, 0x70(%rdi)
retq
andb $-0x5, 0x70(%rdi)
retq
andb $0x7f, 0x70(%rdi)
retq
andb $-0x9, 0x70(%rdi)
retq
andb $-0x2, 0x70(%rdi)
retq
movl $0x0, 0x60(%rdi)
retq
andb $-0x11, 0x70(%rdi)
retq
movl $0x8, 0x64(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O3/khedoros[P]khednes/mem.cpp
// Function: mem::read2(unsigned int)
const unsigned int mem::read2(unsigned int address) {        
        address&=0xFFFF;
        read_from[address]=true;
        read_from[address+1]=true;
        if(address<0x1FFF) { //0x1FFF because I'm returning 2 bytes
                unsigned int temp1=ram[(address+1)&0x7FF];
                temp1<<=(8);
                temp1|=ram[address&0x7FF];
                return temp1;
        }
        if(address>=0x6000&&address<=0x7fff) {
                unsigned int temp1=sram[(address+1)&0x1fff];
                temp1<<=(8);
                temp1|=sram[address&0x1fff];
                return temp1;
        }
        if(address>=0x8000) {
                //unsigned int temp1=cart.get_pbyte(address+1);
                //temp1<<=(8);
                //temp1|=cart.get_pbyte(address);
                //return temp1;
                return cart.get_pword(address);
        }
        util::debug(ORIGIN, "mem read(2) of %04x unhandled. I don't know what the address does.\n",address);
        return 0;
}

// Assembly:
pushq %rbx
movzwl %si, %edx
movq 0x80(%rdi), %rcx
movl $0x1, %r8d
movl %r8d, (%rcx,%rdx,4)
leal 0x1(%rdx), %eax
movl %r8d, (%rcx,%rax,4)
cmpl $0x1ffe, %edx           # imm = 0x1FFE
ja 0xaadd
movl $0x7ff, %ecx            # imm = 0x7FF
andl %ecx, %eax
movq 0x20(%rdi), %rdx
jmp 0xaaf8
movl %esi, %ecx
andl $0xe000, %ecx           # imm = 0xE000
cmpl $0x6000, %ecx           # imm = 0x6000
jne 0xab0b
movl $0x1fff, %ecx           # imm = 0x1FFF
andl %ecx, %eax
movq 0x38(%rdi), %rdx
movzbl (%rdx,%rax), %eax
shll $0x8, %eax
andl %ecx, %esi
movzbl (%rdx,%rsi), %ebx
orl %eax, %ebx
movl %ebx, %eax
popq %rbx
retq
cmpl $0x8000, %edx           # imm = 0x8000
jb 0xab1e
movq (%rdi), %rdi
movl %edx, %esi
popq %rbx
jmp 0xa026
leaq 0x9ee8(%rip), %rsi      # 0x14a0d
xorl %ebx, %ebx
movl $0x3, %edi
xorl %eax, %eax
callq 0xfdca
jmp 0xab07
nop