LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/JenTus[P]TCEM/src_TCEM/anyoption.cc
// Function: AnyOption::valuePairs(char*, char*)
void
AnyOption::valuePairs( char *type, char *value )
{
	if ( strlen(chomp(type)) == 1  ){ /* this is a char option */
		for( int i = 0 ; i < optchar_counter ; i++ ){
			if(  optionchars[i] == type[0]  ){ /* match */
				if( optchartype[i] == COMMON_OPT ||
				    optchartype[i] == FILE_OPT )
				{
			 		setValue( type[0] , chomp(value) );
			 		return;
				}
			}
		}
	}	
	/* if no char options matched */
	for( int i = 0 ; i < option_counter ; i++ ){
		if( strcmp( options[i], type ) == 0 ){ /* match */
			if( optiontype[i] == COMMON_OPT ||
			    optiontype[i] == FILE_OPT )
			{
		 		setValue( type , chomp(value) );
		 		return;
			}
		}
	}
        printVerbose( "Unknown option in resourcefile : " );
	printVerbose( type );
	printVerbose( );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbp
movb 0xa8(%rdi), %bl
movq %rsi, %r13
movq %r13, %rax
incq %r13
cmpb %bl, (%rax)
je 0x10122
leaq -0x1(%r13), %r12
movq %r12, %rdi
callq 0x3130
addq %r13, %rax
movq %rax, %rcx
decq %rax
cmpb %bl, -0x2(%rcx)
je 0x1013b
movb 0xa9(%rbp), %r13b
movb %r13b, (%rax)
movq %r12, %rdi
callq 0x3130
cmpq $0x1, %rax
jne 0x10191
movslq 0x70(%rbp), %rax
testq %rax, %rax
jle 0x10191
movq 0x58(%rbp), %rcx
movq 0x60(%rbp), %rdx
movb (%r14), %r12b
xorl %esi, %esi
cmpb %r12b, (%rcx,%rsi)
jne 0x10189
movl (%rdx,%rsi,4), %edi
orl $0x2, %edi
cmpl $0x3, %edi
je 0x1025f
incq %rsi
cmpq %rsi, %rax
jne 0x10174
movb %r13b, 0xf(%rsp)
movq %rbp, 0x10(%rsp)
movslq 0x50(%rbp), %r12
testq %r12, %r12
jle 0x101d8
movq 0x10(%rsp), %rax
movq 0x38(%rax), %r13
movq 0x40(%rax), %rbp
xorl %ebx, %ebx
movq (%r13,%rbx,8), %rdi
movq %r14, %rsi
callq 0x3430
testl %eax, %eax
jne 0x101d0
movl (%rbp,%rbx,4), %eax
orl $0x2, %eax
cmpl $0x3, %eax
je 0x1020d
incq %rbx
cmpq %rbx, %r12
jne 0x101b3
leaq 0x26f1(%rip), %rsi      # 0x128d0
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0xedb0
movq %rbx, %rdi
movq %r14, %rsi
callq 0xedfe
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xed76
movq 0x10(%rsp), %r13
movb 0xa8(%r13), %bl
movq %r15, %rax
incq %r15
cmpb %bl, (%rax)
je 0x10219
leaq -0x1(%r15), %r12
movq %r12, %rdi
callq 0x3130
addq %r15, %rax
movq %rax, %rcx
decq %rax
cmpb %bl, -0x2(%rcx)
je 0x10232
movb 0xf(%rsp), %cl
movb %cl, (%rax)
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf650
movb 0xa8(%rbp), %bl
movq %r15, %rax
incq %r15
cmpb %bl, (%rax)
je 0x10265
leaq -0x1(%r15), %r14
movq %r14, %rdi
callq 0x3130
addq %r15, %rax
movq %rax, %rcx
decq %rax
cmpb %bl, -0x2(%rcx)
je 0x1027e
movb %r13b, (%rax)
movsbl %r12b, %esi
movq %rbp, %rdi
movq %r14, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf7ba
nop
// File: /workspace/github_cpp_makefile_star2_O3/JenTus[P]TCEM/src_TCEM/anyoption.cc
// Function: AnyOption::chomp(char*)
char*
AnyOption::chomp( char *str )
{
        while( *str == whitespace )
                str++;
        char *end = str+strlen(str)-1;
        while( *end == whitespace )
                end--;
        *(end+1) = nullterminate;
        return str;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movb 0xa8(%rdi), %bpl
movq %r15, %rax
incq %r15
cmpb %bpl, (%rax)
je 0x102be
leaq -0x1(%r15), %r14
movq %r14, %rdi
callq 0x3130
addq %r15, %rax
movq %rax, %rcx
decq %rax
cmpb %bpl, -0x2(%rcx)
je 0x102d8
movb 0xa9(%rbx), %cl
movb %cl, (%rax)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/JenTus[P]TCEM/src_TCEM/anyoption.cc
// Function: AnyOption::printUsage()
void
AnyOption::printUsage()
{
	
	if( once ) {
		once = false ;
		cout << endl ;
		for( int i = 0 ; i < usage_lines ; i++ )
			cout << usage[i] << endl ;	
		cout << endl ;
	}
}

// Assembly:
cmpb $0x1, 0xab(%rdi)
jne 0x103fb
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movb $0x0, 0xab(%rdi)
movq 0x7cb8(%rip), %rbx      # 0x17fd8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x32d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31e0
cmpl $0x0, 0x94(%r14)
jle 0x103c9
xorl %r12d, %r12d
movq 0x88(%r14), %rax
movq (%rax,%r12,8), %r15
testq %r15, %r15
je 0x1037c
movq %r15, %rdi
callq 0x3130
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x3340
jmp 0x10393
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x3560
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x32d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31e0
incq %r12
movslq 0x94(%r14), %rax
cmpq %rax, %r12
jl 0x10354
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x32d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x31e0
retq
// File: /workspace/github_cpp_makefile_star2_O3/JenTus[P]TCEM/src_TCEM/anyoption.cc
// Function: AnyOption::addUsage(char const*)
void
AnyOption::addUsage( const char *line )
{
	if( usage_lines >= max_usage_lines ){
		if( doubleUsageStorage() == false ){
			addUsageError( line );
			exit(1);
		}
	}
	usage[ usage_lines ] = line ;	
	usage_lines++;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0x94(%rdi), %eax
cmpl 0x90(%rdi), %eax
jl 0x10426
movq %rbx, %rdi
callq 0xeca0
testb %al, %al
je 0x10443
movl 0x94(%rbx), %eax
movq 0x88(%rbx), %rcx
cltq
movq %r14, (%rcx,%rax,8)
incl %eax
movl %eax, 0x94(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rsi
callq 0x1044c
nop
// File: /workspace/github_cpp_makefile_star2_O3/JenTus[P]TCEM/src_TCEM/anyoption.cc
// Function: AnyOption::addUsageError(char const*)
void
AnyOption::addUsageError( const char *line )
{
	cout << endl ;
	cout << "OPTIONS ERROR : Failed allocating extra memory " << endl ;
	cout << "While adding the usage/help  : \""<< line << "\"" << endl;
	cout << "Exiting." << endl ;
	cout << endl ;
	exit(0);

}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq 0x7b7e(%rip), %rbx      # 0x17fd8
movq %rbx, %rdi
callq 0x3150
leaq 0x239a(%rip), %rsi      # 0x12803
movq %rbx, %rdi
callq 0x32e0
movq %rax, %rdi
callq 0x3150
leaq 0x2472(%rip), %rsi      # 0x128f2
movq %rbx, %rdi
callq 0x32e0
movq %rax, %rdi
movq %r14, %rsi
callq 0x32e0
leaq 0x2477(%rip), %rsi      # 0x12911
movq %rax, %rdi
callq 0x32e0
movq %rax, %rdi
callq 0x3150
leaq 0x2306(%rip), %rsi      # 0x127b7
movq %rbx, %rdi
callq 0x32e0
movq %rax, %rdi
callq 0x3150
movq %rbx, %rdi
callq 0x3150
xorl %edi, %edi
callq 0x3390
// File: /workspace/github_cpp_makefile_star2_O3/JenTus[P]TCEM/src_TCEM/sfmt/SFMT.c
// Function: sfmt_fill_array32
void sfmt_fill_array32(sfmt_t * sfmt, uint32_t *array, int size) {
    assert(sfmt->idx == SFMT_N32);
    assert(size % 4 == 0);
    assert(size >= SFMT_N32);

    gen_rand_array(sfmt, (w128_t *)array, size / 4);
    sfmt->idx = SFMT_N32;
}

// Assembly:
pushq %rbx
cmpl $0x270, 0x9c0(%rdi)     # imm = 0x270
jne 0x10748
testb $0x3, %dl
jne 0x10767
cmpl $0x26f, %edx            # imm = 0x26F
jle 0x10786
movq %rdi, %rbx
shrl $0x2, %edx
callq 0x107a5
movl $0x270, 0x9c0(%rbx)     # imm = 0x270
popq %rbx
retq
leaq 0x221e(%rip), %rdi      # 0x1296d
leaq 0x222d(%rip), %rsi      # 0x12983
leaq 0x223b(%rip), %rcx      # 0x12998
movl $0x11c, %edx            # imm = 0x11C
callq 0x31b0
leaq 0x225c(%rip), %rdi      # 0x129ca
leaq 0x220e(%rip), %rsi      # 0x12983
leaq 0x221c(%rip), %rcx      # 0x12998
movl $0x11d, %edx            # imm = 0x11D
callq 0x31b0
leaq 0x224b(%rip), %rdi      # 0x129d8
leaq 0x21ef(%rip), %rsi      # 0x12983
leaq 0x21fd(%rip), %rcx      # 0x12998
movl $0x11e, %edx            # imm = 0x11E
callq 0x31b0
// File: /workspace/github_cpp_makefile_star2_O3/JenTus[P]TCEM/src_TCEM/sfmt/SFMT.c
// Function: sfmt_fill_array64
void sfmt_fill_array64(sfmt_t * sfmt, uint64_t *array, int size) {
    assert(sfmt->idx == SFMT_N32);
    assert(size % 2 == 0);
    assert(size >= SFMT_N64);

    gen_rand_array(sfmt, (w128_t *)array, size / 2);
    sfmt->idx = SFMT_N32;

#if defined(BIG_ENDIAN64) && !defined(ONLY64)
    swap((w128_t *)array, size /2);
#endif
}

// Assembly:
pushq %rbx
cmpl $0x270, 0x9c0(%rdi)     # imm = 0x270
jne 0x10d10
testb $0x1, %dl
jne 0x10d2f
cmpl $0x137, %edx            # imm = 0x137
jle 0x10d4e
movq %rdi, %rbx
shrl %edx
callq 0x107a5
movl $0x270, 0x9c0(%rbx)     # imm = 0x270
popq %rbx
retq
leaq 0x1c56(%rip), %rdi      # 0x1296d
leaq 0x1c65(%rip), %rsi      # 0x12983
leaq 0x1cc4(%rip), %rcx      # 0x129e9
movl $0x140, %edx            # imm = 0x140
callq 0x31b0
leaq 0x1ce5(%rip), %rdi      # 0x12a1b
leaq 0x1c46(%rip), %rsi      # 0x12983
leaq 0x1ca5(%rip), %rcx      # 0x129e9
movl $0x141, %edx            # imm = 0x141
callq 0x31b0
leaq 0x1cd4(%rip), %rdi      # 0x12a29
leaq 0x1c27(%rip), %rsi      # 0x12983
leaq 0x1c86(%rip), %rcx      # 0x129e9
movl $0x142, %edx            # imm = 0x142
callq 0x31b0
// File: /workspace/github_cpp_makefile_star2_O3/ef-gy[P]libefgy/include/ef.gy/series.h
// Function: efgy::math::series::power<efgy::math::numeric::fractional<long long>, efgy::math::algorithm::powerSeriesE, unsigned long long>::sumTo(unsigned long long const&, efgy::math::numeric::fractional<long long> const&, efgy::math::numeric::fractional<long long> const&, efgy::math::numeric::fractional<long long> const&, efgy::math::numeric::fractional<long long> const&)
constexpr static Q sumTo(const N &n, const Q &f, const Q &x, const Q &c,
                           const Q &acc) {
    return n == 0 ? acc + (sequence::at(0) * f)
                  : sumTo(n - 1, f, x, c,
                          acc + (sequence::at(n) * f *
                                 exponentiate::integral<Q>::raise(x - c, n)));
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r8, %r14
movq %rsi, %rbx
movq (%rdi), %rax
testq %rax, %rax
je 0x112a3
movq %rcx, %r15
movq %rdx, %r12
movq %rdi, %rbp
decq %rax
leaq 0x28(%rsp), %rcx
movq %rax, (%rcx)
callq 0x1149c
imulq (%rbx), %rax
imulq 0x8(%rbx), %rdx
movq %rsp, %r13
movq %rax, (%r13)
movq %rdx, 0x8(%r13)
movq %r13, %rdi
callq 0x11416
movq (%r13), %rax
movq %rax, 0x18(%rsp)
movq 0x8(%r13), %rax
movq %rax, 0x20(%rsp)
movq 0x8(%r15), %rax
movq (%r12), %rcx
imulq %rax, %rcx
movq 0x8(%r12), %rdx
movq (%r15), %rsi
imulq %rdx, %rsi
subq %rsi, %rcx
imulq %rax, %rdx
movq %rcx, (%r13)
movq %rdx, 0x8(%r13)
movq %rsp, %r13
movq %r13, %rdi
callq 0x11416
movaps (%r13), %xmm0
leaq 0x30(%rsp), %rdi
movaps %xmm0, (%rdi)
movq (%rbp), %rax
leaq 0x40(%rsp), %rsi
movq %rax, (%rsi)
callq 0x11314
imulq 0x18(%rsp), %rax
imulq 0x20(%rsp), %rdx
movq %rax, (%r13)
movq %rdx, 0x8(%r13)
movq %rsp, %r13
movq %r13, %rdi
callq 0x11416
movq 0x8(%r13), %rax
movq (%r14), %rcx
imulq %rax, %rcx
movq 0x8(%r14), %rdx
movq (%r13), %rsi
imulq %rdx, %rsi
addq %rcx, %rsi
imulq %rax, %rdx
movq %rsi, (%r13)
movq %rdx, 0x8(%r13)
movq %rsp, %r14
movq %r14, %rdi
callq 0x11416
movaps (%r14), %xmm0
movaps %xmm0, (%r14)
movq %rsp, %r8
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0x1117c
jmp 0x11305
leaq 0x30(%rsp), %rdi
movq $0x0, (%rdi)
callq 0x1149c
imulq (%rbx), %rax
imulq 0x8(%rbx), %rdx
movq %rsp, %rbx
movq %rax, (%rbx)
movq %rdx, 0x8(%rbx)
movq %rbx, %rdi
callq 0x11416
movq 0x8(%rbx), %rax
movq (%r14), %rcx
imulq %rax, %rcx
movq 0x8(%r14), %rdx
movq (%rbx), %rsi
imulq %rdx, %rsi
addq %rcx, %rsi
imulq %rax, %rdx
movq %rsi, (%rbx)
movq %rdx, 0x8(%rbx)
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x11416
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tobias93[P]piano/rtaudio/tests/testall.cpp
// Function: sawi(void*, void*, unsigned int, double, unsigned int, void*)
int sawi( void *outputBuffer, void * /*inputBuffer*/, unsigned int nBufferFrames,
          double /*streamTime*/, RtAudioStreamStatus status, void *data )
{
  unsigned int i, j;
  extern unsigned int channels;
  double *buffer = (double *) outputBuffer;
  double *lastValues = (double *) data;

  if ( status )
    std::cout << "Stream underflow detected!" << std::endl;

  for ( i=0; i<nBufferFrames; i++ ) {
    for ( j=0; j<channels; j++ ) {
      *buffer++ = (double) lastValues[j];
      lastValues[j] += BASE_RATE * (j+1+(j*0.1));
      if ( lastValues[j] >= 1.0 ) lastValues[j] -= 2.0;
    }
  }

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %r8, %rbx
movl %edx, %ebp
movq %rdi, %r14
testl %ecx, %ecx
je 0x4659
movq 0x89aa(%rip), %r15      # 0xcfc8
leaq 0x4b94(%rip), %rsi      # 0x91b9
movl $0x1a, %edx
movq %r15, %rdi
callq 0x4210
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x41d0
movsbl %al, %esi
movq %r15, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4140
testl %ebp, %ebp
je 0x46fe
movl 0x8bc1(%rip), %eax      # 0xd228
xorl %ecx, %ecx
movsd 0x4997(%rip), %xmm0     # 0x9008
movsd 0x4997(%rip), %xmm1     # 0x9010
movsd 0x4997(%rip), %xmm2     # 0x9018
movsd 0x4997(%rip), %xmm3     # 0x9020
testq %rax, %rax
je 0x46f8
xorl %edx, %edx
xorl %esi, %esi
leaq 0x1(%rsi), %rdi
movl %edi, %r8d
xorps %xmm4, %xmm4
cvtsi2sd %r8, %xmm4
movsd (%rbx,%rsi,8), %xmm5
movl %esi, %r8d
xorps %xmm6, %xmm6
cvtsi2sd %r8, %xmm6
movsd %xmm5, (%r14,%rsi,8)
mulsd %xmm0, %xmm6
addsd %xmm4, %xmm6
mulsd %xmm1, %xmm6
addsd %xmm5, %xmm6
movapd %xmm6, %xmm4
addsd %xmm2, %xmm4
movapd %xmm3, %xmm5
cmpnlesd %xmm6, %xmm5
andpd %xmm5, %xmm6
andnpd %xmm4, %xmm5
orpd %xmm6, %xmm5
movlpd %xmm5, (%rbx,%rsi,8)
addq $-0x8, %rdx
movq %rdi, %rsi
cmpq %rdi, %rax
jne 0x4692
subq %rdx, %r14
incl %ecx
cmpl %ebp, %ecx
jne 0x4689
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/main.cpp
// Function: main
int main(int argc, char *argv[])
{
	// VARIABLES USED FOR THIS PROGRAM
	
	// userOption: stores the user option. The program must handle both
	// upperand lowercase so that this variable will save only lowercase value.
	// The program have to change it to lowercase before saving
	char userOption;

	// The Microcontroller of the program
	Microcontroller* microcontroller = 0;

	
	// EXECUTION OF PROGRAM

	// print welcome
	cout << "MICROCONTROLLER SIMULATOR" << endl;
	
	// Start the program
	// Loop for user enter option until user enter 'q' or 'Q'
	do
	{
		// Display the application prompt
		cout << "Message: Enter the option you want. Type h for help" << endl;
		cout << "> ";
		
		// Read user input
		userOption = inputOption();

		cout << endl;

		// Check the userOption variable and the switch the user to the right function
		switchOption(userOption, &microcontroller);

		if(userOption != 'q'){
			// Display a newline character, just for decoration
			cout << endl;
		}
		
	} while (userOption != 'q');

	// print the goodbye message
	cout << "Quitting..." << endl;
	cout << "Thank you for using my software." << endl;
	
	// End the program
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
leaq 0x8(%rsp), %r14
movq $0x0, (%r14)
movq 0x8b3d(%rip), %rbx      # 0xafc8
leaq 0x4bb6(%rip), %rsi      # 0x7048
movl $0x19, %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
leaq 0x4b95(%rip), %r15      # 0x7062
leaq 0x4bc2(%rip), %r12      # 0x7096
movl $0x33, %edx
movq %rbx, %rdi
movq %r15, %rsi
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
movl $0x2, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2190
callq 0x260e
movl %eax, %ebp
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
movsbl %bpl, %ebp
movl %ebp, %edi
movq %r14, %rsi
callq 0x26b5
cmpb $0x71, %bpl
je 0x2589
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
jmp 0x24d4
leaq 0x4b09(%rip), %rsi      # 0x7099
movl $0xb, %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
leaq 0x4ada(%rip), %rsi      # 0x70a5
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
callq 0x20e0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/main.cpp
// Function: optionConnectHandler(mcontroller::Microcontroller**)
void optionConnectHandler(Microcontroller** microcontroller){

	// a factory for creating microcontroller
	MicrocontrollerFactory factory;

	// first free memory for the existing microcontroller
	delete *microcontroller;
	
	// display the prompt to ask user to enter microcontroller type
	cout << "Message: Connect to Microcontroller" << endl;
	cout << "Message: Auto disconnect other Microcontroller (if aleady connected)" << endl;
	cout << "Message: Enter the type of microcontroller to connect" << endl;
	cout << "type? ";

	// read the microcontroller type from user
	string inputMicrocontrollerType;
	cin >> inputMicrocontrollerType;

	// create microcontroller
	(*microcontroller) = factory.createMicrocontroller(inputMicrocontrollerType);
	
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
movq %rdi, %rbx
leaq 0x40(%rsp), %rdi
callq 0x5510
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x2750
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x8871(%rip), %r14      # 0xafc8
leaq 0x4ab1(%rip), %rsi      # 0x720f
movl $0x23, %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 0x883f(%rip), %rdi      # 0xafc8
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq 0x882b(%rip), %r14      # 0xafc8
leaq 0x4a8f(%rip), %rsi      # 0x7233
movl $0x44, %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 0x87f9(%rip), %rdi      # 0xafc8
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq 0x87e5(%rip), %r14      # 0xafc8
leaq 0x4a8e(%rip), %rsi      # 0x7278
movl $0x35, %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 0x87b3(%rip), %rdi      # 0xafc8
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq 0x879f(%rip), %rdi      # 0xafc8
leaq 0x4a7e(%rip), %rsi      # 0x72ae
movl $0x6, %edx
callq 0x2190
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
movq $0x0, -0x8(%r14)
movb $0x0, (%r14)
movq 0x8782(%rip), %rdi      # 0xafd8
movq %rsp, %rsi
callq 0x21a0
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0x35b2
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x5702
movq %rax, (%rbx)
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x28a6
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2170
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x28bc
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2170
leaq 0x40(%rsp), %rdi
callq 0x3530
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x28ef
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x28ef
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x290a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x290a
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x3530
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/main.cpp
// Function: executeOptionIfConnected(mcontroller::Microcontroller**, void (*)(mcontroller::Microcontroller**))
void executeOptionIfConnected(Microcontroller** microcontroller, optionHandler* handlerFunction){
	
	// check whether the microcontroller is connected
	if((*microcontroller) == 0){
		// Not connected
		// print the message to cerr
		cerr << "Error: Not connected to any controller!" << endl;
		cerr << "Message: Type c to connect to a controller." << endl;
		cerr << "Message: Type h for help." << endl;
	} else {
		// Connected
		// execute the handler function
		handlerFunction(microcontroller);
	}
}

// Assembly:
cmpq $0x0, (%rdi)
je 0x2924
jmpq *%rsi
pushq %rbx
movq 0x86c4(%rip), %rbx      # 0xaff0
leaq 0x4bc4(%rip), %rsi      # 0x74f7
movl $0x27, %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
leaq 0x4bb1(%rip), %rsi      # 0x751f
movl $0x2b, %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
leaq 0x4ba2(%rip), %rsi      # 0x754b
movl $0x19, %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/main.cpp
// Function: optionExecuteHandler(mcontroller::Microcontroller**)
void optionExecuteHandler(mcontroller::Microcontroller** microcontroller){

	// print the message for user
	cout << "Message: Execute from current PC" << endl;
	
	// execute the opcode
	(*microcontroller)->execute();
	
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x83e1(%rip), %r14      # 0xafc8
leaq 0x4848(%rip), %rsi      # 0x7436
movl $0x20, %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 (%rbx), %rdi
movq (%rdi), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *0x18(%rax)
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/main.cpp
// Function: optionExecuteFromSpecificLocationHandler(mcontroller::Microcontroller**)
void optionExecuteFromSpecificLocationHandler(mcontroller::Microcontroller** microcontroller){

	// display the message for user
	cout << "Message: Execute from specific location." << endl;
	cout << "Message: Enter the memory location to execute (hexadecimal format)." << endl;
	
	// input location from user
	int location = (*microcontroller)->inputHexadecimal("location? ");

	// execute the opcode from location
	(*microcontroller)->executeFromLocation(location);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq 0x8380(%rip), %r14      # 0xafc8
leaq 0x4808(%rip), %rsi      # 0x7457
movl $0x28, %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
leaq 0x47f6(%rip), %rsi      # 0x7480
movl $0x43, %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 (%rbx), %r14
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x47f2(%rip), %rsi      # 0x74c4
leaq 0x47f5(%rip), %rdx      # 0x74ce
movq %rsp, %r15
movq %r15, %rdi
callq 0x3648
movq %r14, %rdi
movq %r15, %rsi
callq 0x386c
movl %eax, %ebp
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x2d07
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2170
movq (%rbx), %rdi
movq (%rdi), %rax
movl %ebp, %esi
callq *0x20(%rax)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x2d38
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2170
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/main.cpp
// Function: optionLookAtMemoryHandler(mcontroller::Microcontroller**)
void optionLookAtMemoryHandler(mcontroller::Microcontroller** microcontroller){

	// display the message for user
	cout << "Message: Look at memory." << endl;
	cout << "Message: Enter the memory location to look at (hexadecimal format)." << endl;
	
	// the memory location the user input
	int location;
	
	// input memory location
	location = (*microcontroller)->lookUpMemoryAddress();

	// check if the input location is valid
	if(location != Microcontroller::memoryLocationInvalid){
		// print out the value at the memory address
		unsigned int value = (*microcontroller)->getMemoryValueAtLocation(location);
		cout << "Message: The value at location ";
		cout << hex << location;
		cout << " is: ";
		cout << hex << value;
		cout << endl;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x8277(%rip), %rbx      # 0xafc8
leaq 0x455d(%rip), %rsi      # 0x72b5
movl $0x18, %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
leaq 0x453b(%rip), %rsi      # 0x72ce
movl $0x43, %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
movq (%r14), %rdi
callq 0x379a
cmpl $-0x1, %eax
je 0x2e81
movl %eax, %r15d
movq (%r14), %rdi
movl %eax, %esi
callq 0x3770
movl %eax, %ebp
leaq 0x4524(%rip), %rsi      # 0x7312
movl $0x1f, %edx
movq %rbx, %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
movl %r15d, %esi
callq 0x2230
leaq 0x4510(%rip), %rsi      # 0x7332
movl $0x5, %edx
movq %rbx, %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)
movzbl %bpl, %esi
movq %rbx, %rdi
callq 0x20d0
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
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/microcontroller.cpp
// Function: mcontroller::Microcontroller::Microcontroller(int)
Microcontroller::Microcontroller(int memorySize){
		// init the memory size
		this->memorySize = memorySize;

		// init the memory array
		this->memory = new unsigned char [this->memorySize];
		this->initMemory(0);
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x756a(%rip), %rax      # 0xac58
movq %rax, (%rdi)
movl %esi, 0x18(%rdi)
movslq %esi, %r14
movq %r14, %rdi
callq 0x2030
movq %rax, 0x10(%rbx)
testl %r14d, %r14d
jle 0x371e
xorl %eax, %eax
movq 0x10(%rbx), %rcx
movb $0x0, (%rcx,%rax)
incq %rax
movslq 0x18(%rbx), %rcx
cmpq %rcx, %rax
jl 0x370a
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/microcontroller.cpp
// Function: mcontroller::Microcontroller::getMemoryValueAtLocation(int)
unsigned char Microcontroller::getMemoryValueAtLocation(int location){
		if(location < 0 || location >= this->getMemorySize()){
			return 0;
		} else {
			return (this->getMemory())[location];
		}
	}

// Assembly:
xorl %eax, %eax
testl %esi, %esi
js 0x3784
cmpl %esi, 0x18(%rdi)
jle 0x3784
movq 0x10(%rdi), %rax
movl %esi, %ecx
movb (%rax,%rcx), %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tmtxt[P]microcontroller-emulation/microcontroller.cpp
// Function: mcontroller::Microcontroller::lookUpMemoryAddress()
int Microcontroller::lookUpMemoryAddress(){

		// Init variables here
		// The input location
		int location = this->inputHexadecimal("location? ");

		// Validate that the location is out of memory array index
		if((location < 0) || (location >= this->getMemorySize())){
			// Display the error for user
			cerr << "Error: Invalid address!" << endl;
			return Microcontroller::memoryLocationInvalid;
		} else {
			// Address valid, return the address location
			return location;
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x3d0d(%rip), %rsi      # 0x74c4
leaq 0x3d10(%rip), %rdx      # 0x74ce
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x3648
movq %r14, %rsi
callq 0x386c
movl %eax, %ebp
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x37ec
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2170
testl %ebp, %ebp
js 0x37f5
cmpl 0x18(%rbx), %ebp
jl 0x383c
movq 0x77f4(%rip), %rbx      # 0xaff0
leaq 0x3dd0(%rip), %rsi      # 0x75d3
movl $0x17, %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
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3863
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2170
movq %rbx, %rdi
callq 0x2250
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x7740(%rip), %rdi      # 0xafc8
callq 0x2190
movq 0x7744(%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 0x397d
movq 0x7721(%rip), %r15      # 0xaff0
leaq 0x3d15(%rip), %r12      # 0x75eb
movq 0x76eb(%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 0x38e2
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_O3/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 0x3ac4(%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 0x3ac7(%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 0x73aa(%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 0x7379(%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/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 0x735d(%rip), %rbx      # 0xafc8
leaq 0x3a32(%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_O3/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 0x3770
movzbl %al, %eax
cmpl $0x5a, %eax
jle 0x3cfd
cmpl $0x6f, %eax
jg 0x3d1e
cmpl $0x5b, %eax
je 0x3db7
cmpl $0x6e, %eax
jne 0x3d45
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x417c
cmpl $0x50, %eax
je 0x3d37
cmpl $0x51, %eax
je 0x3dd3
cmpl $0x5a, %eax
jne 0x3d45
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x3fc8
cmpl $0x70, %eax
je 0x3dc5
cmpl $0xff, %eax
jne 0x3d45
popq %rbx
popq %r14
popq %rbp
jmp 0x4390
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x3de2
movq 0x72a4(%rip), %r14      # 0xaff0
leaq 0x396c(%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
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x40a2
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x427a
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x3ea6
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3764
cmpl %eax, %ebp
jge 0x3e5a
incl %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3770
movb %al, 0x1c(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x376c
movq 0x71ad(%rip), %rbx      # 0xafc8
leaq 0x38ce(%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 0x718f(%rip), %rbx      # 0xaff0
leaq 0x38a6(%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
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3764
cmpl %eax, %ebp
jge 0x3f62
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 0x3f77
movzbl 0x1c(%rbx), %edx
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3786
movq %rbx, %rdi
movl %ebp, %esi
callq 0x376c
movq 0x70ab(%rip), %rbx      # 0xafc8
leaq 0x37cc(%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 0x7087(%rip), %rbx      # 0xaff0
leaq 0x379e(%rip), %rsi      # 0x770e
movl $0x33, %edx
jmp 0x3f8a
movq 0x7072(%rip), %rbx      # 0xaff0
leaq 0x37bd(%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 0x4390
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3764
cmpl %eax, %ebp
jge 0x4050
movb 0x1c(%rbx), %r15b
incl %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3770
addb %r15b, %al
movb %al, 0x1c(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x376c
movq 0x6fbd(%rip), %rbx      # 0xafc8
leaq 0x36de(%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 0x6f99(%rip), %rbx      # 0xaff0
leaq 0x36b0(%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 0x4390
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3764
cmpl %eax, %ebp
jge 0x412b
movb 0x1c(%rbx), %r15b
incl %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3770
subb %al, %r15b
movb %r15b, 0x1c(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x376c
movq 0x6ee2(%rip), %rbx      # 0xafc8
leaq 0x3603(%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 0x6ebe(%rip), %rbx      # 0xaff0
leaq 0x35d5(%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 0x4390
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3764
cmpl %eax, %ebp
jge 0x421a
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 0x422f
movq %rbx, %rdi
movl %ebp, %esi
callq 0x376c
movq 0x6ded(%rip), %rbx      # 0xafc8
leaq 0x350e(%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 0x6dcf(%rip), %rbx      # 0xaff0
leaq 0x34e6(%rip), %rsi      # 0x770e
movl $0x33, %edx
jmp 0x4242
movq 0x6dba(%rip), %rbx      # 0xaff0
leaq 0x3505(%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 0x4390