LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/macrochippic32f42.cpp
// Function: mcontroller::MacrochipPIC32F42::executeBranchIfNotEqual(int)
void MacrochipPIC32F42::executeBranchIfNotEqual(int address){

		if((address + 4) < this->getMemorySize()){
					
			// the value to compare
			unsigned char comparisonValue = this->getMemoryValueAtLocation(address + 1);
		
			// compare W to comparisonValue
			if(comparisonValue == this->getW()){
				// if equal, set the program counter to the 4 block of memory after
				// the opcode
				this->setProgramCounter(address + 4);

				cout << "Message: Execution completed." << endl;
				
			} else {
				// get the high byte and low byte address of the destination address
				unsigned char addressHighByte = this->getMemoryValueAtLocation(address + 2);
				unsigned char addressLowByte = this->getMemoryValueAtLocation(address + 3);

				// compute the destination address
				int destinationAddress = (addressHighByte << 8) | addressLowByte;

				if(destinationAddress >= 0 && destinationAddress < this->getMemorySize()){
					
					// set the program counter to the new address
					this->setProgramCounter(destinationAddress);
					cout << "Message: Execution completed." << endl;
				} else {
					cerr << "Error: Invalid memory address" << endl;
					this->executeHalt(address);
				}

			}
		} else {
			cerr << "Error: SIGWEED. Program executed past top of memory" << endl;
			this->executeHalt(address);
		}

	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
leal 0x4(%r14), %ebp
callq 0x3764
cmpl %eax, %ebp
jge 0x432f
leal 0x1(%r14), %esi
movq %rbx, %rdi
callq 0x3770
cmpb 0x1c(%rbx), %al
je 0x42df
leal 0x2(%r14), %esi
movq %rbx, %rdi
callq 0x3770
movl %eax, %ebp
addl $0x3, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3770
movzbl %bpl, %ecx
shll $0x8, %ecx
movzbl %al, %ebp
orl %ecx, %ebp
movq %rbx, %rdi
callq 0x3764
cmpl %eax, %ebp
jge 0x437a
movq %rbx, %rdi
movl %ebp, %esi
callq 0x376c
movq 0x6cd8(%rip), %rbx      # 0xafc8
leaq 0x33f9(%rip), %rsi      # 0x76f0
movl $0x1d, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x20e0
movq 0x6cba(%rip), %rbx      # 0xaff0
leaq 0x33d1(%rip), %rsi      # 0x770e
movl $0x33, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
popq %rbx
popq %r14
popq %rbp
jmp 0x4390
movq 0x6c6f(%rip), %rbx      # 0xaff0
leaq 0x33d9(%rip), %rsi      # 0x7761
movl $0x1d, %edx
jmp 0x4342
nop
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/mopsr500.cpp
// Function: mcontroller::MopsR500::MopsR500()
MopsR500::MopsR500() : Microcontroller(1024){
		// After init controller, display message for user
		std::cout << "Message: R500 connected" << std::endl;
		
		// Reset the microcontroller ti clean state
		this->reset();
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x400, %esi            # imm = 0x400
callq 0x36e0
leaq 0x68fc(%rip), %rax      # 0xad00
movq %rax, (%rbx)
movq 0x6bba(%rip), %r14      # 0xafc8
leaq 0x33a8(%rip), %rsi      # 0x77bd
movl $0x17, %edx
movq %r14, %rdi
callq 0x2190
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq 0x6b88(%rip), %rdi      # 0xafc8
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x3744
movq %r14, %rdi
callq 0x2250
nop
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/mopsr500.cpp
// Function: mcontroller::MopsR500::reset()
void MopsR500::reset(){
		// Set program counter to 0
		this->programCounter = 0;

		// Clear all internal memory and init it to 0
		this->initMemory(0);

		// Response to the user that the controller is reset
		std::cout << "Message: Micrcontroller reseted." << std::endl;
	}

// Assembly:
pushq %rbx
movl $0x0, 0x8(%rdi)
xorl %esi, %esi
callq 0x3726
movq 0x6b04(%rip), %rbx      # 0xafc8
leaq 0x330a(%rip), %rsi      # 0x77d5
movl $0x20, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
popq %rbx
jmp 0x20e0
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/mopsr500.cpp
// Function: mcontroller::MopsR500::executeFromLocation(int)
void MopsR500::executeFromLocation(int address){
		unsigned char opcode = this->getMemoryValueAtLocation(address);
		switch(opcode){
			
		case 0x0A:				// add value to memory
			this->executeAddValueToMemory(address);
			break;

		case 0x13:				// subtract value from memory
			this->executeSubtractValueFromMemory(address);
			break;

		case 0x16:				// go to address
			this->executeGoToAddress(address);
			break;

		case 0x17:				// branch relative
			this->executeBranchRelative(address);
			break;

		case 0xFF:				// halt opcode
			this->executeHalt(address);
			break;
			
		default:				// invalid opcode
			cerr << "Error: SIGOP. Invalid opcode. Program Counter = ";
			cerr << hex << this->getProgramCounter() << endl;
			break;
		}
	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
callq 0x3770
movzbl %al, %eax
cmpl $0x15, %eax
jle 0x4548
cmpl $0x16, %eax
je 0x4560
cmpl $0x17, %eax
je 0x456e
cmpl $0xff, %eax
jne 0x458a
popq %rbx
popq %r14
popq %rbp
jmp 0x4a14
cmpl $0xa, %eax
je 0x457c
cmpl $0x13, %eax
jne 0x458a
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x4716
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x4830
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x492e
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x45fc
movq 0x6a5f(%rip), %r14      # 0xaff0
leaq 0x3127(%rip), %rsi      # 0x76bf
movl $0x30, %edx
movq %r14, %rdi
callq 0x2190
movq (%r14), %rax
movq -0x18(%rax), %rax
movl 0x18(%r14,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r14,%rax)
movq %rbx, %rdi
callq 0x3768
movq %r14, %rdi
movl %eax, %esi
callq 0x2230
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x20e0
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/mopsr500.cpp
// Function: mcontroller::MopsR500::executeAddValueToMemory(int)
void MopsR500::executeAddValueToMemory(int address){

		// check if the memory is not out of range
		if((address + 4) < this->getMemorySize()){
			// get the value to add
			unsigned char valueToAdd = this->getMemoryValueAtLocation(address + 1);

			// get the low and high byte of the address
			unsigned char addressHighByte = this->getMemoryValueAtLocation(address + 2);
			unsigned char addressLowByte = this->getMemoryValueAtLocation(address + 3);

			// compute the destination address from the high and low byte of address
			int destinationAddress = (addressHighByte << 8) | addressLowByte;

			// add the valueToAdd to destination
			this->setMemoryValueAtLocation(destinationAddress,
										   this->getMemoryValueAtLocation(destinationAddress) + valueToAdd);
		
			// move the program counter to the fourth byte after the opcode
			this->setProgramCounter(address + 4);

			// finish
			cout << "Message: Execution completed." << endl;
		} else {
			cerr << "Error: SIGWEED. Program executed past top of memory." << endl;
			this->executeHalt(address);
		}


		
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
leal 0x4(%r14), %ebp
callq 0x3764
cmpl %eax, %ebp
jge 0x46c6
leal 0x1(%r14), %esi
movq %rbx, %rdi
callq 0x3770
movl %eax, %r15d
leal 0x2(%r14), %esi
movq %rbx, %rdi
callq 0x3770
movl %eax, %r12d
addl $0x3, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3770
movzbl %r12b, %ecx
shll $0x8, %ecx
movzbl %al, %r14d
orl %ecx, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3770
addb %r15b, %al
movzbl %al, %edx
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3786
movq %rbx, %rdi
movl %ebp, %esi
callq 0x376c
movq 0x6945(%rip), %rbx      # 0xafc8
leaq 0x3066(%rip), %rsi      # 0x76f0
movl $0x1d, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x20e0
movq 0x6923(%rip), %rbx      # 0xaff0
leaq 0x3122(%rip), %rsi      # 0x77f6
movl $0x34, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4a14
nop
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/mopsr500.cpp
// Function: mcontroller::MopsR500::executeSubtractValueFromMemory(int)
void MopsR500::executeSubtractValueFromMemory(int address){

		if((address + 4) < this->getMemorySize()){
			// get the value to subtract
			unsigned char valueToSubtract = this->getMemoryValueAtLocation(address + 1);

			// get the low and high byte of the address
			unsigned char addressHighByte = this->getMemoryValueAtLocation(address + 2);
			unsigned char addressLowByte = this->getMemoryValueAtLocation(address + 3);

			// compute the destination address from the high and low byte of address
			int destinationAddress = (addressHighByte << 8) | addressLowByte;

			// subtract the valueToSubtract from destination
			this->setMemoryValueAtLocation(destinationAddress,
										   this->getMemoryValueAtLocation(destinationAddress) - valueToSubtract);

			// move the program counter to the fourth byte after the opcode
			this->setProgramCounter(address + 4);

			// finish
			cout << "Message: Execution completed." << endl;
		} else {
			cerr << "Error: SIGWEED. Program executed past top of memory." << endl;
			this->executeHalt(address);
		}

	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
leal 0x4(%r14), %ebp
callq 0x3764
cmpl %eax, %ebp
jge 0x47e0
leal 0x1(%r14), %esi
movq %rbx, %rdi
callq 0x3770
movl %eax, %r15d
leal 0x2(%r14), %esi
movq %rbx, %rdi
callq 0x3770
movl %eax, %r12d
addl $0x3, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3770
movzbl %r12b, %ecx
shll $0x8, %ecx
movzbl %al, %r14d
orl %ecx, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3770
subb %r15b, %al
movzbl %al, %edx
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3786
movq %rbx, %rdi
movl %ebp, %esi
callq 0x376c
movq 0x682b(%rip), %rbx      # 0xafc8
leaq 0x2f4c(%rip), %rsi      # 0x76f0
movl $0x1d, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x20e0
movq 0x6809(%rip), %rbx      # 0xaff0
leaq 0x3008(%rip), %rsi      # 0x77f6
movl $0x34, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4a14
nop
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/mopsr500.cpp
// Function: mcontroller::MopsR500::executeGoToAddress(int)
void MopsR500::executeGoToAddress(int address){

		if((address + 2) < this->getMemorySize()){
			// compute the address from the low and high byte
			// the memory address can be determined by (high byte << 8) | low byte
			unsigned char addressHighByte = this->getMemoryValueAtLocation(address + 1);
			unsigned char addressLowByte = this->getMemoryValueAtLocation(address + 2);
			int addressToGo = ((addressHighByte << 8) | addressLowByte);

			// check if the address is valid
			if(addressToGo >= 0 && addressToGo < this->getMemorySize()){
				// set the program counter point to the new address
				this->setProgramCounter(addressToGo);

				cout << "Message: Execution completed." << endl;
			} else {
				cerr << "Error: Invalid memory address." << endl;
				this->executeHalt(address);
			}
		

		} else {
			cerr << "Error: SIGWEED. Program executed past top of memory." << endl;
			this->executeHalt(address);
		}

	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
leal 0x2(%r14), %ebp
callq 0x3764
cmpl %eax, %ebp
jge 0x48ce
incl %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3770
movl %eax, %r14d
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3770
movzbl %r14b, %ecx
shll $0x8, %ecx
movzbl %al, %ebp
orl %ecx, %ebp
movq %rbx, %rdi
callq 0x3764
cmpl %eax, %ebp
jge 0x48e3
movq %rbx, %rdi
movl %ebp, %esi
callq 0x376c
movq 0x6739(%rip), %rbx      # 0xafc8
leaq 0x2e5a(%rip), %rsi      # 0x76f0
movl $0x1d, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x20e0
movq 0x671b(%rip), %rbx      # 0xaff0
leaq 0x2f1a(%rip), %rsi      # 0x77f6
movl $0x34, %edx
jmp 0x48f6
movq 0x6706(%rip), %rbx      # 0xaff0
leaq 0x2e51(%rip), %rsi      # 0x7742
movl $0x1e, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
popq %rbx
popq %r14
popq %rbp
jmp 0x4a14
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/mopsr500.cpp
// Function: mcontroller::MopsR500::executeBranchRelative(int)
void MopsR500::executeBranchRelative(int address){

		if((address + 1) < this->getMemorySize()){
			
			// get the value from the next byte after the opcode and then add
			// convert it to signed int
			int valueToMove = (signed char)(this->getMemoryValueAtLocation(address + 1));

			if((address + valueToMove) >=0 && (address + valueToMove) < this->getMemorySize()){
				
				// move the program counter to the new location
				this->setProgramCounter(address + valueToMove);

				cout << "Message: Execution completed." << endl;
			} else {
				cerr << "Error: Invalid memory address." << endl;
				this->executeHalt(address);
			}
			
			
		} else {
			cerr << "Error: SIGWEED. Program executed past top of memory." << endl;
			this->executeHalt(address);
		}

	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
leal 0x1(%r14), %ebp
callq 0x3764
cmpl %eax, %ebp
jge 0x49b3
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3770
movsbl %al, %ebp
addl %r14d, %ebp
js 0x49c8
movq %rbx, %rdi
callq 0x3764
cmpl %eax, %ebp
jge 0x49c8
movq %rbx, %rdi
movl %ebp, %esi
callq 0x376c
movq 0x6654(%rip), %rbx      # 0xafc8
leaq 0x2d75(%rip), %rsi      # 0x76f0
movl $0x1d, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x20e0
movq 0x6636(%rip), %rbx      # 0xaff0
leaq 0x2e35(%rip), %rsi      # 0x77f6
movl $0x34, %edx
jmp 0x49db
movq 0x6621(%rip), %rbx      # 0xaff0
leaq 0x2d6c(%rip), %rsi      # 0x7742
movl $0x1e, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
popq %rbx
popq %r14
popq %rbp
jmp 0x4a14
nop
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/rotamola34hc22.cpp
// Function: mcontroller::Rotamola34HC22::Rotamola34HC22()
Rotamola34HC22::Rotamola34HC22() : Microcontroller(512){
		// print the message for user
		cout << "Message: 34HC22 connected!" << endl;
		
		// After init the memory, reset the microcontroller
		reset();
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x200, %esi            # imm = 0x200
callq 0x36e0
leaq 0x62d0(%rip), %rax      # 0xad58
movq %rax, (%rbx)
movq 0x6536(%rip), %r14      # 0xafc8
leaq 0x2dab(%rip), %rsi      # 0x7844
movl $0x1a, %edx
movq %r14, %rdi
callq 0x2190
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq 0x6504(%rip), %rdi      # 0xafc8
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x3744
movq %r14, %rdi
callq 0x2250
nop
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/rotamola34hc22.cpp
// Function: mcontroller::Rotamola34HC22::getStatusString[abi:cxx11]()
string Rotamola34HC22::getStatusString(){
		stringstream stream;
		stream << "Message: Current Program Counter location: " << hex << this->getProgramCounter() << endl;
		stream << "Message: A register value: " << hex << (int)(this->getA()) << endl;
		stream << "Message: B register value: " << hex << (int)(this->getB());
		return stream.str();
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %rdi
callq 0x2100
leaq 0x10(%rsp), %r15
leaq 0x2ac4(%rip), %rsi      # 0x761e
movl $0x2b, %edx
movq %r15, %rdi
callq 0x2190
movq 0x10(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x28(%rsp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x28(%rsp,%rax)
movq %r14, %rdi
callq 0x3768
movq %r15, %rdi
movl %eax, %esi
callq 0x2230
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
leaq 0x2c9e(%rip), %rsi      # 0x785f
movl $0x1b, %edx
movq %r15, %rdi
callq 0x2190
movq 0x10(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x28(%rsp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x28(%rsp,%rax)
movzbl 0x1c(%r14), %esi
movq %r15, %rdi
callq 0x2230
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
leaq 0x2c58(%rip), %rsi      # 0x787b
movl $0x1b, %edx
movq %r15, %rdi
callq 0x2190
movq 0x10(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x28(%rsp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x28(%rsp,%rax)
movzbl 0x1d(%r14), %esi
movq %r15, %rdi
callq 0x2230
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x2200
movq 0x6348(%rip), %rsi      # 0xafb0
movq %rsp, %rdi
callq 0x2120
leaq 0x80(%rsp), %rdi
callq 0x2090
movq %rbx, %rax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x6317(%rip), %rsi      # 0xafb0
movq %rsp, %rdi
callq 0x2120
leaq 0x80(%rsp), %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/rotamola34hc22.cpp
// Function: mcontroller::Rotamola34HC22::executeFromLocation(int)
void Rotamola34HC22::executeFromLocation(int address){
		// get the opcode
		unsigned char opcode = this->getMemoryValueAtLocation(address);

		// switch user to the right function
		switch(opcode){
		case 0x0C:				// move A to memory
			this->executeMoveAToMemory(address);
			break;
		case 0x37:				// load A with value
			this->executeLoadAWithValue(address);
			break;
		case 0x38:				// load B with value
			this->executeLoadBWithValue(address);
			break;
		case 0x53:				// increment A
			this->executeIncrementRegisterA(address);
			break;
		case 0x5A:				// branch always
			this->executeBranchAlways(address);
			break;
		case 0x5B:				// branch if A<B
			this->executeBranchIfALessThanB(address);
			break;
		case 0x5D:				// branch if less than A
			this->executeBranchIfLessThanA(address);
			break;
		case 0x64:				// halt opcode
			this->executeHalt(address);
			break;
		default:				// invalid opcode
			cerr << "Error: SIGOP. Invalid opcode. Program Counter = ";
			cerr << hex << this->getProgramCounter() << endl;
			break;
		}
	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
callq 0x3770
movzbl %al, %eax
cmpl $0x59, %eax
jg 0x4d67
cmpl $0x37, %eax
jg 0x4d84
cmpl $0xc, %eax
je 0x4daf
cmpl $0x37, %eax
jne 0x4de7
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x4f7c
cmpl $0x5c, %eax
jg 0x4d9c
cmpl $0x5a, %eax
je 0x4dbd
cmpl $0x5b, %eax
jne 0x4de7
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x5290
cmpl $0x38, %eax
je 0x4dcb
cmpl $0x53, %eax
jne 0x4de7
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x5104
cmpl $0x5d, %eax
je 0x4dd9
cmpl $0x64, %eax
jne 0x4de7
popq %rbx
popq %r14
popq %rbp
jmp 0x54b2
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x4e5a
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x51b8
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x5040
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x539c
movq 0x6202(%rip), %r14      # 0xaff0
leaq 0x28ca(%rip), %rsi      # 0x76bf
movl $0x30, %edx
movq %r14, %rdi
callq 0x2190
movq (%r14), %rax
movq -0x18(%rax), %rax
movl 0x18(%r14,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r14,%rax)
movq %rbx, %rdi
callq 0x3768
movq %r14, %rdi
movl %eax, %esi
callq 0x2230
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x20e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/rotamola34hc22.cpp
// Function: mcontroller::Rotamola34HC22::executeMoveAToMemory(int)
void Rotamola34HC22::executeMoveAToMemory(int address){

		if((address + 3) < this->getMemorySize()){
					
			// get the high byte and low byte address of the destination address
			unsigned char addressHighByte = this->getMemoryValueAtLocation(address + 1);
			unsigned char addressLowByte = this->getMemoryValueAtLocation(address + 2);

			// compute the destination address
			int destinationAddress = (addressHighByte << 8) | addressLowByte;

			if(destinationAddress >= 0 && destinationAddress < this->getMemorySize()){
			
				// move the content of A to the destination address in memory
				this->setMemoryValueAtLocation(destinationAddress, this->getA());

				// set the program counter to the thrid byte after the opcode
				this->setProgramCounter(address + 3);

				cout << "Message: Execution completed." << endl;
			} else {
				cerr << "Error: Invalid memory address." << endl;
				this->executeHalt(address);
			}

		} else {
			cerr << "Error: SIGWEED. Program executed past top of memory" << endl;
			this->executeHalt(address);
		}

	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
leal 0x3(%r14), %ebp
callq 0x3764
cmpl %eax, %ebp
jge 0x4f16
leal 0x1(%r14), %esi
movq %rbx, %rdi
callq 0x3770
movl %eax, %r15d
addl $0x2, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3770
movzbl %r15b, %ecx
shll $0x8, %ecx
movzbl %al, %r14d
orl %ecx, %r14d
movq %rbx, %rdi
callq 0x3764
cmpl %eax, %r14d
jge 0x4f2b
movzbl 0x1c(%rbx), %edx
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3786
movq %rbx, %rdi
movl %ebp, %esi
callq 0x376c
movq 0x60f7(%rip), %rbx      # 0xafc8
leaq 0x2818(%rip), %rsi      # 0x76f0
movl $0x1d, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x20e0
movq 0x60d3(%rip), %rbx      # 0xaff0
leaq 0x27ea(%rip), %rsi      # 0x770e
movl $0x33, %edx
jmp 0x4f3e
movq 0x60be(%rip), %rbx      # 0xaff0
leaq 0x2809(%rip), %rsi      # 0x7742
movl $0x1e, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x54b2
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/rotamola34hc22.cpp
// Function: mcontroller::Rotamola34HC22::executeLoadAWithValue(int)
void Rotamola34HC22::executeLoadAWithValue(int address){

		if((address + 2) < this->getMemorySize()){
			// load value from the first byte after the opcode to A
			this->setA(this->getMemoryValueAtLocation(address + 1));

			// set the program counter the the second byte after opcode
			this->setProgramCounter(address + 2);

			cout << "Message: Execution completed." << endl;
		} else {
			cerr << "Error: SIGWEED. Program executed past top of memory" << endl;
			this->executeHalt(address);
		}

	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
leal 0x2(%r14), %ebp
callq 0x3764
cmpl %eax, %ebp
jge 0x4ff4
incl %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3770
movb %al, 0x1c(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x376c
movq 0x6013(%rip), %rbx      # 0xafc8
leaq 0x2734(%rip), %rsi      # 0x76f0
movl $0x1d, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x20e0
movq 0x5ff5(%rip), %rbx      # 0xaff0
leaq 0x270c(%rip), %rsi      # 0x770e
movl $0x33, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
popq %rbx
popq %r14
popq %rbp
jmp 0x54b2
nop
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/rotamola34hc22.cpp
// Function: mcontroller::Rotamola34HC22::executeLoadBWithValue(int)
void Rotamola34HC22::executeLoadBWithValue(int address){

		if((address + 2) < this->getMemorySize()){
			// load value from the first byte after the opcode to B
			this->setB(this->getMemoryValueAtLocation(address + 1));

			// set the program counter the the second byte after opcode
			this->setProgramCounter(address + 2);

			cout << "Message: Execution completed." << endl;
		} else {
			cerr << "Error: SIGWEED. Program executed past top of memory" << endl;
			this->executeHalt(address);
		}

	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
leal 0x2(%r14), %ebp
callq 0x3764
cmpl %eax, %ebp
jge 0x50b8
incl %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3770
movb %al, 0x1d(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x376c
movq 0x5f4f(%rip), %rbx      # 0xafc8
leaq 0x2670(%rip), %rsi      # 0x76f0
movl $0x1d, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x20e0
movq 0x5f31(%rip), %rbx      # 0xaff0
leaq 0x2648(%rip), %rsi      # 0x770e
movl $0x33, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
popq %rbx
popq %r14
popq %rbp
jmp 0x54b2
nop
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/rotamola34hc22.cpp
// Function: mcontroller::Rotamola34HC22::executeIncrementRegisterA(int)
void Rotamola34HC22::executeIncrementRegisterA(int address){

		if((address + 1) < this->getMemorySize()){
			// increare the value of A
			this->setA(this->getA() + 1);

			// move the program counter to the next byte
			this->setProgramCounter(address);

			cout << "Message: Execution completed." << endl;
		} else {
			cerr << "Error: SIGWEED. Program executed past top of memory" << endl;
			this->executeHalt(address);
		}

	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
leal 0x1(%rbx), %ebp
callq 0x3764
cmpl %eax, %ebp
jge 0x516d
incb 0x1c(%r14)
movq %r14, %rdi
movl %ebx, %esi
callq 0x376c
movq 0x5e9a(%rip), %rbx      # 0xafc8
leaq 0x25bb(%rip), %rsi      # 0x76f0
movl $0x1d, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x20e0
movq 0x5e7c(%rip), %rbx      # 0xaff0
leaq 0x2593(%rip), %rsi      # 0x770e
movl $0x33, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
popq %rbx
popq %r14
popq %rbp
jmp 0x54b2
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/rotamola34hc22.cpp
// Function: mcontroller::Rotamola34HC22::executeBranchAlways(int)
void Rotamola34HC22::executeBranchAlways(int address){

		if((address + 2) < this->getMemorySize()){
			// get the high byte and low byte address of the destination address
			unsigned char addressHighByte = this->getMemoryValueAtLocation(address + 1);
			unsigned char addressLowByte = this->getMemoryValueAtLocation(address + 2);

			// compute the destination address
			int destinationAddress = (addressHighByte << 8) | addressLowByte;

			// set the program counter to the new address
			this->setProgramCounter(destinationAddress);

			cout << "Message: Execution completed." << endl;
		} else {
			cerr << "Error: SIGWEED. Program executed past top of memory" << endl;
			this->executeHalt(address);
		}

	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
leal 0x2(%r14), %ebp
callq 0x3764
cmpl %eax, %ebp
jge 0x5244
incl %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3770
movl %eax, %r14d
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3770
movzbl %r14b, %ecx
shll $0x8, %ecx
movzbl %al, %esi
orl %ecx, %esi
movq %rbx, %rdi
callq 0x376c
movq 0x5dc3(%rip), %rbx      # 0xafc8
leaq 0x24e4(%rip), %rsi      # 0x76f0
movl $0x1d, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x20e0
movq 0x5da5(%rip), %rbx      # 0xaff0
leaq 0x24bc(%rip), %rsi      # 0x770e
movl $0x33, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
popq %rbx
popq %r14
popq %rbp
jmp 0x54b2
nop
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/rotamola34hc22.cpp
// Function: mcontroller::Rotamola34HC22::executeBranchIfALessThanB(int)
void Rotamola34HC22::executeBranchIfALessThanB(int address){

		if((address + 3) < this->getMemorySize()){
			
			// compare the value of A and B
			if(this->getA() < this->getB()){

				// get the high byte and low byte address of the destination address
				unsigned char addressHighByte = this->getMemoryValueAtLocation(address + 1);
				unsigned char addressLowByte = this->getMemoryValueAtLocation(address + 2);

				// compute the destination address
				int destinationAddress = (addressHighByte << 8) | addressLowByte;

				if(destinationAddress >= 0 && destinationAddress < this->getMemorySize()){
					


					// set the program counter to the new address
					this->setProgramCounter(destinationAddress);

					cout << "Message: Execution completed." << endl;

				} else {
					cout << "Error: Invalid memory address." << endl;
					this->executeHalt(address);
				}
			
			} else {
			
				// set the program counter to the third byte after the opcode
				this->setProgramCounter(address + 3);
				cout << "Message: Execution completed." << endl;
			}
			
		} else {
			cerr << "Error: SIGWEED. Program executed past top of memory" << endl;
			this->executeHalt(address);
		}

	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
leal 0x3(%r14), %ebp
callq 0x3764
cmpl %eax, %ebp
jge 0x533c
movb 0x1c(%rbx), %al
cmpb 0x1d(%rbx), %al
jae 0x52ec
leal 0x1(%r14), %esi
movq %rbx, %rdi
callq 0x3770
movl %eax, %ebp
addl $0x2, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3770
movzbl %bpl, %ecx
shll $0x8, %ecx
movzbl %al, %ebp
orl %ecx, %ebp
movq %rbx, %rdi
callq 0x3764
cmpl %eax, %ebp
jge 0x5387
movq %rbx, %rdi
movl %ebp, %esi
callq 0x376c
movq 0x5ccb(%rip), %rbx      # 0xafc8
leaq 0x23ec(%rip), %rsi      # 0x76f0
movl $0x1d, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x20e0
movq 0x5cad(%rip), %rbx      # 0xaff0
leaq 0x23c4(%rip), %rsi      # 0x770e
movl $0x33, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
popq %rbx
popq %r14
popq %rbp
jmp 0x54b2
movq 0x5c3a(%rip), %rbx      # 0xafc8
leaq 0x23ad(%rip), %rsi      # 0x7742
movl $0x1e, %edx
jmp 0x534f
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/rotamola34hc22.cpp
// Function: mcontroller::Rotamola34HC22::executeBranchIfLessThanA(int)
void Rotamola34HC22::executeBranchIfLessThanA(int address){

		if((address + 4) < this->getMemorySize()){
			
			// get the value to compare to A
			unsigned char comparisonValue = this->getMemoryValueAtLocation(address + 1);

			// compare A and comparisonValue
			if(comparisonValue < this->getA()){

				// get the high byte and low byte address of the destination address
				unsigned char addressHighByte = this->getMemoryValueAtLocation(address + 2);
				unsigned char addressLowByte = this->getMemoryValueAtLocation(address + 3);

				// compute the destination address
				int destinationAddress = (addressHighByte << 8) | addressLowByte;

				if(destinationAddress >=0 && destinationAddress < this->getMemorySize()){
					
					// set the program counter to the new address
					this->setProgramCounter(destinationAddress);
					cout << "Message: Execution completed." << endl;
				} else {
					cout << "Error: Invalid memory address." << endl;
					this->executeHalt(address);
				}

			
			} else {

				// set the program counter to the the fourth byte after the opcode
				this->setProgramCounter(address + 4);

				cout << "Message: Execution completed." << endl;
			
			}
		} else {
			cerr << "Error: SIGWEED. Program executed past top of memory" << endl;
			this->executeHalt(address);
		}

	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
leal 0x4(%r14), %ebp
callq 0x3764
cmpl %eax, %ebp
jge 0x5451
leal 0x1(%r14), %esi
movq %rbx, %rdi
callq 0x3770
cmpb 0x1c(%rbx), %al
jae 0x5401
leal 0x2(%r14), %esi
movq %rbx, %rdi
callq 0x3770
movl %eax, %ebp
addl $0x3, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3770
movzbl %bpl, %ecx
shll $0x8, %ecx
movzbl %al, %ebp
orl %ecx, %ebp
movq %rbx, %rdi
callq 0x3764
cmpl %eax, %ebp
jge 0x549c
movq %rbx, %rdi
movl %ebp, %esi
callq 0x376c
movq 0x5bb6(%rip), %rbx      # 0xafc8
leaq 0x22d7(%rip), %rsi      # 0x76f0
movl $0x1d, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x20e0
movq 0x5b98(%rip), %rbx      # 0xaff0
leaq 0x22af(%rip), %rsi      # 0x770e
movl $0x33, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
popq %rbx
popq %r14
popq %rbp
jmp 0x54b2
movq 0x5b25(%rip), %rbx      # 0xafc8
leaq 0x2298(%rip), %rsi      # 0x7742
movl $0x1e, %edx
jmp 0x5464
nop
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/microcontrollerfactory.cpp
// Function: mcontroller::MicrocontrollerFactory::MicrocontrollerFactory()
MicrocontrollerFactory::MicrocontrollerFactory(){

		// Init all available micrcontrollers here so that later when there are
		// more microcontroller classes, just add them here
		this->addMicrocontroller("R500", MopsR500::create);
		this->addMicrocontroller("PIC32F42", MacrochipPIC32F42::create);
		this->addMicrocontroller("34HC22", Rotamola34HC22::create);
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rdi, %rbx
leaq 0x8(%rdi), %rax
movl $0x0, 0x8(%rdi)
xorl %ecx, %ecx
movq %rcx, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
movq %rcx, 0x28(%rdi)
leaq 0x50(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x238d(%rip), %rsi      # 0x78d6
leaq 0x238a(%rip), %rdx      # 0x78da
leaq 0x40(%rsp), %rdi
callq 0x3648
leaq -0x10ef(%rip), %rdx     # 0x4472
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x567c
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x5585
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2170
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x2346(%rip), %rsi      # 0x78db
leaq 0x2347(%rip), %rdx      # 0x78e3
leaq 0x20(%rsp), %rdi
callq 0x3648
leaq -0x1ab7(%rip), %rdx     # 0x3af6
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x567c
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x55d1
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2170
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x2303(%rip), %rsi      # 0x78e4
leaq 0x2302(%rip), %rdx      # 0x78ea
movq %rsp, %rdi
callq 0x3648
leaq -0xb01(%rip), %rdx      # 0x4af6
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x567c
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x5618
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2170
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x566c
movq 0x10(%rsp), %rsi
jmp 0x565f
jmp 0x5669
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x566c
movq 0x30(%rsp), %rsi
jmp 0x565f
jmp 0x5669
movq %rax, %r14
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x566c
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x566c
movq %rax, %r14
movq %rbx, %rdi
callq 0x3530
movq %r14, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/microcontrollerfactory.cpp
// Function: mcontroller::MicrocontrollerFactory::createMicrocontroller(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Microcontroller* MicrocontrollerFactory::createMicrocontroller(string name){


		// check if the create function is exist
		if(this->createFunctionMap.find(name) == this->createFunctionMap.end()){
			// not exist
			// notify user
			cerr << "Error: Invalid Microcontroller type." << endl;
			cout << "Message: Valid types of Microcontroller are "
				 << this->getAvailableMicrocontrollersString()
				 << endl;
			return 0;
		} else {
			// exist
			// get the create function from the map
			createFunction* createFn = this->createFunctionMap[name];			
			return createFn();
		}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x5be2
leaq 0x8(%rbx), %rcx
cmpq %rcx, %rax
je 0x5735
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5922
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmpq *(%rax)
movq 0x58b4(%rip), %r14      # 0xaff0
leaq 0x21a8(%rip), %rsi      # 0x78eb
movl $0x24, %edx
movq %r14, %rdi
callq 0x2190
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq 0x584a(%rip), %r14      # 0xafc8
leaq 0x218b(%rip), %rsi      # 0x7910
movl $0x2c, %edx
movq %r14, %rdi
callq 0x2190
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5826
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x2190
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x57f4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2170
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x581e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2170
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/microcontrollerfactory.cpp
// Function: mcontroller::MicrocontrollerFactory::getAvailableMicrocontrollersString[abi:cxx11]()
string MicrocontrollerFactory::getAvailableMicrocontrollersString(){
		// get the iterator
		map<string, createFunction*>::iterator it;

		// the return string
		string microcontrollerString;

		// iterate through the map
		for (it = this->createFunctionMap.begin(); it != this->createFunctionMap.end(); ++it){
			// get the key and then append to the string
			microcontrollerString.append(it->first);
			microcontrollerString.append(" ");
		}

		return microcontrollerString;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %r13
movq %r13, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
movq 0x18(%rsi), %r15
addq $0x8, %r14
cmpq %r14, %r15
je 0x5887
leaq 0x1b4a(%rip), %r12      # 0x73a6
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
movq %rbx, %rdi
callq 0x2080
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2270
movq %r15, %rdi
callq 0x20f0
movq %rax, %r15
cmpq %r14, %rax
jne 0x585c
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0x58ab
movq (%r13), %rsi
incq %rsi
callq 0x2170
movq %r14, %rdi
callq 0x2250
nop
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/microcontrollerfactory.cpp
// Function: mcontroller::MicrocontrollerFactory::getAvailableMicrocontrollersSet[abi:cxx11]()
set<string> MicrocontrollerFactory::getAvailableMicrocontrollersSet(){
		// get the iterator
		map<string, createFunction*>::iterator it;

		// the return set
		set<string> microcontrollerSet;

		// iterate through the map
		for (it = this->createFunctionMap.begin(); it != this->createFunctionMap.end(); ++it){
			// insert the key to the set
			microcontrollerSet.insert(it->first);
		}

		return microcontrollerSet;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rdi), %rax
movl $0x0, 0x8(%rdi)
xorl %ecx, %ecx
movq %rcx, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
movq %rcx, 0x28(%rdi)
movq 0x18(%rsi), %r15
addq $0x8, %r14
cmpq %r14, %r15
je 0x5905
leaq 0x20(%r15), %rsi
movq %rbx, %rdi
callq 0x5e8a
movq %r15, %rdi
callq 0x20f0
movq %rax, %r15
cmpq %r14, %rax
jne 0x58e9
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x599e
movq %r14, %rdi
callq 0x2250
nop
// File: /workspace/github_cpp_makefile_star2_O3/cfiutak1[P]HPyC-KD-Tree/main.cpp
// Function: cleanup(TrainingFileData*, QueryFileData*, float*, float**)
void cleanup(TrainingFileData* training_file_data, QueryFileData* query_file_data, float* training_points, float** query_points) {
    delete[] training_points;

    for (std::size_t i = 0; i < query_file_data->num_points; ++i) {
        delete query_points[i];
    }

    delete[] query_points;

    delete training_file_data;
    delete query_file_data;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rsi, %rbx
movq %rdi, %r14
testq %rdx, %rdx
je 0x22fa
movq %rdx, %rdi
callq 0x2140
cmpq $0x0, 0x8(%rbx)
je 0x231d
xorl %r12d, %r12d
movq (%r15,%r12,8), %rdi
movl $0x4, %esi
callq 0x2120
incq %r12
cmpq 0x8(%rbx), %r12
jb 0x2304
jmp 0x2322
testq %r15, %r15
je 0x232a
movq %r15, %rdi
callq 0x2140
movl $0x18, %esi
movq %r14, %rdi
callq 0x2120
movl $0x20, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2120
// File: /workspace/github_cpp_makefile_star2_O3/cfiutak1[P]HPyC-KD-Tree/./utils/fileprocessor/TrainingFileProcessor.hpp
// Function: TrainingFileProcessor::readTrainingFileHeader()
TrainingFileData* readTrainingFileHeader() {
        char file_type[8];
        this->input_stream.read(reinterpret_cast<char *>(&file_type), 8);

        std::size_t file_id = 0;
        this->input_stream.read(reinterpret_cast<char *>(&file_id), 8);

        std::size_t num_points = 0;
        this->input_stream.read(reinterpret_cast<char *>(&num_points), 8);

        std::size_t num_dimensions = 0;
        this->input_stream.read(reinterpret_cast<char *>(&num_dimensions), 8);

        this->file_data = new TrainingFileData(file_id, num_points, num_dimensions);

        return static_cast<TrainingFileData*>(this->file_data);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x20(%rdi), %r14
leaq 0x20(%rsp), %rsi
movl $0x8, %edx
movq %r14, %rdi
callq 0x2130
xorl %ebp, %ebp
leaq 0x18(%rsp), %r15
movq %rbp, (%r15)
movl $0x8, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2130
leaq 0x10(%rsp), %r12
movq %rbp, (%r12)
movl $0x8, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x2130
leaq 0x8(%rsp), %r13
movq %rbp, (%r13)
movl $0x8, %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x2130
movl $0x18, %edi
callq 0x2110
movq (%r15), %rcx
movq (%r12), %rdx
movq (%r13), %rsi
movq %rcx, (%rax)
movq %rdx, 0x8(%rax)
movq %rsi, 0x10(%rax)
movq %rax, 0x228(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/cfiutak1[P]HPyC-KD-Tree/./utils/fileprocessor/FileProcessor.hpp
// Function: FileProcessor::readPoints1D()
float* readPoints1D() {
        std::size_t num_points = this->file_data->num_points;
        float* points = new float[num_points * this->file_data->num_dimensions];

        for (std::size_t i = 0; i < num_points; ++i) {
            for (std::size_t j = 0; j < this->file_data->num_dimensions; ++j) {
                float* f = points + ((num_points * j) + i);

                this->input_stream.read(
                    (char*) f,
                    sizeof(float)
                );
            }
        }

        return points;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x228(%rdi), %rbp
movq 0x8(%rbp), %r14
movq 0x10(%rbp), %rax
imulq %r14, %rax
movq %rax, %rcx
shrq $0x3e, %rcx
shlq $0x2, %rax
xorl %edi, %edi
negq %rcx
sbbq %rdi, %rdi
orq %rax, %rdi
callq 0x2030
movq %rax, 0x8(%rsp)
movq %r14, 0x10(%rsp)
testq %r14, %r14
je 0x2a3d
leaq 0x20(%rbx), %r15
movq 0x10(%rsp), %rax
leaq (,%rax,4), %r14
xorl %eax, %eax
movq 0x8(%rsp), %rcx
movq %rcx, 0x18(%rsp)
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x10(%rbp)
je 0x2a28
movq 0x18(%rsp), %r12
xorl %r13d, %r13d
movl $0x4, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2130
incq %r13
movq 0x228(%rbx), %rbp
addq %r14, %r12
cmpq 0x10(%rbp), %r13
jb 0x2a05
movq 0x20(%rsp), %rax
incq %rax
addq $0x4, 0x18(%rsp)
cmpq 0x10(%rsp), %rax
jne 0x29f1
movq 0x8(%rsp), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop