LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/IlanPrice[P]Linear-Algebra-Library-in-Cplusplus/Matrix.cpp
// Function: givens(double, double)
std::pair <double, double> givens(double a, double b)
{
	double r = sqrt((a*a) + (b*b));
	double c = a/r; double s = -b/r;
	std::pair <double,double> giv = std::make_pair(c,s);
	return giv;
}

// Assembly:
subq $0x28, %rsp
movapd %xmm0, %xmm3
movapd %xmm1, %xmm2
mulsd %xmm1, %xmm2
mulsd %xmm0, %xmm0
addsd %xmm2, %xmm0
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
jb 0x7f15
sqrtsd %xmm0, %xmm0
jmp 0x7f32
movapd %xmm1, 0x10(%rsp)
movsd %xmm3, 0x8(%rsp)
callq 0x20d0
movsd 0x8(%rsp), %xmm3
movapd 0x10(%rsp), %xmm1
xorpd 0x4106(%rip), %xmm1     # 0xc040
divsd %xmm0, %xmm3
divsd %xmm0, %xmm1
movapd %xmm3, %xmm0
addq $0x28, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/IlanPrice[P]Linear-Algebra-Library-in-Cplusplus/Matrix.cpp
// Function: Matrix::applygivens(int, int, double, double)
void Matrix:: applygivens(int i, int j, double c, double s)
{
	for (int k = 1; k<=mColumns; k++)
	{
		double newi = c*mElements[i-1][k-1] - s*mElements[j-1][k-1];
		double newj = s*mElements[i-1][k-1] + c*mElements[j-1][k-1];
		mElements[i-1][k-1] = newi; mElements[j-1][k-1] = newj;
	}
}

// Assembly:
movl 0xc(%rdi), %eax
testl %eax, %eax
jle 0x7fa4
movq (%rdi), %rdi
movslq %esi, %rcx
movq -0x8(%rdi,%rcx,8), %rcx
movslq %edx, %rdx
movq -0x8(%rdi,%rdx,8), %rdx
xorl %esi, %esi
movsd (%rcx,%rsi,8), %xmm2
movsd (%rdx,%rsi,8), %xmm3
movapd %xmm3, %xmm4
mulsd %xmm1, %xmm4
movapd %xmm0, %xmm5
mulsd %xmm2, %xmm5
subsd %xmm4, %xmm5
mulsd %xmm0, %xmm3
mulsd %xmm1, %xmm2
addsd %xmm3, %xmm2
movsd %xmm5, (%rcx,%rsi,8)
movsd %xmm2, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0x7f68
retq
// File: /workspace/github_cpp_makefile_star2_O1/iZhangHui[P]CppPrimer/CH17_SpecializedLibraryFacilities/examples/prec.cc
// Function: main
int main()
{
	// cout.precision reports the current precision value
	cout  << "Precision: " << cout.precision()  
	      << ", Value: "   << sqrt(2.0) << endl;
	
	// cout.precision(12) asks that 12 digits of precision be printed
	cout.precision(12);
	cout << "Precision: " << cout.precision() 
	     << ", Value: "   << sqrt(2.0) << endl;
	
	// alternative way to set precision using the setprecision manipulator
	cout << setprecision(3);
	cout << "Precision: " << cout.precision() 
	     << ", Value: "   << sqrt(2.0) << endl;
	
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x2dda(%rip), %rbx      # 0x3fd8
leaq 0xe0b(%rip), %r14       # 0x2010
movl $0xb, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1080
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq 0x8(%rbx,%rax), %rsi
movq %rbx, %rdi
callq 0x1060
movq %rax, %r12
leaq 0xde9(%rip), %r15       # 0x201c
movl $0x9, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x1080
movsd 0xdbd(%rip), %xmm0      # 0x2008
movq %r12, %rdi
callq 0x10a0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x1070
movsbl %al, %esi
movq %r12, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1040
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0xc, 0x8(%rbx,%rax)
movl $0xb, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1080
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq 0x8(%rbx,%rax), %rsi
movq %rbx, %rdi
callq 0x1060
movq %rax, %r12
movl $0x9, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x1080
movq %r12, %rdi
movsd 0xd39(%rip), %xmm0      # 0x2008
callq 0x10a0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x1070
movsbl %al, %esi
movq %r12, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1040
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0x3, 0x8(%rbx,%rax)
movl $0xb, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1080
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq 0x8(%rbx,%rax), %rsi
movq %rbx, %rdi
callq 0x1060
movq %rax, %rbx
movl $0x9, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x1080
movq %rbx, %rdi
movsd 0xcb8(%rip), %xmm0      # 0x2008
callq 0x10a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1070
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1040
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/sanket143[P]2048-Terminal-Game/./src/board.h
// Function: gb::Board::display()
void display() {
        flag = false;
        for(int row = 0; row < size; row++) {
          for(int col = 0; col < size; col++) {
            if(tiles[row][col] == 0) {
              std::cout << " .  ";
            } else {
              if(tiles[row][col] < 10) {
                std::cout << " " << tiles[row][col] << "  ";
              }
              else if(tiles[row][col] < 100) {
                std::cout << " " << tiles[row][col] << " ";
              }
              else if(tiles[row][col] < 1000) {
                std::cout << " " <<  tiles[row][col];
              } else {
                std::cout << tiles[row][col];
              }
            }
          }
          std::cout << std::endl;
        }
        std::cout << std::endl;
      }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movb $0x0, 0x3b78(%rip)      # 0x50ea
xorl %r13d, %r13d
movq 0x3a54(%rip), %rbx      # 0x4fd0
leaq 0x1ad5(%rip), %r12      # 0x3058
xorl %r15d, %r15d
movl (%r14,%r15,4), %esi
testl %esi, %esi
je 0x15c0
cmpl $0x9, %esi
jg 0x15d1
movl $0x1, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1110
movl (%r14,%r15,4), %esi
movq %rbx, %rdi
callq 0x1170
movl $0x2, %edx
movq %rax, %rdi
leaq 0x1a99(%rip), %rsi      # 0x3057
jmp 0x15fd
movl $0x4, %edx
movq %rbx, %rdi
leaq 0x1a86(%rip), %rsi      # 0x3055
jmp 0x15fd
cmpl $0x63, %esi
jg 0x1611
movl $0x1, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1110
movl (%r14,%r15,4), %esi
movq %rbx, %rdi
callq 0x1170
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x1110
incq %r15
cmpq $0x4, %r15
jne 0x1586
jmp 0x1637
cmpl $0x3e7, %esi            # imm = 0x3E7
jg 0x162d
movl $0x1, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1110
movl (%r14,%r15,4), %esi
movq %rbx, %rdi
callq 0x1170
jmp 0x1602
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
incq %r13
addq $0x10, %r14
cmpq $0x4, %r13
jne 0x1583
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1080
// File: /workspace/github_cpp_makefile_star2_O1/sanket143[P]2048-Terminal-Game/./src/board.h
// Function: gb::Board::valid(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool valid(std::string direction) {
        std::string valid_directions[4] = {"R", "D", "L", "U"};
        for(int i = 0; i < 4; i++) {
          if(direction == valid_directions[i]) {
            return true;
          }
        }
        return false;
      }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, -0x30(%rbp)
leaq -0xa0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x198c(%rip), %rsi      # 0x305a
leaq 0x1986(%rip), %rdx      # 0x305b
leaq -0xb0(%rbp), %r15
movq %r15, %rdi
callq 0x1d4c
leaq -0x90(%rbp), %r14
leaq -0x80(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1962(%rip), %rsi      # 0x305c
leaq 0x195c(%rip), %rdx      # 0x305d
movq %r14, %rdi
callq 0x1d4c
leaq -0x70(%rbp), %r14
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1942(%rip), %rsi      # 0x305e
leaq 0x193c(%rip), %rdx      # 0x305f
movq %r14, %rdi
callq 0x1d4c
leaq -0x50(%rbp), %r14
leaq -0x40(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x1921(%rip), %rsi      # 0x3060
leaq 0x191b(%rip), %rdx      # 0x3061
movq %r14, %rdi
callq 0x1d4c
movq -0x30(%rbp), %rax
movq 0x8(%rax), %r15
movb $0x1, %r14b
leaq -0xa8(%rbp), %r13
xorl %ebx, %ebx
cmpq (%r13), %r15
jne 0x1784
testq %r15, %r15
je 0x179d
movq -0x8(%r13), %rsi
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq %r15, %rdx
callq 0x1100
testl %eax, %eax
je 0x179d
cmpq $0x3, %rbx
leaq 0x1(%rbx), %rax
setb %r14b
addq $0x20, %r13
movq %rax, %rbx
cmpq $0x4, %rax
jne 0x1762
movq $-0x80, %rbx
movq -0x10(%r12), %rdi
cmpq %rdi, %r12
je 0x17ba
movq (%r12), %rsi
incq %rsi
callq 0x10f0
addq $-0x20, %r12
addq $0x20, %rbx
jne 0x17a4
andb $0x1, %r14b
movl %r14d, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x17e1
jmp 0x17e1
movq %rax, %rbx
jmp 0x17ec
movq %rax, %rbx
movq %r15, %r14
cmpq %r14, %r15
je 0x1820
addq $-0x10, %r14
leaq -0xb0(%rbp), %r15
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0x1810
movq (%r14), %rsi
incq %rsi
callq 0x10f0
leaq -0x20(%r14), %rax
addq $-0x10, %r14
cmpq %r15, %r14
movq %rax, %r14
jne 0x17fc
movq %rbx, %rdi
callq 0x1180
// File: /workspace/github_cpp_makefile_star2_O1/sanket143[P]2048-Terminal-Game/./src/board.h
// Function: gb::Board::add_tile()
void add_tile() {
      
        vector <int> available;

        for(int row = 0; row < 4; row++){
          for(int col = 0; col < 4; col++){
            if(tiles[row][col] == 0){
              available.push_back(row * 4 + col);
            }
          }
        }
        
        if(available.size() == 0) {
          printf("Game Over\n");
          exit(0);
        }
        int random_empty_tile = available[(int)(rand() % (int)available.size())];
        tiles[random_empty_tile / 4][random_empty_tile % 4] = 2;
          
      }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
xorps %xmm0, %xmm0
leaq -0x40(%rbp), %rax
movaps %xmm0, (%rax)
movq $0x0, 0x10(%rax)
xorl %r12d, %r12d
leaq -0x44(%rbp), %r15
movq %rdi, -0x50(%rbp)
movq %rdi, %r13
xorl %ebx, %ebx
xorl %r14d, %r14d
cmpl $0x0, (%r13,%r14,4)
jne 0x1c8f
leal (%r12,%r14), %eax
movl %eax, -0x44(%rbp)
movq -0x38(%rbp), %rsi
cmpq -0x30(%rbp), %rsi
je 0x1c83
leal (%r12,%r14), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x38(%rbp)
jmp 0x1c8f
leaq -0x40(%rbp), %rdi
movq %r15, %rdx
callq 0x1ff4
incq %r14
cmpq $0x4, %r14
jne 0x1c5a
incq %rbx
addq $0x10, %r13
addq $0x4, %r12
cmpq $0x4, %rbx
jne 0x1c57
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
je 0x1d19
callq 0x1040
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rcx
subq %rdi, %rcx
shrq $0x2, %rcx
cltd
idivl %ecx
movslq %edx, %rax
movl (%rdi,%rax,4), %eax
leal 0x3(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
movl %ecx, %edx
sarl $0x2, %edx
movslq %edx, %rdx
andl $-0x4, %ecx
subl %ecx, %eax
cltq
shlq $0x4, %rdx
movq -0x50(%rbp), %rcx
addq %rdx, %rcx
movl $0x2, (%rcx,%rax,4)
testq %rdi, %rdi
je 0x1d0a
movq -0x30(%rbp), %rsi
subq %rdi, %rsi
callq 0x10f0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1399(%rip), %rdi      # 0x30b9
callq 0x1150
xorl %edi, %edi
callq 0x1120
movq %rax, %rbx
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x1d44
movq -0x30(%rbp), %rsi
subq %rdi, %rsi
callq 0x10f0
movq %rbx, %rdi
callq 0x1180
// File: /workspace/github_cpp_makefile_star2_O1/gulamf[P]NRF24LE1Flash/main.cpp
// Function: usage()
void usage() {
    cout << "Usage : nrf24lx1Flash -f [hexfile] -p port -b baudrate -r reset -b BL_enabled -c command\n";
    cout << "-f [hexfile], path to hex file\n";
    cout << "-p port, port device\n\t-default /dev/ttyUSB0 \n";
    cout << "-b baudrate, UART speed\n\t-default 38400 \n";
    cout << "-r reset, reset pin DTR, RTS or CTS\n\t-default DTR\n";
    cout << "-bl BL_enabled, DISABLED or DTR or RTS\n\t-default DISABLED\n";
    cout << "-c command, CHECK, FLASH\n\t-default CHECK\n";
    cout << "\nVersion " << version << "\n";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x879f(%rip), %rbx      # 0xafd8
leaq 0x5821(%rip), %rsi      # 0x8061
movl $0x59, %edx
movq %rbx, %rdi
callq 0x2270
leaq 0x5867(%rip), %rsi      # 0x80bb
movl $0x1f, %edx
movq %rbx, %rdi
callq 0x2270
leaq 0x5873(%rip), %rsi      # 0x80db
movl $0x2d, %edx
movq %rbx, %rdi
callq 0x2270
leaq 0x588d(%rip), %rsi      # 0x8109
movl $0x29, %edx
movq %rbx, %rdi
callq 0x2270
leaq 0x58a3(%rip), %rsi      # 0x8133
movl $0x32, %edx
movq %rbx, %rdi
callq 0x2270
leaq 0x58c2(%rip), %rsi      # 0x8166
movl $0x3a, %edx
movq %rbx, %rdi
callq 0x2270
leaq 0x58e9(%rip), %rsi      # 0x81a1
movl $0x29, %edx
movq %rbx, %rdi
callq 0x2270
leaq 0x58ff(%rip), %rsi      # 0x81cb
movl $0x9, %edx
movq %rbx, %rdi
callq 0x2270
movq 0x8948(%rip), %rsi      # 0xb228
movq 0x8949(%rip), %rdx      # 0xb230
movq %rbx, %rdi
callq 0x2270
leaq 0x616f(%rip), %rsi      # 0x8a65
movl $0x1, %edx
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2270
// File: /workspace/github_cpp_makefile_star2_O1/gulamf[P]NRF24LE1Flash/main.cpp
// Function: set_interface_attribs(int, int, int)
int
set_interface_attribs (int fd, int speed, int parity)
{
        struct termios tty;
        memset (&tty, 0, sizeof tty);
        if (tcgetattr (fd, &tty) != 0)
        {
                cout <<  "error %d from tcgetattr" <<  errno;
                return -1;
        }

        cfsetospeed (&tty, speed);
        cfsetispeed (&tty, speed);

        tty.c_cflag = (tty.c_cflag & ~CSIZE) | CS8;     // 8-bit chars
        // disable IGNBRK for mismatched speed tests; otherwise receive break
        // as \000 chars
        tty.c_iflag &= ~IGNBRK;         // disable break processing
        tty.c_lflag = 0;                // no signaling chars, no echo,
                                        // no canonical processing
        tty.c_oflag = 0;                // no remapping, no delays
        tty.c_cc[VMIN]  = 0;            // read doesn't block
        tty.c_cc[VTIME] = 5;            // 0.5 seconds read timeout

        tty.c_iflag &= ~(IXON | IXOFF | IXANY); // shut off xon/xoff ctrl

        tty.c_cflag |= (CLOCAL | CREAD);// ignore modem controls,
                                        // enable reading
        tty.c_cflag &= ~(PARENB | PARODD);      // shut off parity
        tty.c_cflag |= parity;
        tty.c_cflag &= ~CSTOPB;
        tty.c_cflag &= ~CRTSCTS;

        if (tcsetattr (fd, TCSANOW, &tty) != 0)
        {
                cout << "error from tcsetattr:" << errno;
                return -1;
        }
        return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movl %edx, %r14d
movl %esi, %r12d
movl %edi, %ebx
xorps %xmm0, %xmm0
leaq -0x60(%rbp), %rsi
movups %xmm0, 0x2c(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
callq 0x2250
testl %eax, %eax
je 0x3216
movq 0x7dd0(%rip), %rdi      # 0xafd8
leaq 0x51da(%rip), %rsi      # 0x83e9
movl $0x17, %edx
jmp 0x328d
leaq -0x60(%rbp), %r15
movq %r15, %rdi
movl %r12d, %esi
callq 0x2240
movq %r15, %rdi
movl %r12d, %esi
callq 0x2160
movl 0x8(%r15), %eax
orl $0x30, %eax
xorl %r12d, %r12d
movl %r12d, 0xc(%r15)
movl %r12d, 0x4(%r15)
movw $0x5, 0x16(%r15)
andl $0xffffe3fe, (%r15)     # imm = 0xFFFFE3FE
andl $0x7ffff43f, %eax       # imm = 0x7FFFF43F
andl $0x7ffff70f, %r14d      # imm = 0x7FFFF70F
orl %eax, %r14d
orl $0x880, %r14d           # imm = 0x880
movl %r14d, 0x8(%r15)
movl %ebx, %edi
xorl %esi, %esi
movq %r15, %rdx
callq 0x2290
testl %eax, %eax
je 0x32ab
movq 0x7d57(%rip), %rdi      # 0xafd8
leaq 0x5179(%rip), %rsi      # 0x8401
movl $0x15, %edx
callq 0x2270
callq 0x2040
movl (%rax), %esi
movq 0x7d38(%rip), %rdi      # 0xafd8
callq 0x2360
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movl %r12d, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/gulamf[P]NRF24LE1Flash/main.cpp
// Function: set_blocking(int, int)
void
set_blocking (int fd, int should_block)
{
        struct termios tty;
        memset (&tty, 0, sizeof tty);
        if (tcgetattr (fd, &tty) != 0)
        {
                cout << "error from tggetattr: " << errno;
                return;
        }

        tty.c_cc[VMIN]  = should_block ? 1 : 0;
        tty.c_cc[VTIME] = 5;            // 0.5 seconds read timeout

        if (tcsetattr (fd, TCSANOW, &tty) != 0)
                cout << "error setting term attributes:"<<errno;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movl %esi, %r14d
movl %edi, %ebx
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rsi
movups %xmm0, 0x2c(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
callq 0x2250
testl %eax, %eax
je 0x32ff
movq 0x7ce7(%rip), %rdi      # 0xafd8
leaq 0x511f(%rip), %rsi      # 0x8417
movl $0x16, %edx
jmp 0x332e
testl %r14d, %r14d
leaq -0x50(%rbp), %rdx
setne 0x17(%rdx)
movb $0x5, 0x16(%rdx)
movl %ebx, %edi
xorl %esi, %esi
callq 0x2290
testl %eax, %eax
je 0x3346
movq 0x7cb6(%rip), %rdi      # 0xafd8
leaq 0x5105(%rip), %rsi      # 0x842e
movl $0x1e, %edx
callq 0x2270
callq 0x2040
movl (%rax), %esi
movq 0x7c97(%rip), %rdi      # 0xafd8
callq 0x2360
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/gulamf[P]NRF24LE1Flash/main.cpp
// Function: ReadSerialDataByte(unsigned char*)
BLCommandReturnType ReadSerialDataByte(unsigned char *buffer)
{
  fd_set set;
  struct timeval timeout;
  int rv;

  FD_ZERO(&set); /* clear the set */
  FD_SET(progSerPort, &set); /* add our file descriptor to the set */

  timeout.tv_sec = 0;
  timeout.tv_usec = 2000000;

  rv = select(progSerPort + 1, &set, NULL, NULL, &timeout);
  if(rv == -1)
    return BLCommandReturnType_SerialPortFailure; /* an error accured */
  else if(rv == 0)
    return BLCommandReturnType_Timeout; /* a timeout occured */
  else
    read( progSerPort, (void *)buffer,1 ); /* there was data to read */

    return BLCommandReturnType_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq -0xa0(%rbp), %rsi
movaps %xmm0, (%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x70(%rsi)
movl 0x7a85(%rip), %edi      # 0xb318
leal 0x3f(%rdi), %eax
testl %edi, %edi
cmovnsl %edi, %eax
movl %eax, %edx
andl $-0x40, %edx
movl %edi, %ecx
subl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
sarl $0x6, %eax
cltq
orq %rdx, -0xa0(%rbp,%rax,8)
leaq -0x18(%rbp), %r8
movq $0x0, (%r8)
movq $0x1e8480, 0x8(%r8)     # imm = 0x1E8480
incl %edi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x21e0
cmpl $-0x1, %eax
je 0x38e7
testl %eax, %eax
jne 0x38ee
movl $0x2, %eax
jmp 0x3903
movl $0x3, %eax
jmp 0x3903
movl 0x7a24(%rip), %edi      # 0xb318
movl $0x1, %edx
movq %rbx, %rsi
callq 0x22d0
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/gulamf[P]NRF24LE1Flash/main.cpp
// Function: ReadSerialCommandByte(BLCommand)
BLCommandReturnType ReadSerialCommandByte(BLCommand command)
{
    unsigned char buffer = 0;
    BLCommandReturnType blCommandReturnVal;

    blCommandReturnVal = ReadSerialDataByte(&buffer);

    if (blCommandReturnVal == BLCommandReturnType_OK)
    {
        if ((command == BLCommand_Any) || (buffer == (char)command))
        {
            return BLCommandReturnType_OK;
        }
        else
        {
            return BLCommandReturnType_BadCharacter;
        }
    }
    else
    {
        return blCommandReturnVal;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq -0x9(%rbp), %rdi
movb $0x0, (%rdi)
callq 0x3855
testl %eax, %eax
jne 0x393a
xorl %eax, %eax
cmpl $0x2a, %ebx
je 0x393a
movzbl -0x9(%rbp), %ecx
movsbl %bl, %edx
xorl %eax, %eax
cmpl %ecx, %edx
setne %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/gulamf[P]NRF24LE1Flash/main.cpp
// Function: ExecuteCommandStartBootloader()
BLCommandReturnType ExecuteCommandStartBootloader()
{
    if (!OpenSerialPort(baudrate))
    {
        return BLCommandReturnType_SerialPortFailure;
    }

    //reset the chip
    ResetDevice();

    //send the start byte
    if (WriteSerialByte((unsigned char)BLCommand_Start) != BLCommandReturnType_OK)
    {
        return BLCommandReturnType_SerialPortFailure;
    }

    //wait for the return character and return it
    return ReadSerialCommandByte(BLCommand_Start);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
callq 0x334f
movl $0x3, %ebx
testb %al, %al
je 0x398b
callq 0x36d0
movl $0x73, %edi
callq 0x3804
testl %eax, %eax
jne 0x398b
leaq -0x11(%rbp), %r14
movb $0x0, (%r14)
movq %r14, %rdi
callq 0x3855
xorl %ebx, %ebx
cmpb $0x73, (%r14)
setne %bl
testl %eax, %eax
cmovnel %eax, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/gulamf[P]NRF24LE1Flash/main.cpp
// Function: ExecuteCommandGetDevID(unsigned short*)
BLCommandReturnType ExecuteCommandGetDevID(uint16_t *buffer)
{
    unsigned char tempByte = 0;

    if (WriteSerialByte((unsigned char )BLCommand_GetDevID) != BLCommandReturnType_OK)
    {
        return BLCommandReturnType_SerialPortFailure;
    }

    if (ReadSerialDataByte(&tempByte) != BLCommandReturnType_OK)
    {
        return BLCommandReturnType_Timeout;
    }

    *buffer = tempByte;

    if (ReadSerialDataByte(&tempByte) != BLCommandReturnType_OK)
    {
        return BLCommandReturnType_Timeout;
    }

    (*buffer) += ((uint16_t)tempByte) << 8;

    return ReadSerialCommandByte(BLCommand_GetDevID);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movb $0x0, -0x11(%rbp)
movl $0x69, %edi
callq 0x3804
movl $0x3, %r14d
testl %eax, %eax
jne 0x3a0b
leaq -0x11(%rbp), %rdi
callq 0x3855
movl $0x2, %r14d
testl %eax, %eax
jne 0x3a0b
leaq -0x11(%rbp), %rdi
movzbl (%rdi), %eax
movw %ax, (%rbx)
callq 0x3855
testl %eax, %eax
jne 0x3a0b
movzbl -0x11(%rbp), %eax
shll $0x8, %eax
addw %ax, (%rbx)
leaq -0x12(%rbp), %rbx
movb $0x0, (%rbx)
movq %rbx, %rdi
callq 0x3855
xorl %r14d, %r14d
cmpb $0x69, (%rbx)
setne %r14b
testl %eax, %eax
cmovnel %eax, %r14d
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/gulamf[P]NRF24LE1Flash/main.cpp
// Function: ExecuteCommandGetBLVersion(unsigned char*)
BLCommandReturnType ExecuteCommandGetBLVersion(unsigned char *buffer)
{
    if (WriteSerialByte((unsigned char)BLCommand_GetBLVersion) != BLCommandReturnType_OK)
    {
        return BLCommandReturnType_SerialPortFailure;
    }

    if (ReadSerialDataByte(buffer) != BLCommandReturnType_OK)
    {
        return BLCommandReturnType_Timeout;
    }

    return ReadSerialCommandByte(BLCommand_GetBLVersion);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x76, %edi
callq 0x3804
movl %eax, %ecx
movl $0x3, %eax
testl %ecx, %ecx
jne 0x3a66
movq %rbx, %rdi
callq 0x3855
movl %eax, %ecx
movl $0x2, %eax
testl %ecx, %ecx
jne 0x3a66
leaq -0x9(%rbp), %rbx
movb $0x0, (%rbx)
movq %rbx, %rdi
callq 0x3855
movl %eax, %ecx
xorl %eax, %eax
cmpb $0x76, (%rbx)
setne %al
testl %ecx, %ecx
cmovnel %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/gulamf[P]NRF24LE1Flash/main.cpp
// Function: ExecuteCommandExitBootloader()
BLCommandReturnType ExecuteCommandExitBootloader()
{
    BLCommandReturnType retVal = BLCommandReturnType_Timeout;

    if (WriteSerialByte((unsigned char)BLCommand_Exit) != BLCommandReturnType_OK)
    {
        return BLCommandReturnType_SerialPortFailure;
    }

    retVal = ReadSerialCommandByte(BLCommand_Exit);

    return retVal;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl $0x78, %edi
callq 0x3804
movl %eax, %ecx
movl $0x3, %eax
testl %ecx, %ecx
jne 0x3aa6
leaq -0x9(%rbp), %rbx
movb $0x0, (%rbx)
movq %rbx, %rdi
callq 0x3855
movl %eax, %ecx
xorl %eax, %eax
cmpb $0x78, (%rbx)
setne %al
testl %ecx, %ecx
cmovnel %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/gulamf[P]NRF24LE1Flash/main.cpp
// Function: ConvertBLDevIDToString[abi:cxx11](unsigned short)
string ConvertBLDevIDToString(uint16_t blDevId)
{
    string retVal;

    if(blDevId >= sizeof(&blDevIdToString))
    {
        retVal = "[Invalid Device ID]";
    }
    else
    {
        retVal = blDevIdToString[blDevId];
    }

    retVal += " (ID: " + ToString(blDevId) + ")\n";

    return retVal;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movw %si, -0x2a(%rbp)
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
cmpw $0x8, %si
jb 0x3af9
leaq 0x49d5(%rip), %rcx      # 0x84ba
movl $0x13, %r8d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2310
jmp 0x3b11
movzwl %si, %eax
shll $0x5, %eax
leaq 0x774a(%rip), %rsi      # 0xb250
addq %rax, %rsi
movq %rbx, %rdi
callq 0x2140
leaq -0x90(%rbp), %rdi
leaq -0x2a(%rbp), %rsi
callq 0x5c85
leaq 0x49a6(%rip), %rcx      # 0x84ce
leaq -0x90(%rbp), %rdi
movl $0x6, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x2260
leaq -0x60(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3b63
movq %rdx, -0x70(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x60(%rbp)
jmp 0x3b6b
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq -0x70(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x4948(%rip), %rsi      # 0x84d5
callq 0x23b0
leaq -0x40(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3bb6
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x3bbe
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, -0x48(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %rbx, %rdi
callq 0x20c0
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x3bfa
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2220
movq -0x70(%rbp), %rdi
cmpq %r12, %rdi
je 0x3c0f
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2220
leaq -0x80(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3c28
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2220
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x3c57
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2220
jmp 0x3c57
movq %rax, %r14
movq -0x70(%rbp), %rdi
cmpq %r12, %rdi
je 0x3c71
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2220
jmp 0x3c71
movq %rax, %r14
leaq -0x80(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3c91
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2220
jmp 0x3c91
jmp 0x3c8e
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x3ca4
movq (%r15), %rsi
incq %rsi
callq 0x2220
movq %r14, %rdi
callq 0x2380
// File: /workspace/github_cpp_makefile_star2_O1/gulamf[P]NRF24LE1Flash/main.cpp
// Function: ExecuteCommandErasePage(unsigned char)
BLCommandReturnType ExecuteCommandErasePage(uint8_t pageNum)
{
    if (WriteSerialByte((uint8_t)BLCommand_ErasePage) != BLCommandReturnType_OK)
    {
        return BLCommandReturnType_SerialPortFailure;
    }

    if (WriteSerialByte(pageNum) != BLCommandReturnType_OK)
    {
        return BLCommandReturnType_SerialPortFailure;
    }

    return ReadSerialCommandByte(BLCommand_ErasePage);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edi, %r14d
movl $0x65, %edi
callq 0x3804
movl $0x3, %ebx
testl %eax, %eax
jne 0x3e93
movzbl %r14b, %edi
callq 0x3804
testl %eax, %eax
jne 0x3e93
leaq -0x11(%rbp), %r14
movb $0x0, (%r14)
movq %r14, %rdi
callq 0x3855
xorl %ebx, %ebx
cmpb $0x65, (%r14)
setne %bl
testl %eax, %eax
cmovnel %eax, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/gulamf[P]NRF24LE1Flash/main.cpp
// Function: ExecuteCommandSetRWAddress(unsigned short)
BLCommandReturnType ExecuteCommandSetRWAddress(uint16_t address)
{
    if (WriteSerialByte((uint8_t)BLCommand_SetRWAddress) != BLCommandReturnType_OK)
    {
        return BLCommandReturnType_SerialPortFailure;
    }

    if (WriteSerialByte((uint8_t)address & 0xFF) != BLCommandReturnType_OK)
    {
        return BLCommandReturnType_SerialPortFailure;
    }

    if (WriteSerialByte((uint8_t)(address >> 8)) != BLCommandReturnType_OK)
    {
        return BLCommandReturnType_SerialPortFailure;
    }

    return ReadSerialCommandByte(BLCommand_SetRWAddress);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edi, %r14d
movl $0x61, %edi
callq 0x3804
movl $0x3, %ebx
testl %eax, %eax
jne 0x3efa
movzbl %r14b, %edi
callq 0x3804
testl %eax, %eax
jne 0x3efa
movzwl %r14w, %edi
shrl $0x8, %edi
callq 0x3804
testl %eax, %eax
jne 0x3efa
leaq -0x11(%rbp), %r14
movb $0x0, (%r14)
movq %r14, %rdi
callq 0x3855
xorl %ebx, %ebx
cmpb $0x61, (%r14)
setne %bl
testl %eax, %eax
cmovnel %eax, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/gulamf[P]NRF24LE1Flash/main.cpp
// Function: ExecuteCommandWrite(unsigned char*, unsigned short, unsigned short)
BLCommandReturnType ExecuteCommandWrite(uint8_t buffer[], uint16_t startIndex, uint16_t len)
{
    uint numWritten = 0;

    while(numWritten < len)
    {
        uint numToWrite;

        //The write operation only supports writing up to 256 bytes per write
        if ((len - numWritten) > 256)
        {
            numToWrite = 256;
        }
        else
        {
            numToWrite = len - numWritten;
        }

        //Send write command
        if (WriteSerialByte((uint8_t)BLCommand_Write) != BLCommandReturnType_OK)
        {
            return BLCommandReturnType_SerialPortFailure;
        }

        //Send number of bytes to be written (0 here indicates we want to write 256 bytes, so casting numToWrite to a byte does the trick of getting rid of the MSb)
        if (WriteSerialByte((uint8_t)numToWrite) != BLCommandReturnType_OK)
        {
            return BLCommandReturnType_SerialPortFailure;
        }

        //Send the bytes to be written one by one
        for(unsigned int x = 0; x < numToWrite; x++)
        {
            if (WriteSerialByte(buffer[startIndex + numWritten]) != BLCommandReturnType_OK)
            {
                return BLCommandReturnType_SerialPortFailure;
            }

            numWritten++;
        }

        if (ReadSerialCommandByte(BLCommand_Write) != BLCommandReturnType_OK)
        {
            return BLCommandReturnType_Timeout;
        }
    }

    return BLCommandReturnType_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r15d
movq %rsi, -0x40(%rbp)
movq %rdi, -0x38(%rbp)
xorl %r14d, %r14d
movl %r15d, %ebx
subl %r14d, %ebx
jbe 0x4010
movl $0x100, %eax            # imm = 0x100
cmpl %eax, %ebx
cmovael %eax, %ebx
movl $0x77, %edi
callq 0x3804
movl $0x3, %r12d
testl %eax, %eax
jne 0x3fdb
movzbl %bl, %edi
callq 0x3804
testl %eax, %eax
jne 0x3fdb
cmpl $0x1, %ebx
movl %ebx, %r12d
adcl $0x0, %r12d
movq -0x40(%rbp), %rax
addl %r14d, %eax
movq -0x38(%rbp), %rcx
movzbl (%rcx,%rax), %edi
callq 0x3804
testl %eax, %eax
je 0x3f8a
movl $0x3, %r12d
movb $0x1, %al
jmp 0x3fd7
movl %r15d, -0x30(%rbp)
incl %r14d
movl $0x1, %ecx
movl %r14d, %edx
movl %edx, %r14d
movl %ecx, %r15d
cmpl %ecx, %r12d
je 0x3fca
movq -0x40(%rbp), %rax
addl %r14d, %eax
movq -0x38(%rbp), %rcx
movzbl (%rcx,%rax), %edi
callq 0x3804
leal 0x1(%r14), %edx
leal 0x1(%r15), %ecx
testl %eax, %eax
je 0x3f99
movl $0x3, %r13d
cmpl %ebx, %r15d
setb %al
movl %r13d, %r12d
movl -0x30(%rbp), %r15d
testb %al, %al
je 0x3fea
xorl %eax, %eax
movl %r12d, %r13d
testb %al, %al
jne 0x3f24
jmp 0x4013
movb $0x0, -0x29(%rbp)
leaq -0x29(%rbp), %rdi
callq 0x3855
testl %eax, %eax
sete %cl
cmpb $0x77, -0x29(%rbp)
sete %al
andb %cl, %al
movl $0x2, %ecx
cmovel %ecx, %r12d
jmp 0x3fdd
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/gulamf[P]NRF24LE1Flash/main.cpp
// Function: ExecuteCommandSetUsrMainAddress(unsigned short)
BLCommandReturnType ExecuteCommandSetUsrMainAddress(uint16_t address)
{
    if (WriteSerialByte((uint8_t)BLCommand_SetUsrMainAddress) != BLCommandReturnType_OK)
    {
        return BLCommandReturnType_SerialPortFailure;
    }

    if (WriteSerialByte((uint8_t)address & 0xFF) != BLCommandReturnType_OK)
    {
        return BLCommandReturnType_SerialPortFailure;
    }

    if (WriteSerialByte((uint8_t)address >> 8) != BLCommandReturnType_OK)
    {
        return BLCommandReturnType_SerialPortFailure;
    }

    return ReadSerialCommandByte(BLCommand_SetUsrMainAddress);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edi, %r14d
movl $0x6d, %edi
callq 0x3804
movl $0x3, %ebx
testl %eax, %eax
jne 0x407c
movzbl %r14b, %edi
callq 0x3804
testl %eax, %eax
jne 0x407c
xorl %edi, %edi
callq 0x3804
testl %eax, %eax
jne 0x407c
leaq -0x11(%rbp), %r14
movb $0x0, (%r14)
movq %r14, %rdi
callq 0x3855
xorl %ebx, %ebx
cmpb $0x6d, (%r14)
setne %bl
testl %eax, %eax
cmovnel %eax, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/gulamf[P]NRF24LE1Flash/main.cpp
// Function: ExecuteCommandRead(unsigned char*, unsigned short, unsigned short)
BLCommandReturnType ExecuteCommandRead(uint8_t buffer[], uint16_t startIndex, uint16_t len)
{
    unsigned int numRead = 0;

    while(numRead < len)
    {
        unsigned int numToRead;

        //The read operation only supports reading up to 256 bytes per read
        if ((len - numRead) > 256)
        {
            numToRead = 256;
        }
        else
        {
            numToRead = len - numRead;
        }

        //Send read command
        if (WriteSerialByte((uint8_t)BLCommand_Read) != BLCommandReturnType_OK)
        {
            return BLCommandReturnType_SerialPortFailure;
        }

        //Send number of bytes to be read (0 here indicates we want to read 256 bytes, so casting numToRead to a byte does the trick of getting rid of the MSb)
        if (WriteSerialByte((uint8_t)numToRead) != BLCommandReturnType_OK)
        {
            return BLCommandReturnType_SerialPortFailure;
        }

        //Read in the bytes from the micro one by one
        for(unsigned int x = 0; x < numToRead; x++)
        {
            if (ReadSerialDataByte(&buffer[startIndex + numRead]) != BLCommandReturnType_OK)
            {
                return BLCommandReturnType_SerialPortFailure;
            }

            numRead++;
        }

        if (ReadSerialCommandByte(BLCommand_Read) != BLCommandReturnType_OK)
        {
            return BLCommandReturnType_Timeout;
        }
    }

    return BLCommandReturnType_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r15d
movq %rsi, -0x40(%rbp)
movq %rdi, -0x38(%rbp)
xorl %r14d, %r14d
movl %r15d, %ebx
subl %r14d, %ebx
jbe 0x418c
movl $0x100, %eax            # imm = 0x100
cmpl %eax, %ebx
cmovael %eax, %ebx
movl $0x72, %edi
callq 0x3804
movl $0x3, %r12d
testl %eax, %eax
jne 0x4157
movzbl %bl, %edi
callq 0x3804
testl %eax, %eax
jne 0x4157
cmpl $0x1, %ebx
movl %ebx, %r12d
adcl $0x0, %r12d
movq -0x40(%rbp), %rax
leal (%r14,%rax), %edi
addq -0x38(%rbp), %rdi
callq 0x3855
testl %eax, %eax
je 0x4109
movl $0x3, %r12d
movb $0x1, %al
jmp 0x4153
movl %r15d, -0x30(%rbp)
incl %r14d
movl $0x1, %ecx
movl %r14d, %edx
movl %edx, %r14d
movl %ecx, %r15d
cmpl %ecx, %r12d
je 0x4146
movq -0x40(%rbp), %rax
leal (%rax,%r14), %edi
addq -0x38(%rbp), %rdi
callq 0x3855
leal 0x1(%r14), %edx
leal 0x1(%r15), %ecx
testl %eax, %eax
je 0x4118
movl $0x3, %r13d
cmpl %ebx, %r15d
setb %al
movl %r13d, %r12d
movl -0x30(%rbp), %r15d
testb %al, %al
je 0x4166
xorl %eax, %eax
movl %r12d, %r13d
testb %al, %al
jne 0x40a6
jmp 0x418f
movb $0x0, -0x29(%rbp)
leaq -0x29(%rbp), %rdi
callq 0x3855
testl %eax, %eax
sete %cl
cmpb $0x72, -0x29(%rbp)
sete %al
andb %cl, %al
movl $0x2, %ecx
cmovel %ecx, %r12d
jmp 0x4159
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/gulamf[P]NRF24LE1Flash/main.cpp
// Function: main
int main(int argc, char **argv)
{
    if(argc==1) usage();
    if(!processCommandLine(argc, argv)) exit(0);
    if(command==C_CHECK) {
        if(!CheckUC()) return -1;
    } else
    {
        if(!ProgramUC()) return -1;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edi, %r14d
cmpl $0x1, %edi
jne 0x5b29
callq 0x282c
movl %r14d, %edi
movq %rbx, %rsi
callq 0x2909
testb %al, %al
je 0x5b64
cmpl $0x0, 0x57d5(%rip)      # 0xb314
je 0x5b4d
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
callq 0x41a1
jmp 0x5b57
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
callq 0x3cac
testb %al, %al
je 0x5b5d
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
xorl %edi, %edi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O1/gulamf[P]NRF24LE1Flash/./include/misc.h
// Function: unsigned char ParseHex<unsigned char>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
T ParseHex(const std::string& str) {
    T value = 0;
    for(unsigned int i=0;i<str.length();i++) {
        value = value << 4;
        if(str[i]>='0' && str[i]<='9') {
            int v = str[i]-'0';
            value += v;
        }
        else if(str[i]>='A' && str[i]<='F') {
            int v = str[i]-'A' + 10;
            value += v;
        }
    }
    return value;
}

// Assembly:
movq 0x8(%rdi), %rcx
testq %rcx, %rcx
je 0x6c39
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rdx
xorl %esi, %esi
xorl %eax, %eax
shlb $0x4, %al
movb (%rdx,%rsi), %dil
leal -0x30(%rdi), %r8d
cmpb $0x9, %r8b
ja 0x6c1e
addb %al, %dil
addb $-0x30, %dil
movl %edi, %eax
jmp 0x6c2d
leal -0x41(%rdi), %r8d
cmpb $0x5, %r8b
ja 0x6c2d
addb %dil, %al
addb $-0x37, %al
incq %rsi
movl %esi, %edi
cmpq %rdi, %rcx
ja 0x6c02
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/gulamf[P]NRF24LE1Flash/src/misc.cpp
// Function: sleep_ms(int)
void sleep_ms(int milliseconds)
{
#if _POSIX_C_SOURCE >= 199309L
    struct timespec ts;
    ts.tv_sec = milliseconds / 1000;
    ts.tv_nsec = (milliseconds % 1000) * 1000000;
    nanosleep(&ts, NULL);
#else
    usleep(milliseconds * 1000);
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movslq %edi, %rax
imulq $0x10624dd3, %rax, %rcx # imm = 0x10624DD3
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x26, %rcx
addl %edx, %ecx
movslq %ecx, %rcx
leaq -0x10(%rbp), %rdi
movq %rcx, (%rdi)
imull $0x3e8, %ecx, %ecx      # imm = 0x3E8
subl %ecx, %eax
imull $0xf4240, %eax, %eax    # imm = 0xF4240
cltq
movq %rax, 0x8(%rdi)
xorl %esi, %esi
callq 0x20b0
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/melop[P]admixem/./parser/parser.cpp
// Function: getrandom(int)
const int getrandom (const int x)
{
	if (x <= 0)
		return 0;

	// r will be between 0 and 1 (but below 1 as we are dividing by RAND_MAX+1)
	double r = static_cast<double> (std::rand () % RAND_MAX) / (static_cast<double> (RAND_MAX) + 1.0);
	return floor (r * x);

}

// Assembly:
testl %edi, %edi
jle 0x8697
pushq %rbx
movl %edi, %ebx
callq 0x70e0
cltq
movq %rax, %rcx
shlq $0x1e, %rcx
addq %rax, %rcx
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x3d, %rcx
addl %edx, %ecx
addl %ecx, %eax
shll $0x1f, %ecx
addl %eax, %ecx
cvtsi2sd %ecx, %xmm1
mulsd 0x2c984(%rip), %xmm1    # 0x35008
cvtsi2sd %ebx, %xmm0
mulsd %xmm1, %xmm0
callq 0x7740
cvttsd2si %xmm0, %eax
popq %rbx
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/melop[P]admixem/./parser/parser.cpp
// Function: roll(int, int)
const int roll (const int howmany, const int die)
{
	int count;
	int total = 0;

	for (count = 0; count < howmany; ++count)
		total += getrandom (die) + 1;

	return total;

}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
testl %edi, %edi
jle 0x8710
movl %esi, %ebx
movl %edi, %ebp
cvtsi2sd %esi, %xmm0
movsd %xmm0, 0x8(%rsp)
xorl %r14d, %r14d
testl %ebx, %ebx
jle 0x8702
callq 0x70e0
cltq
movq %rax, %rcx
shlq $0x1e, %rcx
addq %rax, %rcx
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x3d, %rcx
addl %edx, %ecx
addl %ecx, %eax
shll $0x1f, %ecx
addl %eax, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
mulsd 0x2c919(%rip), %xmm0    # 0x35008
mulsd 0x8(%rsp), %xmm0
callq 0x7740
cvttsd2si %xmm0, %eax
incl %eax
jmp 0x8707
movl $0x1, %eax
addl %eax, %r14d
decl %ebp
jne 0x86b7
jmp 0x8713
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/melop[P]admixem/./parser/parser.cpp
// Function: percent(int)
const bool percent (const int prob)
  {
  if (prob <= 0)
    return false;
  if (prob >= 100)
    return true;

  return getrandom (100) > (100 - prob);

  }

// Assembly:
testl %edi, %edi
jle 0x877d
pushq %rbx
movl %edi, %ebx
movb $0x1, %al
cmpl $0x63, %edi
jg 0x877b
callq 0x70e0
cltq
movq %rax, %rcx
shlq $0x1e, %rcx
addq %rax, %rcx
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x3d, %rcx
addl %edx, %ecx
addl %ecx, %eax
shll $0x1f, %ecx
addl %eax, %ecx
cvtsi2sd %ecx, %xmm0
mulsd 0x2c8aa(%rip), %xmm0    # 0x35008
mulsd 0x2c8aa(%rip), %xmm0    # 0x35010
callq 0x7740
cvttsd2si %xmm0, %eax
movl $0x64, %ecx
subl %ebx, %ecx
cmpl %eax, %ecx
setl %al
popq %rbx
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/melop[P]admixem/./parser/parser.cpp
// Function: Parser::Expression(bool)
const double Parser::Expression (const bool get)  // AND and OR
  {
  double left = Comparison (get);
  while (true)
    {
    switch (type_)
      {
      case AND: 
            {
            double d = Comparison (true);   // don't want short-circuit evaluation
            left = (left != 0.0) && (d != 0.0); 
            }
          break;
      case OR:  
            {
            double d = Comparison (true);   // don't want short-circuit evaluation
            left = (left != 0.0) || (d != 0.0); 
            }
          break;
      default:    return left;
      } // end of switch on type
    }   // end of loop
  }

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x9750
movl 0x30(%rbx), %eax
cmpl $0x44, %eax
movapd %xmm0, (%rsp)
je 0x95dd
cmpl $0x43, %eax
jne 0x9613
movq %rbx, %rdi
movl $0x1, %esi
callq 0x9750
xorpd %xmm1, %xmm1
movapd (%rsp), %xmm2
cmpneqpd %xmm1, %xmm2
cmpneqpd %xmm1, %xmm0
andpd %xmm2, %xmm0
jmp 0x9601
movq %rbx, %rdi
movl $0x1, %esi
callq 0x9750
xorpd %xmm1, %xmm1
movapd (%rsp), %xmm2
cmpneqpd %xmm1, %xmm2
cmpneqpd %xmm1, %xmm0
orpd %xmm2, %xmm0
movd %xmm0, %eax
andb $0x1, %al
movzbl %al, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
jmp 0x95a5
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/melop[P]admixem/./parser/parser.cpp
// Function: Parser::Term(bool)
const double Parser::Term (const bool get)    // multiply and divide
  {
  double left = Primary (get);
  while (true)
    {
    switch (type_)
      {
      case MULTIPLY:  
        left *= Primary (true); break;
      case DIVIDE: 
          {
          double d = Primary (true);
          if (d == 0.0)
            throw std::runtime_error ("Divide by zero");
          left /= d; 
          break;
          }
      default:    return left;
      } // end of switch on type
    }   // end of loop
  }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x9022
movl 0x30(%rbx), %eax
cmpl $0x2f, %eax
movsd %xmm0, (%rsp)
je 0x9676
cmpl $0x2a, %eax
jne 0x969e
movq %rbx, %rdi
movl $0x1, %esi
callq 0x9022
movsd (%rsp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
jmp 0x9642
movq %rbx, %rdi
movl $0x1, %esi
callq 0x9022
ucomisd 0x2b995(%rip), %xmm0    # 0x35020
jne 0x968f
jnp 0x96a6
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
jmp 0x9642
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x10, %edi
callq 0x7180
movq %rax, %rbx
leaq 0x2ba98(%rip), %rsi     # 0x35152
movq %rax, %rdi
callq 0x7140
movq 0x3f927(%rip), %rsi     # 0x48ff0
movq 0x3f8b0(%rip), %rdx     # 0x48f80
movq %rbx, %rdi
callq 0x7660
movq %rax, %r14
movq %rbx, %rdi
callq 0x72a0
movq %r14, %rdi
callq 0x76a0
nop
// File: /workspace/github_cpp_makefile_star2_O1/melop[P]admixem/./parser/parser.cpp
// Function: Parser::AddSubtract(bool)
const double Parser::AddSubtract (const bool get)  // add and subtract
  {
  double left = Term (get);
  while (true)
    {
    switch (type_)
      {
      case PLUS:  left += Term (true); break;
      case MINUS: left -= Term (true); break;
      default:    return left;
      } // end of switch on type
    }   // end of loop
  }

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x9636
movl 0x30(%rbx), %eax
cmpl $0x2d, %eax
movsd %xmm0, 0x8(%rsp)
je 0x9725
cmpl $0x2b, %eax
jne 0x974a
movq %rbx, %rdi
movl $0x1, %esi
callq 0x9636
movsd 0x8(%rsp), %xmm1
addsd %xmm0, %xmm1
jmp 0x973c
movq %rbx, %rdi
movl $0x1, %esi
callq 0x9636
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
jmp 0x96f9
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/melop[P]admixem/./parser/parser.cpp
// Function: Parser::Comparison(bool)
const double Parser::Comparison (const bool get)  // LT, GT, LE, EQ etc.
  {
  double left = AddSubtract (get);
  while (true)
    {
    switch (type_)
      {
      case LT:  left = left <  AddSubtract (true) ? 1.0 : 0.0; break;
      case GT:  left = left >  AddSubtract (true) ? 1.0 : 0.0; break;
      case LE:  left = left <= AddSubtract (true) ? 1.0 : 0.0; break;
      case GE:  left = left >= AddSubtract (true) ? 1.0 : 0.0; break;
      case EQ:  left = left == AddSubtract (true) ? 1.0 : 0.0; break;
      case NE:  left = left != AddSubtract (true) ? 1.0 : 0.0; break;
           default:    return left;
      } // end of switch on type
    }   // end of loop
  }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x96ec
leaq 0x2b90d(%rip), %r14     # 0x35070
movl 0x30(%rbx), %eax
addl $-0x3c, %eax
cmpl $0x6, %eax
ja 0x982e
movslq (%r14,%rax,4), %rax
addq %r14, %rax
movsd %xmm0, (%rsp)
jmpq *%rax
movq %rbx, %rdi
movl $0x1, %esi
callq 0x96ec
ucomisd (%rsp), %xmm0
jmp 0x97f2
movq %rbx, %rdi
movl $0x1, %esi
callq 0x96ec
movsd (%rsp), %xmm1
cmpneqsd %xmm0, %xmm1
jmp 0x980e
movq %rbx, %rdi
movl $0x1, %esi
callq 0x96ec
movsd (%rsp), %xmm1
ucomisd %xmm0, %xmm1
jmp 0x97d7
movq %rbx, %rdi
movl $0x1, %esi
callq 0x96ec
ucomisd (%rsp), %xmm0
setae %al
jmp 0x9816
movq %rbx, %rdi
movl $0x1, %esi
callq 0x96ec
movsd (%rsp), %xmm1
ucomisd %xmm0, %xmm1
seta %al
jmp 0x9816
movq %rbx, %rdi
movl $0x1, %esi
callq 0x96ec
movsd (%rsp), %xmm1
cmpeqsd %xmm0, %xmm1
movq %xmm1, %rax
andl $0x1, %eax
movsd 0x2b7fa(%rip), %xmm0    # 0x35018
testb %al, %al
jne 0x9763
xorps %xmm0, %xmm0
jmp 0x9763
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/melop[P]admixem/./parser/parser.cpp
// Function: Parser::Evaluate()
const double Parser::Evaluate ()  // get result
  {
  pWord_    = program_.c_str ();
  type_     = NONE;
  double v = CommaList (true);
  if (type_ != END)
    throw std::runtime_error ("Unexpected text at end of expression: " + std::string (pWordStart_));
  return v;  
  }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdi, %r14
movq (%rdi), %rax
movq %rax, 0x20(%rdi)
movl $0x0, 0x30(%rdi)
movl $0x1, %esi
callq 0x961a
cmpl $0x3, 0x30(%r14)
jne 0x9869
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl $0x10, %edi
callq 0x7180
movq %rax, %rbx
movq 0x28(%r14), %rsi
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x9c02
leaq 0x2b8e4(%rip), %rsi     # 0x35174
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x9a09
movb $0x1, %bpl
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x75d0
xorl %ebp, %ebp
movq 0x3f738(%rip), %rsi     # 0x48ff0
movq 0x3f6c1(%rip), %rdx     # 0x48f80
movq %rbx, %rdi
callq 0x7660
movq %rax, %r14
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x98ed
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x7390
jmp 0x98ed
movq %rax, %r14
movb $0x1, %bpl
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9910
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x7390
jmp 0x9910
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x991d
movq %rbx, %rdi
callq 0x72a0
movq %r14, %rdi
callq 0x76a0
nop