LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/tmtxt[P]microcontroller-emulation/microcontroller.cpp
// Function: mcontroller::Microcontroller::inputHexadecimal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int Microcontroller::inputHexadecimal(string prompt){
		// The input location
		int location;

		// Display the prompt
		cout << prompt;

		// Read the location from user and ensure that user enter an hex int
		while(!(cin >> hex >> location)){
			cerr << "Message: Please input a valid hexadecimal integer!" << endl;
			cin.clear();
			cin.ignore(1000, '\n');
			cout << prompt;
		}

		cin.clear();
		cin.ignore(1000, '\n');

		return location;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq (%rsi), %rsi
movq 0x8(%r14), %rdx
movq 0x7770(%rip), %rdi      # 0xafc8
callq 0x2190
movq 0x7774(%rip), %rbx      # 0xafd8
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
leaq 0x4(%rsp), %rsi
movq %rbx, %rdi
callq 0x20b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0x394d
movq 0x7751(%rip), %r15      # 0xaff0
leaq 0x3d45(%rip), %r12      # 0x75eb
movq 0x771b(%rip), %r13      # 0xafc8
leaq 0x4(%rsp), %rbp
movl $0x32, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2190
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
xorl %esi, %esi
callq 0x2220
movl $0x3e8, %esi            # imm = 0x3E8
movq %rbx, %rdi
movl $0xa, %edx
callq 0x20c0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r13, %rdi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x20b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x38b2
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
xorl %esi, %esi
callq 0x2220
movl $0x3e8, %esi            # imm = 0x3E8
movq %rbx, %rdi
movl $0xa, %edx
callq 0x20c0
movl 0x4(%rsp), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tmtxt[P]microcontroller-emulation/macrochippic32f42.cpp
// Function: mcontroller::MacrochipPIC32F42::MacrochipPIC32F42()
MacrochipPIC32F42::MacrochipPIC32F42() : Microcontroller(1536){
		// After init the microcontroller, print the message to user
		std::cout << "Message: PIC32F42 connected!" << std::endl;
		
		// Reset the microcontroller to a clean state
		this->reset();
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x600, %esi            # imm = 0x600
callq 0x36b0
leaq 0x7250(%rip), %rax      # 0xaca8
movq %rax, (%rbx)
movq 0x7566(%rip), %r14      # 0xafc8
leaq 0x3c02(%rip), %rsi      # 0x766b
movl $0x1c, %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 0x7534(%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 0x3714
movq %r14, %rdi
callq 0x2250
nop
// File: /workspace/github_cpp_makefile_star2_O1/tmtxt[P]microcontroller-emulation/macrochippic32f42.cpp
// Function: mcontroller::MacrochipPIC32F42::getStatusString[abi:cxx11]()
string MacrochipPIC32F42::getStatusString(){
		stringstream stream;
		stream << "Message: Current Program Counter location: " << hex << this->getProgramCounter() << endl;
		stream << "Message: W register value: " << hex << (int)(this->getW());
		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 0x3af4(%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 0x3738
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 0x3af7(%rip), %rsi      # 0x7688
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
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x2200
movq 0x73da(%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 0x73a9(%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_O1/tmtxt[P]microcontroller-emulation/macrochippic32f42.cpp
// Function: mcontroller::MacrochipPIC32F42::reset()
void MacrochipPIC32F42::reset(){
		// Set program counter to 0
		this->programCounter = 0;

		// Set W to 0
		this->setW(0);

		// print the message
		cout << "Message: PIC32F42 Reseted!" << endl;
	}

// Assembly:
pushq %rbx
movl $0x0, 0x8(%rdi)
movb $0x0, 0x1c(%rdi)
movq 0x738d(%rip), %rbx      # 0xafc8
leaq 0x3a62(%rip), %rsi      # 0x76a4
movl $0x1a, %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
nop
// File: /workspace/github_cpp_makefile_star2_O1/tmtxt[P]microcontroller-emulation/macrochippic32f42.cpp
// Function: mcontroller::MacrochipPIC32F42::executeFromLocation(int)
void MacrochipPIC32F42::executeFromLocation(int address){
		// get the opcode in memory
		unsigned char opcode = this->getMemoryValueAtLocation(address);

		// switch it to the right function
		switch(opcode){
		case 0x50:				// move value to W
			this->executeMoveValueToW(address);
			break;
		case 0x51:				// move W to memory
			this->executeMoveWToMemory(address);
			break;
		case 0x5A:				// add value to W
			this->executeAddValueToW(address);
			break;
		case 0x5B:				// subtract value from W
			this->executeSubtractValueFromW(address);
			break;
		case 0x6E:				// Goto address (branch always)
			this->executeGoToAddress(address);
			break;
		case 0x70:				// Branch if not equal
			this->executeBranchIfNotEqual(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 0x3740
movzbl %al, %eax
cmpl $0x5a, %eax
jle 0x3ccd
cmpl $0x6f, %eax
jg 0x3cee
cmpl $0x5b, %eax
je 0x3d87
cmpl $0x6e, %eax
jne 0x3d15
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x414c
cmpl $0x50, %eax
je 0x3d07
cmpl $0x51, %eax
je 0x3da3
cmpl $0x5a, %eax
jne 0x3d15
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x3f98
cmpl $0x70, %eax
je 0x3d95
cmpl $0xff, %eax
jne 0x3d15
popq %rbx
popq %r14
popq %rbp
jmp 0x4360
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x3db2
movq 0x72d4(%rip), %r14      # 0xaff0
leaq 0x399c(%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 0x3738
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
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x4072
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x424a
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x3e76
nop
// File: /workspace/github_cpp_makefile_star2_O1/tmtxt[P]microcontroller-emulation/macrochippic32f42.cpp
// Function: mcontroller::MacrochipPIC32F42::executeMoveValueToW(int)
void MacrochipPIC32F42::executeMoveValueToW(int address){

		if((address + 2) < this->getMemorySize()){
					
		// set the new value for W
		this->setW(this->getMemoryValueAtLocation(address + 1));

		// set the program counter to the second byte after the 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 0x3734
cmpl %eax, %ebp
jge 0x3e2a
incl %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3740
movb %al, 0x1c(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x373c
movq 0x71dd(%rip), %rbx      # 0xafc8
leaq 0x38fe(%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 0x71bf(%rip), %rbx      # 0xaff0
leaq 0x38d6(%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 0x4360
nop
// File: /workspace/github_cpp_makefile_star2_O1/tmtxt[P]microcontroller-emulation/macrochippic32f42.cpp
// Function: mcontroller::MacrochipPIC32F42::executeMoveWToMemory(int)
void MacrochipPIC32F42::executeMoveWToMemory(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()){
			
				// write the content of register W to destination address
				this->setMemoryValueAtLocation(destinationAddress, this->getW());

				// set the program counter to the third 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 0x3734
cmpl %eax, %ebp
jge 0x3f32
leal 0x1(%r14), %esi
movq %rbx, %rdi
callq 0x3740
movl %eax, %r15d
addl $0x2, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3740
movzbl %r15b, %ecx
shll $0x8, %ecx
movzbl %al, %r14d
orl %ecx, %r14d
movq %rbx, %rdi
callq 0x3734
cmpl %eax, %r14d
jge 0x3f47
movzbl 0x1c(%rbx), %edx
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3756
movq %rbx, %rdi
movl %ebp, %esi
callq 0x373c
movq 0x70db(%rip), %rbx      # 0xafc8
leaq 0x37fc(%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 0x70b7(%rip), %rbx      # 0xaff0
leaq 0x37ce(%rip), %rsi      # 0x770e
movl $0x33, %edx
jmp 0x3f5a
movq 0x70a2(%rip), %rbx      # 0xaff0
leaq 0x37ed(%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 0x4360
// File: /workspace/github_cpp_makefile_star2_O1/tmtxt[P]microcontroller-emulation/macrochippic32f42.cpp
// Function: mcontroller::MacrochipPIC32F42::executeAddValueToW(int)
void MacrochipPIC32F42::executeAddValueToW(int address){
		
		if((address + 2) < this->getMemorySize()){
					
			// add value to W
			this->setW(this->getW() + this->getMemoryValueAtLocation(address + 1));

			// set the program counter to the second byte after the 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 %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
leal 0x2(%r14), %ebp
callq 0x3734
cmpl %eax, %ebp
jge 0x4020
movb 0x1c(%rbx), %r15b
incl %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3740
addb %r15b, %al
movb %al, 0x1c(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x373c
movq 0x6fed(%rip), %rbx      # 0xafc8
leaq 0x370e(%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 0x6fc9(%rip), %rbx      # 0xaff0
leaq 0x36e0(%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
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4360
nop
// File: /workspace/github_cpp_makefile_star2_O1/tmtxt[P]microcontroller-emulation/macrochippic32f42.cpp
// Function: mcontroller::MacrochipPIC32F42::executeSubtractValueFromW(int)
void MacrochipPIC32F42::executeSubtractValueFromW(int address){

		if((address + 2) < this->getMemorySize()){
			// subtract value from w
			this->setW(this->getW() - this->getMemoryValueAtLocation(address + 1));

			// set the program counter to the second byte after the 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 %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
leal 0x2(%r14), %ebp
callq 0x3734
cmpl %eax, %ebp
jge 0x40fb
movb 0x1c(%rbx), %r15b
incl %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3740
subb %al, %r15b
movb %r15b, 0x1c(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x373c
movq 0x6f12(%rip), %rbx      # 0xafc8
leaq 0x3633(%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 0x6eee(%rip), %rbx      # 0xaff0
leaq 0x3605(%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
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4360
// File: /workspace/github_cpp_makefile_star2_O1/tmtxt[P]microcontroller-emulation/macrochippic32f42.cpp
// Function: mcontroller::MacrochipPIC32F42::executeGoToAddress(int)
void MacrochipPIC32F42::executeGoToAddress(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;

			if(destinationAddress >= 0 && destinationAddress < this->getMemorySize()){
				
				// set the program counter to the destination 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 0x2(%r14), %ebp
callq 0x3734
cmpl %eax, %ebp
jge 0x41ea
incl %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3740
movl %eax, %r14d
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3740
movzbl %r14b, %ecx
shll $0x8, %ecx
movzbl %al, %ebp
orl %ecx, %ebp
movq %rbx, %rdi
callq 0x3734
cmpl %eax, %ebp
jge 0x41ff
movq %rbx, %rdi
movl %ebp, %esi
callq 0x373c
movq 0x6e1d(%rip), %rbx      # 0xafc8
leaq 0x353e(%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 0x6dff(%rip), %rbx      # 0xaff0
leaq 0x3516(%rip), %rsi      # 0x770e
movl $0x33, %edx
jmp 0x4212
movq 0x6dea(%rip), %rbx      # 0xaff0
leaq 0x3535(%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 0x4360
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3734
cmpl %eax, %ebp
jge 0x42ff
leal 0x1(%r14), %esi
movq %rbx, %rdi
callq 0x3740
cmpb 0x1c(%rbx), %al
je 0x42af
leal 0x2(%r14), %esi
movq %rbx, %rdi
callq 0x3740
movl %eax, %ebp
addl $0x3, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3740
movzbl %bpl, %ecx
shll $0x8, %ecx
movzbl %al, %ebp
orl %ecx, %ebp
movq %rbx, %rdi
callq 0x3734
cmpl %eax, %ebp
jge 0x434a
movq %rbx, %rdi
movl %ebp, %esi
callq 0x373c
movq 0x6d08(%rip), %rbx      # 0xafc8
leaq 0x3429(%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 0x6cea(%rip), %rbx      # 0xaff0
leaq 0x3401(%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 0x4360
movq 0x6c9f(%rip), %rbx      # 0xaff0
leaq 0x3409(%rip), %rsi      # 0x7761
movl $0x1d, %edx
jmp 0x4312
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x36b0
leaq 0x692c(%rip), %rax      # 0xad00
movq %rax, (%rbx)
movq 0x6bea(%rip), %r14      # 0xafc8
leaq 0x33d8(%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 0x6bb8(%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 0x3714
movq %r14, %rdi
callq 0x2250
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x36f6
movq 0x6b34(%rip), %rbx      # 0xafc8
leaq 0x333a(%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_O1/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 0x3740
movzbl %al, %eax
cmpl $0x15, %eax
jle 0x4518
cmpl $0x16, %eax
je 0x4530
cmpl $0x17, %eax
je 0x453e
cmpl $0xff, %eax
jne 0x455a
popq %rbx
popq %r14
popq %rbp
jmp 0x49e4
cmpl $0xa, %eax
je 0x454c
cmpl $0x13, %eax
jne 0x455a
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x46e6
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x4800
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x48fe
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x45cc
movq 0x6a8f(%rip), %r14      # 0xaff0
leaq 0x3157(%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 0x3738
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_O1/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 0x3734
cmpl %eax, %ebp
jge 0x4696
leal 0x1(%r14), %esi
movq %rbx, %rdi
callq 0x3740
movl %eax, %r15d
leal 0x2(%r14), %esi
movq %rbx, %rdi
callq 0x3740
movl %eax, %r12d
addl $0x3, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3740
movzbl %r12b, %ecx
shll $0x8, %ecx
movzbl %al, %r14d
orl %ecx, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3740
addb %r15b, %al
movzbl %al, %edx
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3756
movq %rbx, %rdi
movl %ebp, %esi
callq 0x373c
movq 0x6975(%rip), %rbx      # 0xafc8
leaq 0x3096(%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 0x6953(%rip), %rbx      # 0xaff0
leaq 0x3152(%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 0x49e4
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3734
cmpl %eax, %ebp
jge 0x47b0
leal 0x1(%r14), %esi
movq %rbx, %rdi
callq 0x3740
movl %eax, %r15d
leal 0x2(%r14), %esi
movq %rbx, %rdi
callq 0x3740
movl %eax, %r12d
addl $0x3, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3740
movzbl %r12b, %ecx
shll $0x8, %ecx
movzbl %al, %r14d
orl %ecx, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3740
subb %r15b, %al
movzbl %al, %edx
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3756
movq %rbx, %rdi
movl %ebp, %esi
callq 0x373c
movq 0x685b(%rip), %rbx      # 0xafc8
leaq 0x2f7c(%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 0x6839(%rip), %rbx      # 0xaff0
leaq 0x3038(%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 0x49e4
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3734
cmpl %eax, %ebp
jge 0x489e
incl %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3740
movl %eax, %r14d
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3740
movzbl %r14b, %ecx
shll $0x8, %ecx
movzbl %al, %ebp
orl %ecx, %ebp
movq %rbx, %rdi
callq 0x3734
cmpl %eax, %ebp
jge 0x48b3
movq %rbx, %rdi
movl %ebp, %esi
callq 0x373c
movq 0x6769(%rip), %rbx      # 0xafc8
leaq 0x2e8a(%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 0x674b(%rip), %rbx      # 0xaff0
leaq 0x2f4a(%rip), %rsi      # 0x77f6
movl $0x34, %edx
jmp 0x48c6
movq 0x6736(%rip), %rbx      # 0xaff0
leaq 0x2e81(%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 0x49e4
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3734
cmpl %eax, %ebp
jge 0x4983
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3740
movsbl %al, %ebp
addl %r14d, %ebp
js 0x4998
movq %rbx, %rdi
callq 0x3734
cmpl %eax, %ebp
jge 0x4998
movq %rbx, %rdi
movl %ebp, %esi
callq 0x373c
movq 0x6684(%rip), %rbx      # 0xafc8
leaq 0x2da5(%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 0x6666(%rip), %rbx      # 0xaff0
leaq 0x2e65(%rip), %rsi      # 0x77f6
movl $0x34, %edx
jmp 0x49ab
movq 0x6651(%rip), %rbx      # 0xaff0
leaq 0x2d9c(%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 0x49e4
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x36b0
leaq 0x6300(%rip), %rax      # 0xad58
movq %rax, (%rbx)
movq 0x6566(%rip), %r14      # 0xafc8
leaq 0x2ddb(%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 0x6534(%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 0x3714
movq %r14, %rdi
callq 0x2250
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2af4(%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 0x3738
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 0x2cce(%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 0x2c88(%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 0x6378(%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 0x6347(%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_O1/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 0x3740
movzbl %al, %eax
cmpl $0x59, %eax
jg 0x4d37
cmpl $0x37, %eax
jg 0x4d54
cmpl $0xc, %eax
je 0x4d7f
cmpl $0x37, %eax
jne 0x4db7
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x4f4c
cmpl $0x5c, %eax
jg 0x4d6c
cmpl $0x5a, %eax
je 0x4d8d
cmpl $0x5b, %eax
jne 0x4db7
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x5260
cmpl $0x38, %eax
je 0x4d9b
cmpl $0x53, %eax
jne 0x4db7
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x50d4
cmpl $0x5d, %eax
je 0x4da9
cmpl $0x64, %eax
jne 0x4db7
popq %rbx
popq %r14
popq %rbp
jmp 0x5482
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x4e2a
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x5188
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x5010
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x536c
movq 0x6232(%rip), %r14      # 0xaff0
leaq 0x28fa(%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 0x3738
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_O1/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 0x3734
cmpl %eax, %ebp
jge 0x4ee6
leal 0x1(%r14), %esi
movq %rbx, %rdi
callq 0x3740
movl %eax, %r15d
addl $0x2, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3740
movzbl %r15b, %ecx
shll $0x8, %ecx
movzbl %al, %r14d
orl %ecx, %r14d
movq %rbx, %rdi
callq 0x3734
cmpl %eax, %r14d
jge 0x4efb
movzbl 0x1c(%rbx), %edx
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3756
movq %rbx, %rdi
movl %ebp, %esi
callq 0x373c
movq 0x6127(%rip), %rbx      # 0xafc8
leaq 0x2848(%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 0x6103(%rip), %rbx      # 0xaff0
leaq 0x281a(%rip), %rsi      # 0x770e
movl $0x33, %edx
jmp 0x4f0e
movq 0x60ee(%rip), %rbx      # 0xaff0
leaq 0x2839(%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 0x5482
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3734
cmpl %eax, %ebp
jge 0x4fc4
incl %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3740
movb %al, 0x1c(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x373c
movq 0x6043(%rip), %rbx      # 0xafc8
leaq 0x2764(%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 0x6025(%rip), %rbx      # 0xaff0
leaq 0x273c(%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 0x5482
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3734
cmpl %eax, %ebp
jge 0x5088
incl %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3740
movb %al, 0x1d(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x373c
movq 0x5f7f(%rip), %rbx      # 0xafc8
leaq 0x26a0(%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 0x5f61(%rip), %rbx      # 0xaff0
leaq 0x2678(%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 0x5482
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3734
cmpl %eax, %ebp
jge 0x513d
incb 0x1c(%r14)
movq %r14, %rdi
movl %ebx, %esi
callq 0x373c
movq 0x5eca(%rip), %rbx      # 0xafc8
leaq 0x25eb(%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 0x5eac(%rip), %rbx      # 0xaff0
leaq 0x25c3(%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 0x5482