LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/mgo1977[P]c---parsing-argument-options/./Parser.h
// Function: RangeNumberOption<int>::setValue(char const*)
void setValue(const char* readValue) {

        std::string fullRange = readValue;
        size_t pos = fullRange.find(",");

        std::string begin = fullRange.substr(0, pos); 
        std::string end;

        if ( fullRange.find(",", pos) != std::string::npos ) {
            end = fullRange.substr(pos + 1);
        }

        if ( end.size() != 0 ) {
            ListOption<T>::setValue(begin.c_str());
            ListOption<T>::setValue(end.c_str());
        } // if is 0 some error occur in the params

    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
leaq -0x78(%rbp), %r15
leaq -0x58(%rbp), %rdx
movq %r15, %rdi
callq 0x51e8
leaq 0x69e(%rip), %rsi       # 0x7270
movl $0x1, %ecx
movq %r15, %rdi
xorl %edx, %edx
callq 0x3310
movq %rax, %r14
leaq -0x58(%rbp), %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x31f0
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
leaq 0x660(%rip), %rsi       # 0x7270
leaq -0x78(%rbp), %rdi
movl $0x1, %ecx
movq %r14, %rdx
callq 0x3310
cmpq $-0x1, %rax
je 0x6c75
incq %r14
leaq -0x98(%rbp), %rdi
leaq -0x78(%rbp), %rsi
movq %r14, %rdx
movq $-0x1, %rcx
callq 0x31f0
leaq -0x38(%rbp), %rdi
leaq -0x98(%rbp), %r14
movq %r14, %rsi
callq 0x3230
movq (%r14), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x6c75
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x31d0
cmpq $0x0, -0x30(%rbp)
je 0x6c94
movq -0x58(%rbp), %rsi
movq %rbx, %rdi
callq 0x5d7c
movq -0x38(%rbp), %rsi
movq %rbx, %rdi
callq 0x5d7c
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x6ca9
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x31d0
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6cc2
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x31d0
leaq -0x68(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6cdb
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x31d0
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6cf0
movq %rax, %rbx
jmp 0x6d21
movq %rax, %rbx
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x6d08
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x31d0
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6d21
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x31d0
leaq -0x68(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6d3a
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x31d0
movq %rbx, %rdi
callq 0x3320
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/./CError.h
// Function: tools::operator<<(std::ostream&, tools::CException const&)
ostream& operator<<(ostream &io_os, const CException &exp)
{
	io_os << exp.what();
#ifdef _DEBUG
	io_os << " [" << exp._file << ":" << exp._line << "]";
#endif

#ifndef _WIN32
	io_os << exp._message ;
#endif
	return io_os;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
movq %rsi, %rdi
callq *0x10(%rax)
testq %rax, %rax
je 0x3f30
movq %rax, %r15
movq %rax, %rdi
callq 0x3130
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x3320
jmp 0x3f47
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x34e0
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
movq %rbx, %rdi
callq 0x3320
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CAksFileTransfert.cpp
// Function: CAksFileTransfert::~CAksFileTransfert()
CAksFileTransfert::~CAksFileTransfert()
{
	if (_EDSKFile != NULL)
		delete _EDSKFile;
	if (_inStream != NULL)
		delete _inStream;
	if (_outStream != NULL)
		delete _outStream;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x11997(%rip), %rax     # 0x15b28
movq %rax, (%rdi)
movq 0x98(%rdi), %rdi
testq %rdi, %rdi
je 0x41a6
movq (%rdi), %rax
callq *0x8(%rax)
movq 0xa0(%rbx), %rdi
testq %rdi, %rdi
je 0x41b8
movq (%rdi), %rax
callq *0x8(%rax)
movq 0xa8(%rbx), %rdi
testq %rdi, %rdi
je 0x41ca
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x78(%rbx), %rdi
leaq 0x88(%rbx), %rax
cmpq %rax, %rdi
je 0x41e5
movq (%rax), %rsi
incq %rsi
callq 0x32d0
movq 0x48(%rbx), %rdi
leaq 0x58(%rbx), %rax
cmpq %rax, %rdi
je 0x41fd
movq (%rax), %rsi
incq %rsi
callq 0x32d0
movq %rbx, %rdi
popq %rbx
jmp 0x542e
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CAksFileTransfert.cpp
// Function: CAksFileTransfert::GetFilename[abi:cxx11]() const
std::string CAksFileTransfert::GetFilename() const
{
	if (_filename.size() != 0)
		return _filename;
	#ifdef _WIN32
		const char* pathseparator = "\\";
	#else
		const char* pathseparator = "/";
	#endif
	std::string result = _filepath;
	result += pathseparator;
	result += (char*)_amsFilename;
	
	int i = result.size();
	while(result[--i] == ' ');
	result.resize(i + 1);
	
	return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x50(%rsi), %rdx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
testq %rdx, %rdx
je 0x425e
movq 0x48(%r14), %rsi
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x3f6c
jmp 0x42d4
movq 0x78(%r14), %rsi
movq 0x80(%r14), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x3f6c
leaq 0xc339(%rip), %rsi      # 0x105b4
movq %rbx, %rdi
callq 0x3550
addq $0x68, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3550
movslq 0x8(%rbx), %rcx
movq (%rbx), %rax
addq %rcx, %rax
decq %rax
shlq $0x20, %rcx
movabsq $0x100000000, %rsi      # imm = 0x100000000
addq %rcx, %rsi
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
addq %rcx, %rsi
cmpb $0x20, (%rax)
leaq -0x1(%rax), %rax
je 0x42ba
sarq $0x20, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x30f0
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
jmp 0x42df
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x42f5
movq (%r15), %rsi
incq %rsi
callq 0x32d0
movq %r14, %rdi
callq 0xcdb0
nop
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CAksFileTransfert.cpp
// Function: CAksFileTransfert::Run(bool)
CAksCommand CAksFileTransfert::Run(bool wait)
{
	CAksCommand cmd = GetCommand(wait);

	switch(cmd)
	{
	case AksTestComunication :	{ TestComunication(cmd);	break; }
	case AksEndTransfert :		{ EndTransfert(cmd);		break; }
	case AksSend:				{ Send(cmd);				break; }
	case AksSendFileSize:		{ SendFileSize(cmd);		break; }
	case AksSendFilename:		{ SendFilename(cmd);		break; }
	case AksRewind:				{ Rewind(cmd);				break; }
	case AksCreateFile:			{ CreateFile(cmd);			break; }
	case AksAddData:			{ AddData(cmd);				break; }
	case AksCloseFile:			{ CloseFile(cmd);			break; }
	case AksInitDSK:			{ InitDSK(cmd);				break; }
	case AksWaitTrack:			{ WaitTrack(cmd);			break; }
	case AksNoMoreTrack:		{ NoMoreTrack(cmd);			break; }
	case AksOpenFile:			{ OpenFile(cmd);			break; }
	default: assert(false);
	}

	return cmd;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x4456
movl %eax, %ebx
movl %eax, 0x4(%rsp)
leal -0xf0(%rbx), %eax
cmpl $0xc, %eax
ja 0x4437
leaq 0xbe4e(%rip), %rcx      # 0x1017c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0xf0, %ebx
jne 0x442d
movq %r14, %rdi
callq 0x51f0
jmp 0x442d
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0x4fdc
jmp 0x442d
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0x47a8
jmp 0x442d
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0x509a
jmp 0x442d
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0x4b84
jmp 0x442d
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0x4618
jmp 0x442d
cmpl $0xf3, %ebx
jne 0x442d
movq 0xa0(%r14), %rdi
testq %rdi, %rdi
je 0x442d
xorl %esi, %esi
xorl %edx, %edx
callq 0x33f0
jmp 0x442d
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0x4a08
jmp 0x442d
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0x469c
jmp 0x442d
cmpl $0xf5, %ebx
jne 0x442d
leaq 0x68(%r14), %rsi
movl $0xc, %edx
movq %r14, %rdi
callq 0x55e4
jmp 0x442d
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0x48b8
jmp 0x442d
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0x4c62
jmp 0x442d
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0x4b00
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xc178(%rip), %rdi      # 0x105b6
leaq 0xc177(%rip), %rsi      # 0x105bc
leaq 0xc186(%rip), %rcx      # 0x105d2
movl $0x8b, %edx
callq 0x31b0
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CAksFileTransfert.cpp
// Function: CAksFileTransfert::GetCommand(bool)
CAksCommand CAksFileTransfert::GetCommand(bool wait)
{
  //Read the command code
	unsigned char command;
	bool readed = false;
	if (wait)
	{
		ReadWaitByte(command);
		readed = true;
	}
	else
	{
		readed = ReadByte(command);
	}
	
  //Check its validity
	if (readed)
	{
		if (command > AksMinCommand && command < AksMaxCommand)
		{
			std::cout << "Command #" << std::hex << (int)command << std::dec << " : " << AksCommandShortDesc[command-(AksMinCommand+1)] << std::endl;

			return ((CAksCommand)command);
		}
		else
		{
			std::cout << "Unknown command received : 0x" << std::hex << (int)command << std::endl;
			return AksUnknownCommand;
		}
	}
	else
	{
		std::cout << "Unknown command not wait" << std::endl;

		return AksUnknownCommand;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testl %esi, %esi
je 0x446a
leaq 0x7(%rsp), %rsi
callq 0x54b4
jmp 0x447c
leaq 0x7(%rsp), %rsi
callq 0x54dc
testl %eax, %eax
je 0x4569
movb 0x7(%rsp), %al
addb $0x10, %al
movq 0x11b3f(%rip), %rbx     # 0x15fc8
cmpb $0xc, %al
ja 0x452b
leaq 0xc163(%rip), %rsi      # 0x105fb
movl $0x9, %edx
movq %rbx, %rdi
callq 0x3320
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
movzbl 0x7(%rsp), %esi
movq %rbx, %rdi
callq 0x3500
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rbx,%rax)
leaq 0xc4a9(%rip), %rsi      # 0x1098f
movl $0x3, %edx
movq %rbx, %rdi
callq 0x3320
movzbl 0x7(%rsp), %eax
leaq 0x11eb1(%rip), %rcx     # 0x163b0
movq -0x780(%rcx,%rax,8), %r14
testq %r14, %r14
je 0x45af
movq %r14, %rdi
callq 0x3130
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x3320
jmp 0x45c8
leaq 0xc0d3(%rip), %rsi      # 0x10605
movl $0x1d, %edx
movq %rbx, %rdi
callq 0x3320
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
movzbl 0x7(%rsp), %esi
movq %rbx, %rdi
callq 0x3500
movq %rax, %rbx
movq (%rax), %rax
jmp 0x4587
movq 0x11a58(%rip), %rbx     # 0x15fc8
leaq 0xc0ac(%rip), %rsi      # 0x10623
movl $0x18, %edx
movq %rbx, %rdi
callq 0x3320
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
xorl %eax, %eax
jmp 0x45f4
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq %rbx, %rdi
addq %rax, %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x34e0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
movzbl 0x7(%rsp), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CAksFileTransfert.cpp
// Function: CAksFileTransfert::EndTransfert(CAksCommand const&)
bool CAksFileTransfert::EndTransfert(const CAksCommand &cmd)
{
	if (cmd != AksEndTransfert)
		return false;

	if (_EDSKFile != NULL)
		delete _EDSKFile;
	_EDSKFile = NULL;
	if (_inStream != NULL)
		delete _inStream;
	_inStream = NULL;
	if (_outStream != NULL)
		delete _outStream;
	_outStream = NULL;

	if (_transferingData)
	{
		_nbTransfert++;
		_transferingData = false;
	}

	return true;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl (%rsi), %ebp
cmpl $0xf2, %ebp
jne 0x468c
movq %rdi, %rbx
movq 0x98(%rdi), %rdi
testq %rdi, %rdi
je 0x463a
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x98(%rbx)
movq 0xa0(%rbx), %rdi
testq %rdi, %rdi
je 0x4657
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0xa0(%rbx)
movq 0xa8(%rbx), %rdi
testq %rdi, %rdi
je 0x4674
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0xa8(%rbx)
cmpb $0x1, 0x40(%rbx)
jne 0x468c
incl 0x3c(%rbx)
movb $0x0, 0x40(%rbx)
cmpl $0xf2, %ebp
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CAksFileTransfert.cpp
// Function: CAksFileTransfert::Send(CAksCommand const&)
bool CAksFileTransfert::Send(const CAksCommand &cmd)
{
	if (cmd != AksSend)
		return false;
	
	_transferingData = true;

	// Read a word, send word bytes
	unsigned short s;
	ReadWaitWord(s);

	std::cout << "Read word " << std::hex << (int)s << std::dec << std::endl;

	int size = (s != 0) ? s : 0x10000;

	if (_inStream != NULL)
	{
		unsigned char *buffer = new unsigned char [size];
	
		_inStream->read((char*)buffer, size);

		WriteBuffer(buffer, size);
		
		delete[] buffer;

		return true;
	}
	
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
cmpl $0xf1, (%rsi)
jne 0x4797
movq %rdi, %rbx
movb $0x1, 0x40(%rdi)
leaq 0xe(%rsp), %r14
movq %r14, %rsi
callq 0x54fa
movq 0x118f9(%rip), %r15     # 0x15fc8
leaq 0xbf76(%rip), %rsi      # 0x1064c
movl $0xa, %edx
movq %r15, %rdi
callq 0x3320
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x18(%r15,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r15,%rax)
movzwl (%r14), %esi
movq %r15, %rdi
callq 0x3500
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rcx
movl 0x18(%r14,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%r14,%rcx)
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
movq 0xa0(%rbx), %r14
testq %r14, %r14
setne %bpl
je 0x4799
movzwl 0xe(%rsp), %eax
testq %rax, %rax
movl $0x10000, %r15d         # imm = 0x10000
cmovneq %rax, %r15
movq %r15, %rdi
callq 0x3030
movq %rax, %r12
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x3380
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x55e4
movq %r12, %rdi
callq 0x33b0
jmp 0x4799
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CAksFileTransfert.cpp
// Function: CAksFileTransfert::SendFileSize(CAksCommand const&)
bool CAksFileTransfert::SendFileSize(const CAksCommand &cmd)
{
	if (cmd != AksSendFileSize)
		return false;

	int fileSize = 0;
	
	if (_inStream != NULL)
	{
		std::streampos pos = _inStream->tellg();
		
		_inStream->seekg(0,std::ios::end);
		fileSize = _inStream->tellg();
		_inStream->seekg(pos);
	}

	unsigned char c;
	c = (fileSize >> 0) & 0xFF;
	WriteByte(c);
	c = (fileSize >> 8) & 0xFF;
	WriteByte(c);
	c = (fileSize >> 16) & 0xFF;
	WriteByte(c);
	c = (fileSize >> 24) & 0xFF;
	WriteByte(c);

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl (%rsi), %ebp
cmpl $0xf4, %ebp
jne 0x4856
movq %rdi, %rbx
movq 0xa0(%rdi), %rdi
testq %rdi, %rdi
je 0x480e
callq 0x3510
movq %rax, %r15
movq %rdx, %r12
movq 0xa0(%rbx), %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x33f0
movq 0xa0(%rbx), %rdi
callq 0x3510
movq %rax, %r14
movq 0xa0(%rbx), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x33a0
jmp 0x4811
xorl %r14d, %r14d
movl $0xff, %r15d
movl %r14d, %esi
andl %r15d, %esi
movq %rbx, %rdi
callq 0x54ea
movl %r14d, %esi
shrl $0x8, %esi
andl %r15d, %esi
movq %rbx, %rdi
callq 0x54ea
movl %r14d, %esi
shrl $0x10, %esi
andl %r15d, %esi
movq %rbx, %rdi
callq 0x54ea
shrl $0x18, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x54ea
cmpl $0xf4, %ebp
sete %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CAksFileTransfert.cpp
// Function: CAksFileTransfert::Rewind(CAksCommand const&)
bool CAksFileTransfert::Rewind(const CAksCommand &cmd)
{
	if (cmd != AksRewind)
		return false;

	if (_inStream != NULL)
	{
		_inStream->seekg(0,std::ios::beg);
	}

	return true;
}

// Assembly:
pushq %rbx
movl (%rsi), %ebx
cmpl $0xf3, %ebx
jne 0x48ac
movq 0xa0(%rdi), %rdi
testq %rdi, %rdi
je 0x48ac
xorl %esi, %esi
xorl %edx, %edx
callq 0x33f0
cmpl $0xf3, %ebx
sete %al
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CAksFileTransfert.cpp
// Function: CAksFileTransfert::CreateFile(CAksCommand const&)
bool CAksFileTransfert::CreateFile(const CAksCommand &cmd)
{
	if (cmd != AksCreateFile)
		return false;

	ReadWaitBuffer(_amsFilename, 12);
	_amsFilename[12] = 0;

	std::cout << "Filename " << _amsFilename << std::endl;

	if (_outStream != NULL)
		delete _outStream;

	_outStream = new std::ofstream(GetFilename().c_str(), std::ios::binary);

	if (_outStream->good())
	{
		Acknowledge();
		return true;
	}
	else
	{
		NotAcknowledge();
		return false;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
cmpl $0xf6, (%rsi)
jne 0x49b7
movq %rdi, %rbx
leaq 0x68(%rdi), %r15
movl $0xc, %edx
movq %r15, %rsi
callq 0x5586
movb $0x0, 0x74(%rbx)
movq 0x116dc(%rip), %r14     # 0x15fc8
leaq 0xbd64(%rip), %rsi      # 0x10657
movl $0x9, %edx
movq %r14, %rdi
callq 0x3320
movq %r15, %rdi
callq 0x3130
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x3320
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
movq 0xa8(%rbx), %rdi
testq %rdi, %rdi
je 0x494f
movq (%rdi), %rax
callq *0x8(%rax)
movl $0x200, %edi            # imm = 0x200
callq 0x32c0
movq %rax, %r14
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x4232
movq (%rsp), %rsi
movq %r14, %rdi
movl $0x4, %edx
callq 0x3300
movq %r14, 0xa8(%rbx)
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x499a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0xa8(%rbx), %rax
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
cmpl $0x0, 0x20(%rax,%rcx)
je 0x49c3
movq %rbx, %rdi
callq 0x524e
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rbx, %rdi
callq 0x51f0
movb $0x1, %al
jmp 0x49b9
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x49f2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32d0
jmp 0x49f2
movq %rax, %rbx
movl $0x200, %esi            # imm = 0x200
movq %r14, %rdi
callq 0x32d0
movq %rbx, %rdi
callq 0xcdb0
nop
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CAksFileTransfert.cpp
// Function: CAksFileTransfert::AddData(CAksCommand const&)
bool CAksFileTransfert::AddData(const CAksCommand &cmd)
{
	if (cmd != AksAddData)
		return false;

	_transferingData = true;

	unsigned short size;

	ReadWaitWord(size);
	
	std::cout << "Read word " << std::hex << (int)size << std::dec << std::endl;

	unsigned char *buffer = new unsigned char[size];

	ReadWaitBuffer(buffer, size);

	if (_outStream != NULL)
	{
		_outStream->write((char*)buffer, size);
	}

	delete[] buffer;

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl (%rsi), %ebp
cmpl $0xf7, %ebp
jne 0x4aeb
movq %rdi, %rbx
movb $0x1, 0x40(%rdi)
leaq 0x6(%rsp), %r14
movq %r14, %rsi
callq 0x54fa
movq 0x11590(%rip), %r15     # 0x15fc8
leaq 0xbc0d(%rip), %rsi      # 0x1064c
movl $0xa, %edx
movq %r15, %rdi
callq 0x3320
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x18(%r15,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r15,%rax)
movzwl (%r14), %esi
movq %r15, %rdi
callq 0x3500
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rcx
movl 0x18(%r15,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%r15,%rcx)
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
movzwl (%r14), %r15d
movq %r15, %rdi
callq 0x3030
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x5586
movq 0xa8(%rbx), %rdi
testq %rdi, %rdi
je 0x4ae3
movzwl 0x6(%rsp), %edx
movq %r14, %rsi
callq 0x33c0
movq %r14, %rdi
callq 0x33b0
cmpl $0xf7, %ebp
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CAksFileTransfert.cpp
// Function: CAksFileTransfert::CloseFile(CAksCommand const&)
bool CAksFileTransfert::CloseFile(const CAksCommand &cmd)
{
	if (cmd != AksCloseFile)
		return false;

	if (_EDSKFile != NULL)
		delete _EDSKFile;
	_EDSKFile = NULL;
	if (_inStream != NULL)
		delete _inStream;
	_inStream = NULL;
	if (_outStream != NULL)
		delete _outStream;
	_outStream = NULL;

	if (_transferingData)
	{
		_nbTransfert ++;
		_transferingData = false;
	}

	return true;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl (%rsi), %ebp
cmpl $0xf8, %ebp
jne 0x4b74
movq %rdi, %rbx
movq 0x98(%rdi), %rdi
testq %rdi, %rdi
je 0x4b22
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x98(%rbx)
movq 0xa0(%rbx), %rdi
testq %rdi, %rdi
je 0x4b3f
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0xa0(%rbx)
movq 0xa8(%rbx), %rdi
testq %rdi, %rdi
je 0x4b5c
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0xa8(%rbx)
cmpb $0x1, 0x40(%rbx)
jne 0x4b74
incl 0x3c(%rbx)
movb $0x0, 0x40(%rbx)
cmpl $0xf8, %ebp
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CAksFileTransfert.cpp
// Function: CAksFileTransfert::InitDSK(CAksCommand const&)
bool CAksFileTransfert::InitDSK(const CAksCommand &cmd)
{
	if (cmd != AksInitDSK)
		return false;

	_transferingData = true;

	if (_EDSKFile != NULL)
		delete _EDSKFile;

	if (_outStream != NULL)
		delete _outStream;
	_outStream = NULL;

	unsigned char nbTrack;
	unsigned char nbSide;
	unsigned char creator[2];
	
	ReadWaitByte(creator[0]);
	ReadWaitByte(creator[1]);
	ReadWaitByte(nbTrack);
	ReadWaitByte(nbSide);

	_EDSKFile = new CExtendedDSKFile(nbTrack, nbSide);

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl (%rsi), %ebp
cmpl $0xf9, %ebp
jne 0x4c33
movq %rdi, %rbx
movb $0x1, 0x40(%rdi)
movq 0x98(%rdi), %rdi
testq %rdi, %rdi
je 0x4bb7
movq (%rdi), %rax
callq *0x8(%rax)
movq 0xa8(%rbx), %rdi
testq %rdi, %rdi
je 0x4bc9
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0xa8(%rbx)
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x54b4
leaq 0xd(%rsp), %rsi
movq %rbx, %rdi
callq 0x54b4
leaq 0xf(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x54b4
leaq 0xe(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x54b4
movl $0x120, %edi            # imm = 0x120
callq 0x32c0
movq %rax, %r14
movzbl (%r15), %esi
movzbl (%r12), %edx
movq %rax, %rdi
callq 0x77a8
movq %r14, 0x98(%rbx)
cmpl $0xf9, %ebp
sete %al
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x120, %esi            # imm = 0x120
movq %r14, %rdi
callq 0x32d0
movq %rbx, %rdi
callq 0xcdb0
nop
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CAksFileTransfert.cpp
// Function: CAksFileTransfert::NoMoreTrack(CAksCommand const&)
bool CAksFileTransfert::NoMoreTrack(const CAksCommand &cmd)
{
	if (cmd != AksNoMoreTrack)
		return false;

	// Release EDSK file
	if (_EDSKFile != NULL)
	{
		_EDSKFile->SaveDSKFile(GetFilename());

		delete _EDSKFile;
		_EDSKFile = NULL;
	}

	if (_transferingData)
	{
		_nbTransfert ++;
		_transferingData = false;
	}

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl (%rsi), %ebp
cmpl $0xfb, %ebp
jne 0x505f
movq %rdi, %rbx
movq 0x98(%rdi), %r14
testq %r14, %r14
je 0x5052
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4232
movq %r14, %rdi
movq %r15, %rsi
callq 0x72a4
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5035
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0x98(%rbx), %rdi
testq %rdi, %rdi
je 0x5047
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x98(%rbx)
cmpb $0x1, 0x40(%rbx)
jne 0x505f
incl 0x3c(%rbx)
movb $0x0, 0x40(%rbx)
cmpl $0xfb, %ebp
sete %al
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5091
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32d0
movq %rbx, %rdi
callq 0xcdb0
nop
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CAksFileTransfert.cpp
// Function: CAksFileTransfert::OpenFile(CAksCommand const&)
bool CAksFileTransfert::OpenFile(const CAksCommand &cmd)
{
	if (cmd != AksOpenFile)
		return false;

	ReadWaitBuffer(_amsFilename, 12);
	_amsFilename[12] = 0;

	if (_inStream != NULL)
		delete _inStream;

	std::string fileName = GetFilename();
	
	std::cout << "file : " << fileName << std::endl;
	
	_inStream = new std::ifstream(fileName.c_str(), std::ios::binary | std::ios::in);

	if (_inStream->good())
	{
		Acknowledge();
		
		return true;
	}
	else
	{
		perror("File access error");
		NotAcknowledge();
		return false;
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
cmpl $0xfc, (%rsi)
jne 0x5194
movq %rdi, %rbx
leaq 0x68(%rdi), %rsi
movl $0xc, %edx
callq 0x5586
movb $0x0, 0x74(%rbx)
movq 0xa0(%rbx), %rdi
testq %rdi, %rdi
je 0x50d5
movq (%rdi), %rax
callq *0x8(%rax)
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x4232
movq 0x10ee1(%rip), %rdi     # 0x15fc8
leaq 0xb59c(%rip), %rsi      # 0x1068a
movl $0x7, %edx
callq 0x3320
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x10ec0(%rip), %rdi     # 0x15fc8
callq 0x3320
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
movl $0x208, %edi            # imm = 0x208
callq 0x32c0
movq %rax, %r14
movq (%rsp), %rsi
movq %rax, %rdi
movl $0xc, %edx
callq 0x3530
movq %r14, 0xa0(%rbx)
movq (%r14), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x20(%r14,%rax)
sete %bpl
jne 0x51a1
movq %rbx, %rdi
callq 0x51f0
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5196
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32d0
jmp 0x5196
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xb4ea(%rip), %rdi      # 0x10692
callq 0x3230
movq %rbx, %rdi
callq 0x524e
jmp 0x5177
movq %rax, %rbx
movl $0x208, %esi            # imm = 0x208
movq %r14, %rdi
callq 0x32d0
jmp 0x51cc
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x51e7
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32d0
movq %rbx, %rdi
callq 0xcdb0
nop
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CCPCBooster.cpp
// Function: CCPCBooster::OpenPort()
void CCPCBooster::OpenPort()
{
	if (_currentState == PortOpened)
	{
		ClosePort();
	}

	_currentState = PortFailed;

	if (RS232_OpenComport(_COMPort.c_str(), 115200, "8N1", &_COMPortHandle) == 0)
	{
	    _currentState = PortOpened ;
	}
	
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x30(%rdi)
jne 0x5401
movl 0x8(%rbx), %edi
callq 0x9ff2
movl $0x2, 0x30(%rbx)
movl $0x1, 0x30(%rbx)
movq 0x10(%rbx), %rdi
leaq 0x8(%rbx), %rcx
leaq 0xb28d(%rip), %rdx      # 0x106a4
movl $0x1c200, %esi          # imm = 0x1C200
callq 0x9acc
testl %eax, %eax
jne 0x542c
movl $0x0, 0x30(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CCPCBooster.cpp
// Function: CCPCBooster::ReadWaitWord(unsigned short&)
void CCPCBooster::ReadWaitWord(unsigned short &val)
{
	unsigned char byte1, byte2;

	ReadWaitByte(byte1);
	ReadWaitByte(byte2);

  val = byte2<<8 | byte1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xf(%rsp), %r15
movl 0x8(%r14), %edi
movq %r15, %rsi
movl $0x1, %edx
callq 0x9fc7
cmpl $0x1, %eax
jne 0x550e
leaq 0xe(%rsp), %r15
movl 0x8(%r14), %edi
movq %r15, %rsi
movl $0x1, %edx
callq 0x9fc7
cmpl $0x1, %eax
jne 0x5529
movzbl 0xe(%rsp), %eax
shll $0x8, %eax
movzbl 0xf(%rsp), %ecx
orl %eax, %ecx
movw %cx, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CCPCBooster.cpp
// Function: CCPCBooster::ReadWaitBuffer(unsigned char*, long)
bool CCPCBooster::ReadWaitBuffer(unsigned char *buffer, const  long nbBytes)
{
	long bytesLeft = nbBytes;
  
	while(bytesLeft != 0)
	{
		int i = RS232_PollComport(_COMPortHandle, buffer, bytesLeft);
		if (i >= 0) {
			bytesLeft -= i;
			buffer += i;
		}
    else
    {
      // error!
      return false;
    }
	}
	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
movq %rdx, %r15
testq %rdx, %rdx
je 0x55c3
movl 0x8(%r14), %edi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x9fc7
testl %eax, %eax
movl %eax, %ecx
cmovsq %r12, %rcx
addq %rcx, %rbx
movq %r15, %rdx
subq %rcx, %rdx
testl %eax, %eax
jns 0x5597
testq %r15, %r15
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CCPCBooster.cpp
// Function: CCPCBooster::WriteBuffer(unsigned char*, long)
bool CCPCBooster::WriteBuffer(unsigned char *buffer, const  long nbBytes)
{
	long bytesLeft = nbBytes;
  
	while(bytesLeft != 0)
	{
		int i = RS232_SendBuf(_COMPortHandle, buffer, bytesLeft);
		if (i >= 0) {
			bytesLeft -= i;
			buffer += i;
		}
    else
    {
      // error!
      return false;
    }
	}
	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
movq %rdx, %r15
testq %rdx, %rdx
je 0x5621
movl 0x8(%r14), %edi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x9fea
testl %eax, %eax
movl %eax, %ecx
cmovsq %r12, %rcx
addq %rcx, %rbx
movq %r15, %rdx
subq %rcx, %rdx
testl %eax, %eax
jns 0x55f5
testq %r15, %r15
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CDSKFile.cpp
// Function: CSDSKDiscHeader::CSDSKDiscHeader()
CSDSKDiscHeader::CSDSKDiscHeader() :
NbTrack(0),
NbSide(0),
TrackSize(0)
{
	char h[] = "MV - CPCEMU Disk-File\r\nDisk-Info\r\n";
	char c[] = "CDSKFile";

	strcpy((char*)Header, h);
	strcpy((char*)Creator, c);
	memset(Unused, 0, 204);
}

// Assembly:
leaq 0x10555(%rip), %rax     # 0x15b90
movq %rax, (%rdi)
movl $0x0, 0x3a(%rdi)
movaps 0xb0a4(%rip), %xmm0     # 0x106f0
movups %xmm0, 0x8(%rdi)
movaps 0xb0a9(%rip), %xmm0     # 0x10700
movups %xmm0, 0x18(%rdi)
movl $0xa0d6f, 0x27(%rdi)    # imm = 0xA0D6F
movabsq $0x656c69464b534443, %rax # imm = 0x656C69464B534443
movq %rax, 0x2b(%rdi)
movb $0x0, 0x33(%rdi)
addq $0x3e, %rdi
movl $0xcc, %edx
xorl %esi, %esi
jmp 0x3180
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CDSKFile.cpp
// Function: CSDSKDiscHeader::Read(std::istream&)
bool CSDSKDiscHeader::Read(std::istream &str)
{
	str.read((char*)&Header, 34);
	str.read((char*)&Creator, 14);
	str.read((char*)&NbTrack, 1);
	str.read((char*)&NbSide, 1);
	str.read((char*)&TrackSize, 2);
	str.read((char*)&Unused, 204);
	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rdi), %rsi
movl $0x22, %edx
movq %rbx, %rdi
callq 0x3380
leaq 0x2b(%r14), %rsi
movl $0xe, %edx
movq %rbx, %rdi
callq 0x3380
leaq 0x3a(%r14), %rsi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x3380
leaq 0x3b(%r14), %rsi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x3380
leaq 0x3c(%r14), %rsi
movl $0x2, %edx
movq %rbx, %rdi
callq 0x3380
addq $0x3e, %r14
movl $0xcc, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3380
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CDSKFile.cpp
// Function: CSDSKDiscHeader::Write(std::ostream&) const
bool CSDSKDiscHeader::Write(std::ostream &str) const
{
	str.write((char*)&Header, 34);
	str.write((char*)&Creator, 14);
	str.write((char*)&NbTrack, 1);
	str.write((char*)&NbSide, 1);
	str.write((char*)&TrackSize, 2);
	str.write((char*)&Unused, 204);
	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rdi), %rsi
movl $0x22, %edx
movq %rbx, %rdi
callq 0x33c0
leaq 0x2b(%r14), %rsi
movl $0xe, %edx
movq %rbx, %rdi
callq 0x33c0
leaq 0x3a(%r14), %rsi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x33c0
leaq 0x3b(%r14), %rsi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x33c0
leaq 0x3c(%r14), %rsi
movl $0x2, %edx
movq %rbx, %rdi
callq 0x33c0
addq $0x3e, %r14
movl $0xcc, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x33c0
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CDSKFile.cpp
// Function: CSDSKDiscHeader::DisplayInfo(std::ostream&) const
void CSDSKDiscHeader::DisplayInfo(std::ostream &str) const
{
	str << Header;
	str << "\tCreator\t:" << Creator << std::endl;
	str << "\tNbTrack\t:" << (int)NbTrack << std::endl;
	str << "\tNbSide\t:" << (int)NbSide << std::endl;
	str << "\tTrackSize\t:" << (int)TrackSize << std::endl;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rdi), %r15
movq %r15, %rdi
callq 0x3130
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x3320
leaq 0xaf45(%rip), %rsi      # 0x10743
movl $0xa, %edx
movq %rbx, %rdi
callq 0x3320
leaq 0x2b(%r14), %r15
movq %r15, %rdi
callq 0x3130
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x3320
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
leaq 0xaefb(%rip), %rsi      # 0x1074e
movl $0xa, %edx
movq %rbx, %rdi
callq 0x3320
movzbl 0x3a(%r14), %esi
movq %rbx, %rdi
callq 0x3500
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
leaq 0xaebb(%rip), %rsi      # 0x10759
movl $0x9, %edx
movq %rbx, %rdi
callq 0x3320
movzbl 0x3b(%r14), %esi
movq %rbx, %rdi
callq 0x3500
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
leaq 0xae7a(%rip), %rsi      # 0x10763
movl $0xc, %edx
movq %rbx, %rdi
callq 0x3320
movzwl 0x3c(%r14), %esi
movq %rbx, %rdi
callq 0x3500
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x31d0
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CDSKFile.cpp
// Function: CEDSKDiscHeader::CEDSKDiscHeader()
CEDSKDiscHeader::CEDSKDiscHeader() :
NbTrack(0),
NbSide(0),
Unused(0)
{
	char h[] = "EXTENDED CPC DSK File\r\nDisk-Info\r\n";
	char c[] = "CDSKFile";

	strcpy((char*)Header, h);
	strcpy((char*)Creator, c);
	memset(TrackSizeTable, 0, 204);
}

// Assembly:
leaq 0x102a7(%rip), %rax     # 0x15be0
movq %rax, (%rdi)
movl $0x0, 0x3a(%rdi)
movaps 0xadd6(%rip), %xmm0     # 0x10720
movups %xmm0, 0x8(%rdi)
movaps 0xaddb(%rip), %xmm0     # 0x10730
movups %xmm0, 0x18(%rdi)
movl $0xa0d6f, 0x27(%rdi)    # imm = 0xA0D6F
movabsq $0x656c69464b534443, %rax # imm = 0x656C69464B534443
movq %rax, 0x2b(%rdi)
movb $0x0, 0x33(%rdi)
addq $0x3e, %rdi
movl $0xcc, %edx
xorl %esi, %esi
jmp 0x3180
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CDSKFile.cpp
// Function: CEDSKDiscHeader::DisplayInfo(std::ostream&) const
void CEDSKDiscHeader::DisplayInfo(std::ostream &str) const
{
	str << Header;
	str << "\tCreator\t:" << Creator << std::endl;
	str << "\tNbTrack\t:" << (int)NbTrack << std::endl;
	str << "\tNbSide\t:" << (int)NbSide << std::endl;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rdi), %r15
movq %r15, %rdi
callq 0x3130
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x3320
leaq 0xac39(%rip), %rsi      # 0x10743
movl $0xa, %edx
movq %rbx, %rdi
callq 0x3320
leaq 0x2b(%r14), %r15
movq %r15, %rdi
callq 0x3130
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x3320
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
leaq 0xabef(%rip), %rsi      # 0x1074e
movl $0xa, %edx
movq %rbx, %rdi
callq 0x3320
movzbl 0x3a(%r14), %esi
movq %rbx, %rdi
callq 0x3500
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
leaq 0xabaf(%rip), %rsi      # 0x10759
movl $0x9, %edx
movq %rbx, %rdi
callq 0x3320
movzbl 0x3b(%r14), %esi
movq %rbx, %rdi
callq 0x3500
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x31d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CDSKFile.cpp
// Function: CDSKSector::ReadHeader(std::istream&)
bool CDSKSector::ReadHeader(std::istream &str)
{
	str.read((char*)&Track, 1);
	str.read((char*)&Side, 1);
	str.read((char*)&SectorID, 1);
	str.read((char*)&SectorSize, 1);
	str.read((char*)&FDCStatus1, 1);
	str.read((char*)&FDCStatus2, 1);
	str.read((char*)&DataSize, 2);
	
	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x1, %edx
movq %rsi, %rdi
movq %r14, %rsi
callq 0x3380
leaq 0x1(%r14), %rsi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x3380
leaq 0x2(%r14), %rsi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x3380
leaq 0x3(%r14), %rsi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x3380
leaq 0x4(%r14), %rsi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x3380
leaq 0x5(%r14), %rsi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x3380
addq $0x6, %r14
movl $0x2, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3380
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CDSKFile.cpp
// Function: CDSKSector::WriteHeader(std::ostream&)
bool CDSKSector::WriteHeader(std::ostream &str)
{
	str.write((char*)&Track, 1);
	str.write((char*)&Side, 1);
	str.write((char*)&SectorID, 1);
	str.write((char*)&SectorSize, 1);
	str.write((char*)&FDCStatus1, 1);
	str.write((char*)&FDCStatus2, 1);
	str.write((char*)&DataSize, 2);
	
	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x1, %edx
movq %rsi, %rdi
movq %r14, %rsi
callq 0x33c0
leaq 0x1(%r14), %rsi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x33c0
leaq 0x2(%r14), %rsi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x33c0
leaq 0x3(%r14), %rsi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x33c0
leaq 0x4(%r14), %rsi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x33c0
leaq 0x5(%r14), %rsi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x33c0
addq $0x6, %r14
movl $0x2, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x33c0
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CDSKFile.cpp
// Function: CDSKSector::ReadData(std::istream&)
bool CDSKSector::ReadData(std::istream &str)
{
	Allocate();
	
	int sSize = GetDataSize();
	str.read((char*)Data, sSize);

	Update();

	return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
callq 0x5da6
movzwl 0x6(%rbx), %eax
movb 0x3(%rbx), %cl
movl $0x80, %ebp
movl $0x80, %edx
shll %cl, %edx
testl %eax, %eax
cmovnel %eax, %edx
movq 0x8(%rbx), %rsi
movslq %edx, %rdx
movq %r14, %rdi
callq 0x3380
movzwl 0x6(%rbx), %eax
movb 0x3(%rbx), %cl
shll %cl, %ebp
testl %eax, %eax
cmovnel %eax, %ebp
movb $0x0, 0x10(%rbx)
testl %ebp, %ebp
jle 0x5d9e
movq 0x8(%rbx), %rax
movl %ebp, %ecx
xorl %edx, %edx
xorl %esi, %esi
addb (%rax,%rdx), %sil
movb %sil, 0x10(%rbx)
incq %rdx
cmpq %rdx, %rcx
jne 0x5d8e
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CDSKFile.cpp
// Function: CDSKSector::Allocate()
void CDSKSector::Allocate()
{
	if (Data != NULL)
		delete[] Data;
	Data = NULL;

	int sSize = GetDataSize();

	if (sSize != 0)
	{
		Data = new unsigned char[sSize];
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x5db8
callq 0x33b0
movq $0x0, 0x8(%rbx)
movzwl 0x6(%rbx), %edx
movb 0x3(%rbx), %cl
movl $0x80, %eax
shll %cl, %eax
testl %edx, %edx
cmovnel %edx, %eax
testl %eax, %eax
je 0x5de3
movslq %eax, %rdi
callq 0x3030
movq %rax, 0x8(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CDSKFile.cpp
// Function: CDSKSector::Update()
int CDSKSector::GetDataSize()
{
	int sSize = 0;
	if (DataSize != 0)
	{
		sSize = DataSize;
	}
	else
	{
		sSize = (128 << SectorSize);
	}
	return sSize;
}

// Assembly:
movzwl 0x6(%rdi), %eax
movb 0x3(%rdi), %cl
movl $0x80, %edx
shll %cl, %edx
testl %eax, %eax
cmovnel %eax, %edx
movb $0x0, 0x10(%rdi)
testl %edx, %edx
jle 0x5e2e
movb 0x10(%rdi), %al
movq 0x8(%rdi), %rcx
movl %edx, %edx
xorl %esi, %esi
addb (%rcx,%rsi), %al
movb %al, 0x10(%rdi)
incq %rsi
cmpq %rsi, %rdx
jne 0x5e20
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CDSKFile.cpp
// Function: CDSKTrack::Read(std::istream&)
bool CDSKTrack::Read(std::istream &str)
{
	unsigned int trackPos = str.tellg();
	
	str.read((char*)&Header, 13);
	str.read((char*)&Unused, 3);
	str.read((char*)&TrackNumber, 1);
	str.read((char*)&SideNumber, 1);
	str.read((char*)&DataRate, 1);
	str.read((char*)&RecordingMode, 1);
	str.read((char*)&SectorSize, 1);
	str.read((char*)&NbSector, 1);
	str.read((char*)&GAP3Size, 1);
	str.read((char*)&FillByte, 1);

	Allocate();

	int s;
	for (s=0 ; s<NbSector ; s++)
	{
		Sectors[s].ReadHeader(str);
	}

	str.seekg(trackPos + 0x100);
	for (s=0 ; s<NbSector ; s++)
	{
		Sectors[s].ReadData(str);
	}

	Update();

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x3510
movq %rax, %r15
movl $0xd, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3380
leaq 0xe(%rbx), %rsi
movl $0x3, %edx
movq %r14, %rdi
callq 0x3380
leaq 0x11(%rbx), %rsi
movl $0x1, %edx
movq %r14, %rdi
callq 0x3380
leaq 0x12(%rbx), %rsi
movl $0x1, %edx
movq %r14, %rdi
callq 0x3380
leaq 0x13(%rbx), %rsi
movl $0x1, %edx
movq %r14, %rdi
callq 0x3380
leaq 0x14(%rbx), %rsi
movl $0x1, %edx
movq %r14, %rdi
callq 0x3380
leaq 0x15(%rbx), %rsi
movl $0x1, %edx
movq %r14, %rdi
callq 0x3380
leaq 0x16(%rbx), %r12
movl $0x1, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x3380
leaq 0x17(%rbx), %rsi
movl $0x1, %edx
movq %r14, %rdi
callq 0x3380
leaq 0x18(%rbx), %rsi
movl $0x1, %edx
movq %r14, %rdi
callq 0x3380
movq %rbx, %rdi
callq 0x6566
cmpb $0x0, 0x16(%rbx)
je 0x650c
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x20(%rbx), %rdi
addq %r13, %rdi
movq %r14, %rsi
callq 0x5c1c
incq %rbp
movzbl 0x16(%rbx), %eax
addq $0x20, %r13
cmpq %rax, %rbp
jb 0x64ed
addl $0x100, %r15d           # imm = 0x100
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x33a0
cmpb $0x0, (%r12)
je 0x654c
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x20(%rbx), %rdi
addq %r15, %rdi
movq %r14, %rsi
callq 0x5d38
incq %r12
movzbl 0x16(%rbx), %eax
addq $0x20, %r15
cmpq %rax, %r12
jb 0x652d
movq %rbx, %rdi
callq 0x661c
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CDSKFile.cpp
// Function: CDSKTrack::Allocate()
void CDSKTrack::Allocate()
{
	if (Sectors != NULL)
		delete[] Sectors;
	Sectors = NULL;
	
	if (NbSector == 0)
		return;

	Sectors = new CDSKSector[NbSector];
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %r12
testq %r12, %r12
je 0x65b9
leaq -0x8(%r12), %r14
movq -0x8(%r12), %r15
testq %r15, %r15
je 0x65a6
movq %r15, %r13
shlq $0x5, %r13
movq -0x18(%r12,%r13), %rdi
testq %rdi, %rdi
je 0x65a0
callq 0x33b0
addq $-0x20, %r13
jne 0x6591
shlq $0x5, %r15
orq $0x8, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x3560
movq $0x0, 0x20(%rbx)
movzbl 0x16(%rbx), %r15d
testq %r15, %r15
je 0x6611
movl %r15d, %r14d
shll $0x5, %r14d
leaq 0x8(%r14), %rdi
callq 0x3030
movq %r15, (%rax)
leaq 0x8(%rax), %rcx
addq $0x20, %rax
xorl %edx, %edx
movabsq $-0x100000000, %rsi     # imm = 0xFFFFFFFF00000000
xorps %xmm0, %xmm0
movq %rsi, -0x4(%rax,%rdx)
movups %xmm0, -0x18(%rax,%rdx)
movb $0x0, -0x8(%rax,%rdx)
addq $0x20, %rdx
cmpq %rdx, %r14
jne 0x65f5
movq %rcx, 0x20(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/pelrun[P]aft/CDSKFile.cpp
// Function: CDSKTrack::Update()
void CDSKTrack::Update()
{
	for (int s=0 ; s<NbSector ; s++)
	{
		Sectors[s].Index = s;
	}

	for (int s1=0 ; s1<NbSector-1 ; s1++)
	{
		for (int s2=s1+1 ; s2 < NbSector ; s2++)
		{
			if (Sectors[s1].Checksum == Sectors[s2].Checksum && 
				Sectors[s1].SectorID == Sectors[s2].SectorID && 
				Sectors[s1].GetDataSize() == Sectors[s2].GetDataSize())
			{
				if (memcmp(Sectors[s1].Data, Sectors[s2].Data, Sectors[s1].GetDataSize()) == 0)
				{
					Sectors[s2].CopyOf = s1;
				}
			}
		}
	}

	Formated = true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movzbl 0x16(%rdi), %eax
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x66d8
movq 0x20(%rdi), %rax
movq 0x8(%rsp), %rdx
leal 0x1(%rdx), %ecx
andl $-0x2, %ecx
decq %rdx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
addq $0x34, %rax
movdqa 0xa05c(%rip), %xmm1     # 0x106c0
xorl %edx, %edx
movdqa 0xa062(%rip), %xmm2     # 0x106d0
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0xa062(%rip), %xmm4     # 0x106e0
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %esi
notl %esi
testb $0x1, %sil
je 0x66b3
movl %edx, -0x20(%rax)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %esi
testb $0x1, %sil
je 0x66c7
leal 0x1(%rdx), %esi
movl %esi, (%rax)
addq $0x2, %rdx
paddq %xmm4, %xmm1
addq $0x40, %rax
cmpq %rdx, %rcx
jne 0x667e
movq %rdi, 0x10(%rsp)
cmpb $0x2, 0x8(%rsp)
jb 0x67b8
movq 0x8(%rsp), %rax
decl %eax
movq %rax, 0x20(%rsp)
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x18(%rsp)
leaq 0x22(%rax), %rbx
movl $0x1, %ebp
xorl %eax, %eax
movq %rax, %rcx
incq %rax
movq %rax, 0x28(%rsp)
movq %rcx, %rax
movq %rcx, 0x30(%rsp)
shlq $0x5, %rax
movq 0x18(%rsp), %rcx
leaq (%rcx,%rax), %r15
movb 0x10(%rcx,%rax), %r12b
movq 0x8(%rsp), %r14
movq %rbx, %r13
cmpb 0xe(%r13), %r12b
jne 0x6795
movb 0x2(%r15), %al
cmpb (%r13), %al
jne 0x6795
movb 0x3(%r15), %cl
movl $0x80, %eax
shll %cl, %eax
movzwl 0x6(%r15), %ecx
testl %ecx, %ecx
cmovnel %ecx, %eax
movzwl 0x4(%r13), %edx
movb 0x1(%r13), %cl
movl $0x80, %esi
shll %cl, %esi
testl %edx, %edx
cmovnel %edx, %esi
cmpl %esi, %eax
jne 0x6795
movq 0x8(%r15), %rdi
movq 0x6(%r13), %rsi
movslq %eax, %rdx
callq 0x32e0
testl %eax, %eax
jne 0x6795
movq 0x30(%rsp), %rax
movl %eax, 0x16(%r13)
addq $0x20, %r13
decq %r14
cmpq %r14, %rbp
jne 0x673a
incq %rbp
addq $0x20, %rbx
movq 0x28(%rsp), %rax
cmpq 0x20(%rsp), %rax
jne 0x670d
movq 0x10(%rsp), %rax
movb $0x1, 0x19(%rax)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq