LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/msu-starx[P]starx/converter.cpp
// Function: Converter::splitString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char)
std::vector<std::string> Converter::splitString(const std::string &str, char delimiter){
    std::vector<std::string> tokens = {};
    std::string token = "";
    std::stringstream stream(str);
    while(std::getline(stream, token, delimiter)) {
        tokens.push_back(token);
    }
    return tokens;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movl %ecx, %r14d
movq %rdx, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
leaq 0x16f5(%rip), %rsi      # 0x630c
leaq -0x40(%rbp), %rdi
leaq -0x1c8(%rbp), %rdx
callq 0x2aea
leaq -0x1c8(%rbp), %rdi
pushq $0x18
popq %rdx
movq %r15, %rsi
callq 0x22c0
movsbl %r14b, %r14d
leaq -0x1c8(%rbp), %r15
leaq -0x40(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
movl %r14d, %edx
callq 0x2330
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4c71
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4d1a
jmp 0x4c48
leaq -0x1c8(%rbp), %rdi
callq 0x2130
leaq -0x40(%rbp), %rdi
callq 0x20b0
movq %rbx, %rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x4cb2
movq %rax, %r14
jmp 0x4cbb
movq %rax, %r14
leaq -0x1c8(%rbp), %rdi
callq 0x2130
leaq -0x40(%rbp), %rdi
callq 0x20b0
movq %rbx, %rdi
callq 0x2d12
movq %r14, %rdi
callq 0x2310
nop
// File: /workspace/github_cpp_makefile_star2_O2/msu-starx[P]starx/pid.cpp
// Function: PID::computeValues()
bool PID::computeValues(void){
    if(!inAuto) return false;
    unsigned long currentTime = this->millis();
    unsigned long elapsedTime = currentTime - lastTime;
    if(elapsedTime >= sampleTime) {
        errorValue = setPoint - inputValue;
        iTerm += kiGain * errorValue;
        if(iTerm > outMax) iTerm = outMax;
        else if(iTerm < outMin) iTerm = outMin;
        dInput = inputValue - lastInput;
        // PID Equation
        outputValue = (kpGain * errorValue) + (iTerm) - (kdGain * dInput);
        //
        if(outputValue > outMax) outputValue = outMax;
        else if(outputValue < outMin) outputValue = outMin;
        lastInput = inputValue;
        lastTime = currentTime;
        return true;
    }
    else return false;
}

// Assembly:
cmpb $0x1, 0x10(%rdi)
jne 0x528a
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x522c
movq %rax, %rcx
subq 0x20(%rbx), %rcx
cmpq 0x18(%rbx), %rcx
jae 0x528d
xorl %eax, %eax
jmp 0x531f
xorl %eax, %eax
retq
movsd 0x28(%rbx), %xmm0
movsd 0x40(%rbx), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x38(%rbx)
movsd 0x68(%rbx), %xmm3
mulsd %xmm1, %xmm3
addsd 0x48(%rbx), %xmm3
movsd %xmm3, 0x48(%rbx)
movsd 0x80(%rbx), %xmm2
ucomisd %xmm2, %xmm3
movapd %xmm2, %xmm4
ja 0x52d0
movsd 0x78(%rbx), %xmm4
ucomisd %xmm3, %xmm4
jbe 0x52d9
movsd %xmm4, 0x48(%rbx)
movapd %xmm4, %xmm3
movapd %xmm0, %xmm4
subsd 0x58(%rbx), %xmm4
movsd %xmm4, 0x50(%rbx)
mulsd 0x60(%rbx), %xmm1
addsd %xmm3, %xmm1
mulsd 0x70(%rbx), %xmm4
subsd %xmm4, %xmm1
movsd %xmm1, 0x30(%rbx)
ucomisd %xmm2, %xmm1
ja 0x530f
movsd 0x78(%rbx), %xmm2
ucomisd %xmm1, %xmm2
jbe 0x5314
movsd %xmm2, 0x30(%rbx)
movsd %xmm0, 0x58(%rbx)
movq %rax, 0x20(%rbx)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/msu-starx[P]starx/pid.cpp
// Function: PID::setTunings(double, double, double)
void PID::setTunings(double Kp, double Ki, double Kd){
    if(Kp < 0 || Ki < 0 || Kd < 0) return;
    double sampleTimeInSec = ((double)sampleTime) / 1000;
    kpGain = Kp;
    kiGain = Ki * sampleTimeInSec;
    kdGain = Kd / sampleTimeInSec;
    if(controllerDirection == REVERSE) {
        kpGain = (0 - kpGain);
        kiGain = (0 - kiGain);
        kdGain = (0 - kdGain);
    }
}

// Assembly:
xorpd %xmm3, %xmm3
ucomisd %xmm0, %xmm3
ja 0x53af
ucomisd %xmm1, %xmm3
ja 0x53af
ucomisd %xmm2, %xmm3
ja 0x53af
pushq %rbp
movq %rsp, %rbp
movsd 0x18(%rdi), %xmm3
unpcklps 0xed4(%rip), %xmm3      # xmm3 = xmm3[0],mem[0],xmm3[1],mem[1]
subpd 0xedc(%rip), %xmm3      # 0x6230
movapd %xmm3, %xmm4
unpckhpd %xmm3, %xmm4            # xmm4 = xmm4[1],xmm3[1]
addsd %xmm3, %xmm4
divsd 0xed8(%rip), %xmm4      # 0x6240
movsd %xmm0, 0x60(%rdi)
mulsd %xmm4, %xmm1
movsd %xmm1, 0x68(%rdi)
divsd %xmm4, %xmm2
movsd %xmm2, 0x70(%rdi)
movl 0x14(%rdi), %eax
cmpl 0xc(%rdi), %eax
jne 0x53ae
xorpd %xmm3, %xmm3
xorpd %xmm4, %xmm4
subsd %xmm0, %xmm4
movsd %xmm4, 0x60(%rdi)
xorpd %xmm0, %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rdi)
subsd %xmm2, %xmm3
movsd %xmm3, 0x70(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/msu-starx[P]starx/pid.cpp
// Function: PID::setSampleTime(int)
void PID::setSampleTime(int newSampleTime){
    if(newSampleTime > 0) {
        double ratio = newSampleTime / sampleTime;
        kiGain *= ratio;
        kdGain /= ratio;
        sampleTime = newSampleTime;
    }
}

// Assembly:
testl %esi, %esi
jle 0x53e9
pushq %rbp
movq %rsp, %rbp
movl %esi, %ecx
movq %rcx, %rax
xorl %edx, %edx
divq 0x18(%rdi)
cvtsi2sd %rax, %xmm0
movsd 0x68(%rdi), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x68(%rdi)
movsd 0x70(%rdi), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x70(%rdi)
movq %rcx, 0x18(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/msu-starx[P]starx/pid.cpp
// Function: PID::setOutputLimits(double, double)
void PID::setOutputLimits(double Min, double Max){
    if(Min >= Max) return;
    outMin = Min;
    outMax = Max;
    if(inAuto) {
        if(outputValue > outMax) outputValue = outMax;
        else if(outputValue < outMin) outputValue = outMin;
        if(iTerm > outMax) iTerm = outMax;
        else if(iTerm < outMin) iTerm = outMin;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
ucomisd %xmm1, %xmm0
jae 0x543f
movsd %xmm0, 0x78(%rdi)
movsd %xmm1, 0x80(%rdi)
cmpb $0x1, 0x10(%rdi)
jne 0x543f
movsd 0x30(%rdi), %xmm3
ucomisd %xmm1, %xmm3
movapd %xmm1, %xmm2
ja 0x5420
ucomisd %xmm3, %xmm0
movapd %xmm0, %xmm2
jbe 0x5425
movsd %xmm2, 0x30(%rdi)
movsd 0x48(%rdi), %xmm2
ucomisd %xmm1, %xmm2
ja 0x543a
ucomisd %xmm2, %xmm0
movapd %xmm0, %xmm1
jbe 0x543f
movsd %xmm1, 0x48(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/msu-starx[P]starx/pid.cpp
// Function: PID::setMode(int)
void PID::setMode(int Mode){
    bool newAuto = Mode == AUTOMATIC;
    if(newAuto && !inAuto) {
        this->initialize();
    }
    inAuto = newAuto;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movl 0x4(%rdi), %r15d
cmpl %esi, %r15d
jne 0x5469
cmpb $0x0, 0x10(%rbx)
jne 0x5469
movq %rbx, %rdi
callq 0x547c
cmpl %r14d, %r15d
sete 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/msu-starx[P]starx/pid.cpp
// Function: PID::initialize()
void PID::initialize(void){
    lastInput = inputValue;
    iTerm = outputValue;
    if(iTerm > outMax) iTerm = outMax;
    else if(iTerm < outMin) iTerm = outMin;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movsd 0x28(%rdi), %xmm0
movsd 0x30(%rdi), %xmm1
movsd %xmm0, 0x58(%rdi)
movsd %xmm1, 0x48(%rdi)
movsd 0x80(%rdi), %xmm0
ucomisd %xmm0, %xmm1
ja 0x54ad
movsd 0x78(%rdi), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x54b2
movsd %xmm0, 0x48(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/msu-starx[P]starx/pid.cpp
// Function: PID::setControllerDirection(int)
void PID::setControllerDirection(int Direction){
    if(inAuto && Direction != controllerDirection) {
        kpGain = (0 - kpGain);
        kiGain = (0 - kiGain);
        kdGain = (0 - kdGain);
    }
    controllerDirection = Direction;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpb $0x1, 0x10(%rdi)
jne 0x54ed
cmpl %esi, 0x14(%rdi)
je 0x54ed
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
subsd 0x60(%rdi), %xmm1
movsd %xmm1, 0x60(%rdi)
xorpd %xmm1, %xmm1
subsd 0x68(%rdi), %xmm1
movsd %xmm1, 0x68(%rdi)
subsd 0x70(%rdi), %xmm0
movsd %xmm0, 0x70(%rdi)
movl %esi, 0x14(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/msu-starx[P]starx/serial.cpp
// Function: SerialPort::openPort()
void SerialPort::openPort(void){
    fileDescriptor = open(portName, O_RDWR | O_NOCTTY);
    // portName = Name of serial port
    // O_RDWR = Allows read/write access to serial port
    // O_NOCTTY = No terminal will control the process
    // O_NDELAY = Non blocking mode (do not care about the DCD line status)
    if (fileDescriptor == -1) {
        perror("\nOpen_Port: Unable to open serial port =");
    }
    else{
        printf("\nPort %s opened successfully!\n", portName);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x118(%rdi), %rdi
movl $0x102, %esi            # imm = 0x102
xorl %eax, %eax
callq 0x2120
movl %eax, 0x4(%rbx)
cmpl $-0x1, %eax
je 0x5533
movq 0x118(%rbx), %rsi
leaq 0xd4b(%rip), %rdi       # 0x6271
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2040
leaq 0xd0e(%rip), %rdi       # 0x6248
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2170
nop
// File: /workspace/github_cpp_makefile_star2_O2/msu-starx[P]starx/serial.cpp
// Function: SerialPort::writePort(char const*)
void SerialPort::writePort(const char* bufferWrite){
    bytesWrite = write(fileDescriptor, bufferWrite, strlen(bufferWrite));
    if(bytesWrite < 0) {
        fputs("write() of bytes failed!\n", stderr);
    }
    //*// Debug SerialPort::writePort
    if(bytesWrite > 0) {
        printf("Sent: %s", bufferWrite);
        printf("\n");
    }//*/
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4(%rdi), %r15d
movq %rsi, %rdi
callq 0x20a0
movl %r15d, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x2060
movl %eax, 0x8(%r14)
testl %eax, %eax
js 0x575a
testl %eax, %eax
jle 0x574f
leaq 0xbda(%rip), %rdi       # 0x630d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2040
pushq $0xa
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2230
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x486f(%rip), %rax      # 0x9fd0
movq (%rax), %rsi
leaq 0xb88(%rip), %rdi       # 0x62f3
callq 0x21e0
movl 0x8(%r14), %eax
jmp 0x5728
// File: /workspace/github_cpp_makefile_star2_O2/msu-starx[P]starx/serial.cpp
// Function: SerialPort::readPort()
char* SerialPort::readPort(void){
    bytesRead = read(fileDescriptor, &bufferRead, bufferSize);
    bufferRead[bytesRead] = 0;
    //*// Debug SerialPort::readPort
    if(bytesRead > 0) {
        printf("Received: %s", bufferRead);
        printf("\n");
    }//*/
    return bufferRead;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movl 0x4(%rdi), %edi
leaq 0x15(%r14), %rbx
movl $0xff, %edx
movq %rbx, %rsi
callq 0x2250
movl %eax, 0xc(%r14)
cltq
movb $0x0, 0x15(%r14,%rax)
cmpl $0x0, 0xc(%r14)
jle 0x57c0
leaq 0xb68(%rip), %rdi       # 0x6316
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2040
pushq $0xa
popq %rdi
callq 0x2230
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sidscrazy[P]Paxos/./paxos_message.h
// Function: receive_packet(int)
message *receive_packet (int fd){
	message *m = (message *) malloc (sizeof (message));
	if (m == NULL){
		return NULL;
	}

	char buf[1024];
	size_t len = sizeof (message);
	size_t r = recv (fd, buf, len, MSG_DONTWAIT);
	if (r != len){
		free (m);
		return NULL;
	}

	memcpy (m, buf, sizeof (message));
	return m;


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movl %edi, %r14d
pushq $0x20
popq %rdi
callq 0x2250
testq %rax, %rax
je 0x24b7
movq %rax, %rbx
leaq -0x410(%rbp), %rsi
pushq $0x20
popq %rdx
pushq $0x40
popq %rcx
movl %r14d, %edi
callq 0x2080
cmpq $0x20, %rax
jne 0x24af
movaps -0x410(%rbp), %xmm0
movaps -0x400(%rbp), %xmm1
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
jmp 0x24b9
movq %rbx, %rdi
callq 0x2200
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sidscrazy[P]Paxos/./paxos_message.h
// Function: ping(int, MSG_TYPE)
void ping (int fd, MSG_TYPE ty){
	message *m = (message *) malloc (sizeof (message));
	if (m == NULL){
		return;
	}
	m->receiver = -1;
	m->value = NO_VALUE;
	m->round = -1;
	m->type = ty;
	write (fd, (char *)m, sizeof (message));
	free (m);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r15d
movl %edi, %ebx
pushq $0x20
popq %rdi
callq 0x2250
testq %rax, %rax
je 0x2527
movq %rax, %r14
orq $-0x1, 0x4(%rax)
orl $-0x1, 0xc(%rax)
movl %r15d, 0x10(%rax)
pushq $0x20
popq %rdx
movl %ebx, %edi
movq %rax, %rsi
callq 0x2090
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2200
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sidscrazy[P]Paxos/./paxos_message.h
// Function: dump_message(message*)
void dump_message (message *m) {
	std::cout << "Paxos Message Start" << std::endl;
	std::cout << "Sender: " << m->sender << std::endl;
	std::cout << "Receier: " << m->receiver << std::endl;
	std::cout << "Value: " << m->value << std::endl;
	std::cout << "Round: " << m->round << std::endl;
	std::cout << "Type: " << m->type << std::endl;
	std::cout << "Paxos Message End" << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movq 0x5a95(%rip), %rbx      # 0x7fd8
leaq 0x2ada(%rip), %rsi      # 0x5024
movq %rbx, %rdi
callq 0x21d0
movq %rax, %rdi
callq 0x2100
leaq 0x2ad7(%rip), %rsi      # 0x5038
movq %rbx, %rdi
callq 0x21d0
movl (%r14), %esi
movq %rax, %rdi
callq 0x22f0
movq %rax, %rdi
callq 0x2100
leaq 0x2abe(%rip), %rsi      # 0x5041
movq %rbx, %rdi
callq 0x21d0
movl 0x4(%r14), %esi
movq %rax, %rdi
callq 0x22f0
movq %rax, %rdi
callq 0x2100
leaq 0x2aa5(%rip), %rsi      # 0x504b
movq %rbx, %rdi
callq 0x21d0
movl 0x8(%r14), %esi
movq %rax, %rdi
callq 0x22f0
movq %rax, %rdi
callq 0x2100
leaq 0x2a8a(%rip), %rsi      # 0x5053
movq %rbx, %rdi
callq 0x21d0
movl 0xc(%r14), %esi
movq %rax, %rdi
callq 0x22f0
movq %rax, %rdi
callq 0x2100
leaq 0x2a6f(%rip), %rsi      # 0x505b
movq %rbx, %rdi
callq 0x21d0
movl 0x10(%r14), %esi
movq %rax, %rdi
callq 0x22f0
movq %rax, %rdi
callq 0x2100
leaq 0x2a53(%rip), %rsi      # 0x5062
movq %rbx, %rdi
callq 0x21d0
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2100
// File: /workspace/github_cpp_makefile_star2_O2/sidscrazy[P]Paxos/paxos_node.cpp
// Function: main
int main (){
	/* Listen for initialization message */
	message *m;
	while (true){
		m = (receive_packet (1));
		if (m != NULL){
			break;
		}
	}

	PaxosNode node (m);
	free (m);
	node.run ();
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
pushq $0x1
popq %r14
movl %r14d, %edi
callq 0x245c
testq %rax, %rax
je 0x2635
movq %rax, %rbx
leaq -0x118(%rbp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x2698
movq %rbx, %rdi
callq 0x2200
movq %r14, %rdi
callq 0x279c
leaq -0x118(%rbp), %rdi
callq 0x2830
xorl %eax, %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x118(%rbp), %rdi
callq 0x2830
movq %rbx, %rdi
callq 0x2300
// File: /workspace/github_cpp_makefile_star2_O2/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::PaxosNode(message*)
PaxosNode (message *m){
		if (m->type != MSG_INIT) {
			exit (1);
		}
		id = m->sender;
		role = m->receiver;
		num_nodes = m->value;
		n = 0;
		v = NO_VALUE;
		state = NO_VALUE;
		log = new PaxosNodeLogger (id);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
movb $0x0, 0x18(%rdi)
leaq 0x78(%rdi), %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rdi)
movups %xmm0, 0x38(%rdi)
movups %xmm0, 0x48(%rdi)
movups %xmm0, 0x58(%rdi)
movups %xmm0, 0x68(%rdi)
movq %rbx, %rdi
callq 0x2864
xorps %xmm0, %xmm0
movups %xmm0, 0xe8(%r14)
movups %xmm0, 0xd8(%r14)
movups %xmm0, 0xc8(%r14)
movabsq $0x200000005, %rax      # imm = 0x200000005
movq %rax, 0xf8(%r14)
cmpl $0x0, 0x10(%r15)
jne 0x2755
movl (%r15), %r12d
movl %r12d, (%r14)
movl 0x4(%r15), %eax
movl %eax, 0x8(%r14)
movl 0x8(%r15), %eax
movl %eax, 0x4(%r14)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0xc(%r14)
orl $-0x1, 0x14(%r14)
movl $0x228, %edi            # imm = 0x228
callq 0x21e0
movq %rax, %r13
movq %rax, %rdi
movl %r12d, %esi
callq 0x3b98
movq %r13, 0x20(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rdi
callq 0x2210
movq %rax, %r15
movq %r13, %rdi
callq 0x21b0
jmp 0x276d
movq %rax, %r15
leaq 0xc8(%r14), %r12
addq $0xe0, %r14
movq %r14, %rdi
callq 0x2ab4
movq %r12, %rdi
callq 0x2ac8
movq %rbx, %rdi
callq 0x2adc
movq %r15, %rdi
callq 0x2300
nop
// File: /workspace/github_cpp_makefile_star2_O2/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::run()
void run (){
		std::thread t ([this]{ this->network_listener(); });
		message *m;
		while (true){
			m = NULL;
			queue_lock.lock ();
			if (!messages.empty ()){
				m = messages.front ();
				messages.pop ();
			}
			queue_lock.unlock ();
			
			process_message (m);
			proposer_state_update ();
			check_consensus ();
			check_timeout ();	
		}

	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq -0x30(%rbp), %rsi
movq %rdi, (%rsi)
leaq -0x28(%rbp), %rdi
callq 0x2b0c
leaq 0x50(%rbx), %r14
leaq 0x78(%rbx), %r15
movq %r14, %rdi
callq 0x2b7e
movq 0x88(%rbx), %rax
cmpq %rax, 0xa8(%rbx)
je 0x27eb
movq (%rax), %r12
movq %r15, %rdi
callq 0x321e
jmp 0x27ee
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x2150
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2b9e
movq %rbx, %rdi
callq 0x2db6
movq %rbx, %rdi
callq 0x2e0c
movq %rbx, %rdi
callq 0x2ee4
jmp 0x27c6
movq %rax, %rbx
leaq -0x28(%rbp), %rdi
callq 0x2f24
movq %rbx, %rdi
callq 0x2300
nop
// File: /workspace/github_cpp_makefile_star2_O2/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::proposer_state_update()
void proposer_state_update () {
		if ((role & PROPOSER)){
			if (prepare_acks.size () == 0 && state == NO_VALUE){
				prepare ();
			} else if (votes.size () == 0 && state == PREPARING) {
				propose ();
			}

		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testb $0x1, 0x8(%rdi)
jne 0x2dc2
popq %rbp
retq
movq 0xe8(%rdi), %rax
cmpq 0xe0(%rdi), %rax
sete %cl
movl 0x14(%rdi), %eax
cmpl $-0x1, %eax
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x2de9
popq %rbp
jmp 0x3a0c
movq 0xd0(%rdi), %rcx
cmpq 0xc8(%rdi), %rcx
sete %cl
cmpl $-0x4, %eax
sete %al
andb %cl, %al
cmpb $0x1, %al
jne 0x2dc0
popq %rbp
jmp 0x3aa6
// File: /workspace/github_cpp_makefile_star2_O2/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::check_consensus()
void check_consensus () {
		if ((role & LEARNER)&& (role & PROPOSER) &&
			state == PROPOSING) {
			int valid_votes = 0;
			for (int i = 0; i < votes.size (); i++){
				if (votes [i]->v == v && votes [i]->n == n){
					valid_votes++;
				}
			}
			if (valid_votes > (num_nodes % 2 == 0 ? num_nodes / 2 : 1 + (num_nodes / 2))) {
				message cons (id, -1, v, n, MSG_CONSENSUS);
				network_lock.lock ();
				send_message (0, &cons);
				network_lock.unlock ();
				safe_exit (&cons);
			}
		}
	}

// Assembly:
movl 0x8(%rdi), %eax
notl %eax
testb $0x3, %al
jne 0x2ee2
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
cmpl $-0x5, 0x14(%rdi)
jne 0x2ed8
movq 0xd0(%rbx), %rax
movq 0xc8(%rbx), %rdx
subq %rdx, %rax
sarq $0x3, %rax
movl 0xc(%rbx), %ecx
movl 0x10(%rbx), %esi
xorl %r8d, %r8d
xorl %edi, %edi
cmpq %r8, %rax
je 0x2e75
movq (%rdx,%r8,8), %r9
cmpl %ecx, 0x8(%r9)
jne 0x2e70
xorl %r10d, %r10d
cmpl %esi, 0x4(%r9)
sete %r10b
addl %r10d, %edi
incq %r8
jmp 0x2e53
movl 0x4(%rbx), %eax
testb $0x1, %al
jne 0x2e80
sarl %eax
jmp 0x2e8a
pushq $0x2
popq %r8
cltd
idivl %r8d
incl %eax
cmpl %eax, %edi
jle 0x2ed8
movl (%rbx), %eax
leaq -0x38(%rbp), %r14
movl %eax, (%r14)
orl $-0x1, 0x4(%r14)
movl %ecx, 0x8(%r14)
movl %esi, 0xc(%r14)
movl $0x6, 0x10(%r14)
leaq 0x28(%rbx), %r15
movq %r15, %rdi
callq 0x2b7e
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x3280
movq %r15, %rdi
callq 0x2150
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3490
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::check_timeout()
void check_timeout (){
		if (role & PROPOSER){
			time_t timeStamp = time(0);
			if (timeStamp - timeout  > TIMEOUT) {
				clear_responses ();
				proposer_state_update ();
			}
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testb $0x1, 0x8(%rdi)
je 0x2f1d
movq %rdi, %rbx
xorl %edi, %edi
callq 0x21a0
subq 0x100(%rbx), %rax
cmpq $0x9, %rax
jl 0x2f1d
movq %rbx, %rdi
callq 0x33dc
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2db6
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::network_listener()
void network_listener (){
		message *m;
		while (true){
			network_lock.lock ();
			m = receive_packet (1);
			network_lock.unlock ();
			if (m != NULL){
				queue_lock.lock ();
				messages.push (m);
				queue_lock.unlock ();
			}
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x28(%rdi), %r14
leaq 0x50(%rdi), %r15
addq $0x78, %rbx
pushq $0x1
popq %r12
leaq -0x30(%rbp), %r13
movq %r14, %rdi
callq 0x2b7e
movl %r12d, %edi
callq 0x245c
movq %rax, -0x30(%rbp)
movq %r14, %rdi
callq 0x2150
cmpq $0x0, -0x30(%rbp)
je 0x2f91
movq %r15, %rdi
callq 0x2b7e
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2fd2
movq %r15, %rdi
callq 0x2150
jmp 0x2f91
nop
// File: /workspace/github_cpp_makefile_star2_O2/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::send_message(int, message*)
void send_message (int fd, message *m){
		auto now = std::chrono::system_clock::now();
   		m->timestamp = std::chrono::duration_cast<std::chrono::nanoseconds>(now.time_since_epoch()).count();
		if (m->type == MSG_CONSENSUS){
			log->AddRowToLogFile (MSG_ENTRY, n, to_string (v),
								  role, n, to_string (v), m->type, m->timestamp);
		} else {
			log->AddRowToLogFile (MSG_ENTRY, n, to_string (v),
								  role, n, "", m->type, m->timestamp);
		}

		send_packet (fd, m);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, %rbx
movl %esi, -0x38(%rbp)
movq %rdi, %r14
callq 0x2030
movq %rax, 0x18(%rbx)
cmpl $0x6, 0x10(%rbx)
movq 0x20(%r14), %r13
movl 0xc(%r14), %esi
movl 0x10(%r14), %r12d
jne 0x331d
leaq -0x98(%rbp), %r15
movq %r15, %rdi
callq 0x35fa
movl 0x8(%r14), %eax
movl %eax, -0x2c(%rbp)
movl 0xc(%r14), %esi
movl 0x10(%r14), %r14d
leaq -0x78(%rbp), %rdi
callq 0x35fa
movl 0x10(%rbx), %eax
subq $0x8, %rsp
pushq $0x1
popq %rsi
movq %r13, %rdi
movl %r12d, %edx
movq %r15, %rcx
movl -0x2c(%rbp), %r8d
movl %r14d, %r9d
pushq 0x18(%rbx)
pushq %rax
leaq -0x78(%rbp), %rax
pushq %rax
callq 0x3ef0
addq $0x20, %rsp
leaq -0x78(%rbp), %rdi
callq 0x20d0
leaq -0x98(%rbp), %r14
jmp 0x338b
leaq -0xb8(%rbp), %r15
movq %r15, %rdi
callq 0x35fa
movl 0x8(%r14), %eax
movl %eax, -0x2c(%rbp)
movl 0x10(%r14), %eax
movl %eax, -0x34(%rbp)
leaq 0x1f07(%rip), %rsi      # 0x5248
leaq -0x58(%rbp), %rdi
leaq -0x2d(%rbp), %rdx
callq 0x20b0
movl 0x10(%rbx), %eax
subq $0x8, %rsp
pushq $0x1
popq %rsi
leaq -0xb8(%rbp), %r14
movq %r13, %rdi
movl %r12d, %edx
movq %r14, %rcx
movl -0x2c(%rbp), %r8d
movl -0x34(%rbp), %r9d
pushq 0x18(%rbx)
pushq %rax
leaq -0x58(%rbp), %rax
pushq %rax
callq 0x3ef0
addq $0x20, %rsp
leaq -0x58(%rbp), %rdi
callq 0x20d0
movq %r14, %rdi
callq 0x20d0
movl -0x38(%rbp), %edi
movq %rbx, %rsi
callq 0x24c8
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
jmp 0x33c0
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x20d0
jmp 0x33cc
jmp 0x33c9
movq %rax, %rbx
movq %r15, %rdi
callq 0x20d0
movq %rbx, %rdi
callq 0x2300
// File: /workspace/github_cpp_makefile_star2_O2/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::clear_responses()
void clear_responses (){
		if (role & LEARNER){
			for (int i = 0; i < votes.size (); i++){
				free (votes [i]);
			}
			votes.clear ();
		}
		prepare_acks.clear ();
		state = NO_VALUE;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
testb $0x2, 0x8(%rdi)
je 0x3426
xorl %r14d, %r14d
movq 0xc8(%rbx), %rax
movq 0xd0(%rbx), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r14, %rdx
jbe 0x341a
movq (%rax,%r14,8), %rdi
callq 0x2200
incq %r14
jmp 0x33ef
cmpq %rax, %rcx
je 0x3426
movq %rax, 0xd0(%rbx)
movq 0xe0(%rbx), %rax
cmpq %rax, 0xe8(%rbx)
je 0x343d
movq %rax, 0xe8(%rbx)
orl $-0x1, 0x14(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::safe_exit(message*)
void safe_exit (message *m) {
		log->CloseLogFile ();
		m->type = MSG_TEARDOWN;
		network_lock.lock ();
		send_message (0, m);
		while (true){
			m = receive_packet (1);
			if (m != NULL){
				if (m->type == MSG_TEARDOWN){
					network_lock.unlock ();
					exit (0);
				}
			}
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movq 0x20(%rdi), %rdi
callq 0x3ec4
movl $0x8, 0x10(%r14)
leaq 0x28(%r15), %rbx
movq %rbx, %rdi
callq 0x2b7e
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x3280
pushq $0x1
popq %r14
movl %r14d, %edi
callq 0x245c
testq %rax, %rax
je 0x34ce
cmpl $0x8, 0x10(%rax)
jne 0x34ce
movq %rbx, %rdi
callq 0x2b94
xorl %edi, %edi
callq 0x2210
// File: /workspace/github_cpp_makefile_star2_O2/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::simulate_crash()
void simulate_crash (){
		int c = rand () % 100;
		int crash_type = rand () % 100;
		if (c < p_crash){
			/* Don't sleep while holding locks. It's fine
			   to just modify system state accordingly when
			   waking up. */
			network_lock.lock ();
			log->Crash ();
			notify_crash (CRASH_ENTRY);
			network_lock.unlock ();

			int crash_duration = (rand () % (CRASH_DUR * 3) ) + 1;
			sleep (crash_duration);

			network_lock.lock ();
			queue_lock.lock ();
			while (!messages.empty ()) {
				message *m = messages.front ();
				messages.pop ();
				free (m);
			}
			queue_lock.unlock ();
			/* Machine Failure. Clear all current
			   state and then recover from log. */
			if (crash_type < crash_dist) {
				clear_responses ();
			}


			clear_network ();
			log->ResumeFromCrash ();
			notify_crash (RESUME_ENTRY);
			network_lock.unlock ();
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2060
pushq $0x64
popq %r15
cltd
idivl %r15d
movl %edx, %r14d
callq 0x2060
cltd
idivl %r15d
cmpl 0xf8(%rbx), %r14d
jge 0x359e
movl %edx, -0x2c(%rbp)
leaq 0x28(%rbx), %r14
movq %r14, %rdi
callq 0x2b7e
movq 0x20(%rbx), %rdi
callq 0x4266
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x39a6
movq %r14, %rdi
callq 0x2150
callq 0x2060
pushq $0x6
popq %rcx
cltd
idivl %ecx
leal 0x1(%rdx), %edi
callq 0x2140
movq %r14, %rdi
callq 0x2b7e
leaq 0x50(%rbx), %r12
movq %r12, %rdi
callq 0x2b7e
leaq 0x78(%rbx), %r13
movq 0x88(%rbx), %rax
cmpq %rax, 0xa8(%rbx)
je 0x35ad
movq (%rax), %r15
movq %r13, %rdi
callq 0x321e
movq %r15, %rdi
callq 0x2200
jmp 0x3579
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
callq 0x2150
movl -0x2c(%rbp), %eax
cmpl 0xfc(%rbx), %eax
jge 0x35c8
movq %rbx, %rdi
callq 0x33dc
movq %rbx, %rdi
callq 0x39e6
movq 0x20(%rbx), %rdi
callq 0x4310
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x39a6
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2150
// File: /workspace/github_cpp_makefile_star2_O2/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::notify_crash(int)
void notify_crash (int code) {
		message m (id, -1, code, n, MSG_CRASH);
		auto now = std::chrono::system_clock::now();
   		m.timestamp = std::chrono::duration_cast<std::chrono::nanoseconds>(now.time_since_epoch()).count();
		send_packet (0, &m);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x28, %rsp
movl (%rdi), %eax
movl 0x10(%rdi), %ecx
leaq -0x28(%rbp), %rbx
movl %eax, (%rbx)
orl $-0x1, 0x4(%rbx)
movl %esi, 0x8(%rbx)
movl %ecx, 0xc(%rbx)
movl $0x9, 0x10(%rbx)
callq 0x2030
movq %rax, 0x18(%rbx)
xorl %edi, %edi
movq %rbx, %rsi
callq 0x24c8
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::clear_network()
void clear_network () {
		message *m;
		while (true){
			m = receive_packet (1);
			if (m == NULL){
				break;
			} else {
				free (m);
			}
		}

	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
pushq $0x1
popq %rbx
movl %ebx, %edi
callq 0x245c
testq %rax, %rax
je 0x3a05
movq %rax, %rdi
callq 0x2200
jmp 0x39ef
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::prepare()
void prepare (){
		if (role & PROPOSER){
			n += 1;
			message m (id, -1, -1, n, MSG_PREPARE);

			clear_responses ();
			network_lock.lock ();
			send_message (0, &m);
			network_lock.unlock ();
			prepare_acks.push_back (id);
			state = PREPARING;
			timeout = time(0);
			simulate_crash ();

		}
	}

// Assembly:
testb $0x1, 0x8(%rdi)
je 0x3aa4
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl 0x10(%rdi), %eax
incl %eax
movl %eax, 0x10(%rdi)
movl (%rdi), %ecx
leaq -0x38(%rbp), %r14
movl %ecx, (%r14)
orq $-0x1, 0x4(%r14)
movl %eax, 0xc(%r14)
movl $0x1, 0x10(%r14)
callq 0x33dc
leaq 0x28(%rbx), %r15
movq %r15, %rdi
callq 0x2b7e
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x3280
movq %r15, %rdi
callq 0x2150
leaq 0xe0(%rbx), %rdi
movq %rbx, %rsi
callq 0x3446
movl $0xfffffffc, 0x14(%rbx) # imm = 0xFFFFFFFC
xorl %edi, %edi
callq 0x21a0
movq %rax, 0x100(%rbx)
movq %rbx, %rdi
callq 0x34f0
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sidscrazy[P]Paxos/paxos_node.cpp
// Function: PaxosNode::propose()
void propose (){

		if ((num_nodes % 2 == 0 ? num_nodes / 2 : 1 + (num_nodes / 2)) > prepare_acks.size ()){
			return;
		}

		proposed_v = true;

		state = PROPOSING;

		if (v == NO_VALUE){
			v = rand () % 250;
		}
		vote *vo = (vote *) malloc (sizeof (vote));
		vo->node = id;
		vo->n = n;
		vo->v = v;
		votes.push_back (vo);

		message m (id, -1, v, n, MSG_PROPOSE);
		network_lock.lock ();
		send_message (0, &m);
		network_lock.unlock ();
		timeout  = time(0);
		simulate_crash ();
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl 0x4(%rdi), %eax
testb $0x1, %al
jne 0x3ac1
sarl %eax
jmp 0x3ac9
pushq $0x2
popq %rcx
cltd
idivl %ecx
incl %eax
cltq
movq 0xe8(%rbx), %rcx
subq 0xe0(%rbx), %rcx
sarq $0x2, %rcx
cmpq %rax, %rcx
jb 0x3b8c
movb $0x1, 0x18(%rbx)
movl $0xfffffffb, 0x14(%rbx) # imm = 0xFFFFFFFB
movl 0xc(%rbx), %r14d
cmpl $-0x1, %r14d
jne 0x3b0e
callq 0x2060
movl $0xfa, %ecx
cltd
idivl %ecx
movl %edx, %r14d
movl %edx, 0xc(%rbx)
pushq $0xc
popq %rdi
callq 0x2250
leaq -0x20(%rbp), %rsi
movq %rax, (%rsi)
movl (%rbx), %ecx
movl %ecx, (%rax)
movl 0x10(%rbx), %ecx
movl %ecx, 0x4(%rax)
movl %r14d, 0x8(%rax)
leaq 0xc8(%rbx), %rdi
callq 0x346c
movl (%rbx), %eax
movq 0xc(%rbx), %rcx
leaq -0x40(%rbp), %r14
movl %eax, (%r14)
orl $-0x1, 0x4(%r14)
movq %rcx, 0x8(%r14)
movl $0x3, 0x10(%r14)
leaq 0x28(%rbx), %r15
movq %r15, %rdi
callq 0x2b7e
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x3280
movq %r15, %rdi
callq 0x2150
xorl %edi, %edi
callq 0x21a0
movq %rax, 0x100(%rbx)
movq %rbx, %rdi
callq 0x34f0
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sidscrazy[P]Paxos/./plan/PaxosNodeLogger.cpp
// Function: PaxosNodeLogger::PaxosNodeLogger(int)
PaxosNodeLogger::PaxosNodeLogger(int nodeid)
{
    nodeuniqueid = nodeid;
    SetLogFileName(nodeid);
    OpenLogFile(logfilename);
    AddLogFileHeader();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %esi, %r15d
movq %rdi, %rbx
callq 0x22e0
leaq 0x210(%rbx), %rax
movq %rax, 0x200(%rbx)
andq $0x0, 0x208(%rbx)
leaq 0x200(%rbx), %r14
movb $0x0, 0x210(%rbx)
movl %r15d, 0x220(%rbx)
movq %rbx, %rdi
movl %r15d, %esi
callq 0x3c44
leaq -0x38(%rbp), %rdi
movq %r14, %rsi
callq 0x2260
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
callq 0x3ce0
leaq -0x38(%rbp), %rdi
callq 0x20d0
movq %rbx, %rdi
callq 0x3d10
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
leaq -0x38(%rbp), %rdi
callq 0x20d0
jmp 0x3c2b
movq %rax, %r15
movq %r14, %rdi
callq 0x20d0
movq %rbx, %rdi
callq 0x22a0
movq %r15, %rdi
callq 0x2300
nop
// File: /workspace/github_cpp_makefile_star2_O2/sidscrazy[P]Paxos/./plan/PaxosNodeLogger.cpp
// Function: PaxosNodeLogger::AddLogFileHeader()
int PaxosNodeLogger::AddLogFileHeader(void)
{
    if (myfile.is_open()) // should always be true
    {
        // Now add header to the file
        myfile << "timeStamp" << ",";
        myfile << "nodeid" << ",";
        myfile << "receiverid" << ",";
        myfile << "nodeAlive" << ",";
        myfile << "N" << ",";
        myfile << "value" << ",";
        myfile << "nodeRole" << ",";
        myfile << "maxPromisedN" << ",";
        myfile << "consensusValue" << ",";
        myfile << "currentAction" << ",";
        return 1;
    }
    return 0; // file not open, return that failed to add header to the log file.
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
addq $0x70, %rdi
callq 0x2040
movl %eax, %ecx
xorl %eax, %eax
testb %cl, %cl
je 0x3e3d
leaq 0x14b0(%rip), %rsi      # 0x51e6
movq %rbx, %rdi
callq 0x21d0
leaq 0x14ab(%rip), %r14      # 0x51f0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
leaq 0x149b(%rip), %rsi      # 0x51f2
movq %rbx, %rdi
callq 0x21d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
leaq 0x1488(%rip), %rsi      # 0x51f9
movq %rbx, %rdi
callq 0x21d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
leaq 0x1479(%rip), %rsi      # 0x5204
movq %rbx, %rdi
callq 0x21d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
leaq 0x1483(%rip), %rsi      # 0x5228
movq %rbx, %rdi
callq 0x21d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
leaq 0x144f(%rip), %rsi      # 0x520e
movq %rbx, %rdi
callq 0x21d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
leaq 0x143b(%rip), %rsi      # 0x5214
movq %rbx, %rdi
callq 0x21d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
leaq 0x142a(%rip), %rsi      # 0x521d
movq %rbx, %rdi
callq 0x21d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
leaq 0x141d(%rip), %rsi      # 0x522a
movq %rbx, %rdi
callq 0x21d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
leaq 0x1412(%rip), %rsi      # 0x5239
movq %rbx, %rdi
callq 0x21d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sidscrazy[P]Paxos/./plan/PaxosNodeLogger.cpp
// Function: PaxosNodeLogger::AddMsg(message*, int)
void PaxosNodeLogger::AddMsg (message *m, int role) {
    myfile << "\n"; // get to the new line for next entry.
    myfile << m->timestamp        << ",";         // get to the new line for next entry.
    myfile << m->sender     << ",";         // string: unique guid for the node which owns this log file, same as file name.
    myfile << m->receiver     << ",";         
    myfile << MSG_ENTRY         << ",";         // int: denotes if the node is alive is crashed state.
    myfile << m->round                 << ",";         // int: The value of N proposed or accepted by a node. In say Broadcast action, its value is redundant.
    myfile << m->value             << ",";         // string: Pick value v of highest proposal number -> this is the v we are talking about
    myfile << role          << ",";         // int: Proposer, Acceptor, Learner.
    myfile << m->round     << ",";         // int: Maximum Promised value of N so far for the node. Even leader can have a promised N
    if (m->type == MSG_CONSENSUS){
        myfile << m->value    << ","; 
    } else {
        myfile << ""    << ","; 
    }
    myfile << m->type     << ",";         // int Current action on the node as the logging is happening                              
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r12d
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x120c(%rip), %rsi      # 0x5247
callq 0x21d0
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x21c0
leaq 0x119d(%rip), %r15      # 0x51f0
movq %rax, %rdi
movq %r15, %rsi
callq 0x21d0
movl (%r14), %esi
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rdi
movq %r15, %rsi
callq 0x21d0
movl 0x4(%r14), %esi
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rdi
movq %r15, %rsi
callq 0x21d0
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rdi
movq %r15, %rsi
callq 0x21d0
movl 0xc(%r14), %esi
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rdi
movq %r15, %rsi
callq 0x21d0
movl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rdi
movq %r15, %rsi
callq 0x21d0
movq %rbx, %rdi
movl %r12d, %esi
callq 0x22f0
movq %rax, %rdi
movq %r15, %rsi
callq 0x21d0
movl 0xc(%r14), %esi
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rdi
movq %r15, %rsi
callq 0x21d0
cmpl $0x6, 0x10(%r14)
jne 0x4111
movl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x22f0
jmp 0x4120
leaq 0x1130(%rip), %rsi      # 0x5248
movq %rbx, %rdi
callq 0x21d0
leaq 0x10c9(%rip), %r15      # 0x51f0
movq %rax, %rdi
movq %r15, %rsi
callq 0x21d0
movl 0x10(%r14), %esi
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rdi
movq %r15, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x21d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/sidscrazy[P]Paxos/./plan/PaxosNodeLogger.cpp
// Function: PaxosNodeLogger::CrashSequence(message*)
void PaxosNodeLogger::CrashSequence (message *m){
    myfile << "\n"; // get to the new line for next entry.
    myfile << m->timestamp        << ",";         // get to the new line for next entry.
    myfile << m->sender     << ",";         // string: unique guid for the node which owns this log file, same as file name.
    myfile << "-1" << ",";
    myfile << m->value         << ",";         // int: denotes if the node is alive is crashed state.
    myfile << "-1"                  << ",";         // int: The value of N proposed or accepted by a node. In say Broadcast action, its value is redundant.
    myfile << "-1"            << ",";         // string: Pick value v of highest proposal number -> this is the v we are talking about
    myfile << "-1"           << ",";         // int: Proposer, Acceptor, Learner.
    myfile << "-1"      << ",";         // int: Maximum Promised value of N so far for the node. Even leader can have a promised N
    myfile << "-1"     << ","; 
    myfile << "-1"      << ",";         // int Current action on the node as the logging is happening      
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x10dd(%rip), %rsi      # 0x5247
callq 0x21d0
movq 0x18(%r12), %rsi
movq %rbx, %rdi
callq 0x21c0
leaq 0x106d(%rip), %r14      # 0x51f0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
movl (%r12), %esi
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
leaq 0x10a0(%rip), %r15      # 0x524c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
movl 0x8(%r12), %esi
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21d0
movq %rax, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x21d0
// File: /workspace/github_cpp_makefile_star2_O2/ArashPartow[P]exprtk-extras/exprtk_gnuplot.cpp
// Function: main
int main()
{
   exprtk_gnuplot_fx plotter;

   plotter
      .set_expression("clamp(-1.0,sin(2 * pi * x) + cos(x / 2 * pi),+1.0)")
      .set_domain(-5,+5)
      .set_title("ExprTk GNUPlot Example");

   plotter.plot();

   return 0;
}

// Assembly:
pushq %rbx
subq $0xb0, %rsp
leaq 0x60(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x80(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
leaq 0x12ae54(%rip), %rsi    # 0x23b10f
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x110418
leaq 0x70(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x10e590
movaps 0x125d30(%rip), %xmm0   # 0x236010
movups %xmm0, 0x90(%rsp)
leaq 0x12ae53(%rip), %rsi    # 0x23b142
leaq 0x10(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x110418
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x10e590
leaq 0x10(%rsp), %rdi
callq 0x10e608
leaq 0x30(%rsp), %rdi
callq 0x10e608
leaq 0x50(%rsp), %rdi
callq 0x110454
leaq 0x50(%rsp), %rdi
callq 0x11046e
xorl %eax, %eax
addq $0xb0, %rsp
popq %rbx
retq
jmp 0x110362
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x10e608
jmp 0x110356
jmp 0x110353
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x10e608
jmp 0x110365
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x11046e
movq %rbx, %rdi
callq 0x10e330
// File: /workspace/github_cpp_makefile_star2_O2/ArashPartow[P]exprtk-extras/exprtk_gnuplot.cpp
// Function: exprtk_gnuplot_fx::generate_gp_script()
bool generate_gp_script()
   {
      std::ofstream stream("plot.gp");

      if (!stream)
      {
         return false;
      }

      stream << "set term png\n";
      stream << "set output 'plot.png'\n";
      stream << "set xrange[" << min_x_ << ":" << max_x_ <<"]\n";
      stream << "set yrange[" << min_y_ << ":" << max_y_ <<"]\n";
      stream << "set xzeroaxis\n";
      stream << "set yzeroaxis\n";
      stream << "plot 'data.dat' using 1:2:(1.0) smooth unique title '" << title_ <<"'\n";

      return true;
   }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movq %rdi, %rbx
leaq 0x12f520(%rip), %rsi    # 0x23fc9b
movq %rsp, %r14
pushq $0x10
popq %rdx
movq %r14, %rdi
callq 0x10e170
movq (%r14), %rax
movq -0x18(%rax), %rax
movl 0x20(%rsp,%rax), %ebp
testb $0x5, %bpl
jne 0x110891
leaq 0x12f4fe(%rip), %rsi    # 0x23fca3
movq %rsp, %rdi
callq 0x10e2d0
leaq 0x12f4fd(%rip), %rsi    # 0x23fcb1
movq %rsp, %rdi
callq 0x10e2d0
leaq 0x12f505(%rip), %rsi    # 0x23fcc8
movq %rsp, %rdi
callq 0x10e2d0
movsd 0x40(%rbx), %xmm0
movq %rax, %rdi
callq 0x10e3a0
leaq 0x12b08d(%rip), %rsi    # 0x23b86c
movq %rax, %rdi
callq 0x10e2d0
movsd 0x48(%rbx), %xmm0
movq %rax, %rdi
callq 0x10e3a0
leaq 0x12f4d9(%rip), %rsi    # 0x23fcd4
movq %rax, %rdi
callq 0x10e2d0
leaq 0x12f4cd(%rip), %rsi    # 0x23fcd7
movq %rsp, %rdi
callq 0x10e2d0
movsd 0x50(%rbx), %xmm0
movq %rax, %rdi
callq 0x10e3a0
leaq 0x12b046(%rip), %rsi    # 0x23b86c
movq %rax, %rdi
callq 0x10e2d0
movsd 0x58(%rbx), %xmm0
movq %rax, %rdi
callq 0x10e3a0
leaq 0x12f492(%rip), %rsi    # 0x23fcd4
movq %rax, %rdi
callq 0x10e2d0
leaq 0x12f492(%rip), %rsi    # 0x23fce3
movq %rsp, %rdi
callq 0x10e2d0
leaq 0x12f492(%rip), %rsi    # 0x23fcf2
movq %rsp, %rdi
callq 0x10e2d0
leaq 0x12f492(%rip), %rsi    # 0x23fd01
movq %rsp, %rdi
callq 0x10e2d0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x10e150
leaq 0x12f43c(%rip), %rsi    # 0x23fcc5
movq %rax, %rdi
callq 0x10e2d0
testb $0x5, %bpl
sete %bl
movq %rsp, %rdi
callq 0x10e3c0
movl %ebx, %eax
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x10e3c0
movq %rbx, %rdi
callq 0x10e330
nop
// File: /workspace/github_cpp_makefile_star2_O2/ra101[P]Generic-BlockChain-container-cpp/./includes/rsa.hpp
// Function: ra::rsa_key_pair::create_key(unsigned long)
void rsa_key_pair::create_key(unsigned long seed)
    {
        random_prime_engine<std::default_random_engine> eng(seed);
        do
        {
            // two random prime int
            int p1 = eng();
            int p2 = eng();

            int n = p1 * p2;
            int phin = n - p1 - p2 + 1; //(p1-1)*(p2-1)
            int e = get_e(phin);
            int k = get_k(phin, e);
            int d = (k * phin + 1) / e;

            // multipplication to BIG_NO is way to concatenate n and e or d
            public_key = n * BIG_NO + e;
            private_key = n * BIG_NO + d;
        } while (!are_keys_valid());
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rax
movq %rdi, %rbx
movq %rsp, %r14
andq $0x0, 0x8(%r14)
leaq 0x2b4b(%rip), %rcx      # 0x6020
movq %rcx, 0x10(%r14)
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %edx, %edx
divq %rcx
cmpq $0x1, %rdx
adcq $0x0, %rdx
movq %rdx, (%r14)
movabsq $0x174876e800, %r12     # imm = 0x174876E800
movq %r14, %rdi
callq 0x3ac8
movl %eax, %r15d
movq %r14, %rdi
callq 0x3ac8
movl %eax, %r13d
imull %r15d, %r13d
addl %eax, %r15d
negl %r15d
leal (%r15,%r13), %ebp
incl %ebp
movl %ebp, %esi
callq 0x359e
movl %eax, %r15d
movl %ebp, %esi
movl %eax, %edx
callq 0x35b6
imull %ebp, %eax
incl %eax
cltd
idivl %r15d
movslq %r13d, %rdx
imulq %r12, %rdx
movslq %r15d, %rcx
addq %rdx, %rcx
movq %rcx, 0x8(%rbx)
movslq %eax, %rsi
addq %rdx, %rsi
movq %rsi, (%rbx)
movq %rcx, %rax
xorl %edx, %edx
divq %r12
movq %rax, %rcx
movq %rsi, %rax
xorl %edx, %edx
divq %r12
cmpl %eax, %ecx
jne 0x34f8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ra101[P]Generic-BlockChain-container-cpp/./includes/rsa.hpp
// Function: ra::encrypt(unsigned long, unsigned long long)
std::size_t encrypt(std::size_t digest, unsigned long long int others_public_key)
    {
        int n = others_public_key / BIG_NO; // retrive n
        int e = others_public_key % BIG_NO; // retrive e
        long long int res = 1;              // Initialize result
        long long int x = digest;
        x = x % n; // Update x if it is more than or
                   // equal to n
        while (e > 0)
        {
            // If e is odd, multiply x with result
            if (e & 1)
                res = (res * x) % n;
            // e must be even now
            e = e >> 1; // e = e/2
            x = (x * x) % n;
        }
        return res;
    }

// Assembly:
movq %rsi, %rax
movabsq $0x174876e800, %rcx     # imm = 0x174876E800
xorl %edx, %edx
divq %rcx
movq %rax, %rcx
movq %rdx, %rsi
pushq $0x1
popq %r8
movq %rdi, %rax
cqto
idivq %rcx
testl %esi, %esi
jle 0x3660
movq %rdx, %rdi
testb $0x1, %sil
je 0x3658
imulq %rdi, %r8
movq %r8, %rax
cqto
idivq %rcx
movq %rdx, %r8
shrl %esi
imulq %rdi, %rdi
jmp 0x3634
movq %r8, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/ra101[P]Generic-BlockChain-container-cpp/./includes/rsa.hpp
// Function: ra::rsa_key_pair::decrypt(unsigned int)
std::size_t rsa_key_pair::decrypt(unsigned encrypted_data)
    {
        int n = private_key / BIG_NO; // retrive n
        int d = private_key % BIG_NO; // retrive d
        unsigned long long int res = 1;
        unsigned long long int x = encrypted_data;
        x = x % n;
        while (d > 0) // exact simmilar encrypt
        {
            if (d & 1)
                res = (res * x) % n;
            d = d >> 1;
            x = (x * x) % n;
        }
        return res;
    }

// Assembly:
movq (%rdi), %rax
movabsq $0x174876e800, %rcx     # imm = 0x174876E800
xorl %edx, %edx
divq %rcx
movq %rax, %rcx
movq %rdx, %r9
movl %esi, %edi
pushq $0x1
popq %r8
movq %rdi, %rax
xorl %edx, %edx
divq %rcx
testl %r9d, %r9d
jle 0x36b0
movq %rdx, %rdi
testb $0x1, %r9b
je 0x36a7
imulq %rdi, %r8
movq %r8, %rax
xorl %edx, %edx
divq %rcx
movq %rdx, %r8
shrl %r9d
imulq %rdi, %rdi
jmp 0x3682
movq %r8, %rax
retq