LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: Neuromancer2701[P]OpenTool/src/Header.cpp
// Function: Header::Unpack()
void Header::Unpack()	{

	InputStream >> std::setw(Length_Size)	>> Length;

	InputStream >> std::setw(Number_Size)	>> Number;

	InputStream >> std::setw(Revision_Size) >> Revision;

	InputStream >> std::setw(NoAckFlag_Size) >> NoAckFlag;

	InputStream >> std::setw(StationID_Size) >> StationID;

	InputStream >> std::setw(SpindleID_Size) >> SpindleID;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
addq $0x8, %rax
movq %rax, -0x58(%rbp)
movl $0x4, %edi
callq 0xb070
movq -0x58(%rbp), %rdi
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %esi
callq 0xa8b0
movq -0x28(%rbp), %rsi
movq %rax, %rdi
addq $0x318, %rsi            # imm = 0x318
callq 0xa530
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x50(%rbp)
movl $0x4, %edi
callq 0xb070
movq -0x50(%rbp), %rdi
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %esi
callq 0xa8b0
movq -0x28(%rbp), %rsi
movq %rax, %rdi
addq $0x31c, %rsi            # imm = 0x31C
callq 0xaee0
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x48(%rbp)
movl $0x3, %edi
callq 0xb070
movq -0x48(%rbp), %rdi
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %esi
callq 0xa8b0
movq -0x28(%rbp), %rsi
movq %rax, %rdi
addq $0x320, %rsi            # imm = 0x320
callq 0xafd0
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x40(%rbp)
movl $0x1, %edi
callq 0xb070
movq -0x40(%rbp), %rdi
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %esi
callq 0xa8b0
movq -0x28(%rbp), %rsi
movq %rax, %rdi
addq $0x324, %rsi            # imm = 0x324
callq 0xa790
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x38(%rbp)
movl $0x1, %edi
callq 0xb070
movq -0x38(%rbp), %rdi
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %esi
callq 0xa8b0
movq -0x28(%rbp), %rsi
movq %rax, %rdi
addq $0x328, %rsi            # imm = 0x328
callq 0xa530
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x30(%rbp)
movl $0x2, %edi
callq 0xb070
movq -0x30(%rbp), %rdi
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %esi
callq 0xa8b0
movq -0x28(%rbp), %rsi
movq %rax, %rdi
addq $0x32c, %rsi            # imm = 0x32C
callq 0xa530
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: Neuromancer2701[P]OpenTool/src/MessageID.h
// Function: operator>>(std::istream&, MID_Number&)
inline std::istream & operator>>(std::istream & stream, MID_Number& number )
{
	unsigned placeholder = 0;
	if(stream >> placeholder)
		number = static_cast<MID_Number>(placeholder);
    return stream;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x14(%rbp), %rsi
callq 0xa0d0
movq %rax, %rdi
movq (%rdi), %rax
addq -0x18(%rax), %rdi
callq 0xaa30
testb $0x1, %al
jne 0xe539
jmp 0xe542
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: Neuromancer2701[P]OpenTool/src/Mid0002.cpp
// Function: Mid_0002::PackupMid0002()
void Mid_0002::PackupMid0002()
{

	switch(Revision)
	{
		default:
		case MID_Revision::Revision1:
			 Length += Rev1_size;
			 Packup();
			 BuildRevision1();
			 OutputStream << '\0';
			 break;
		case MID_Revision::Revision2:
			 Length += Rev2_size;
			 Packup();
			 BuildRevision2();
			 OutputStream << '\0';
			 break;
		case MID_Revision::Revision3:
			 Length += Rev3_size;
			 Packup();
			 BuildRevision3();
			 OutputStream << '\0';
			 break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl 0x320(%rax), %eax
movl %eax, -0xc(%rbp)
subl $0x1, %eax
je 0xee6a
jmp 0xee54
movl -0xc(%rbp), %eax
subl $0x2, %eax
je 0xeea4
jmp 0xee5e
movl -0xc(%rbp), %eax
subl $0x3, %eax
je 0xeede
jmp 0xee68
jmp 0xee6a
movq -0x18(%rbp), %rdi
movl 0x318(%rdi), %eax
addl $0x25, %eax
movl %eax, 0x318(%rdi)
movq (%rdi), %rax
callq *0x10(%rax)
movq -0x18(%rbp), %rdi
callq 0xa7f0
movq -0x18(%rbp), %rdi
addq $0x190, %rdi            # imm = 0x190
addq $0x10, %rdi
xorl %esi, %esi
callq 0xa990
jmp 0xef16
movq -0x18(%rbp), %rdi
movl 0x318(%rdi), %eax
addl $0x2a, %eax
movl %eax, 0x318(%rdi)
movq (%rdi), %rax
callq *0x10(%rax)
movq -0x18(%rbp), %rdi
callq 0xa9e0
movq -0x18(%rbp), %rdi
addq $0x190, %rdi            # imm = 0x190
addq $0x10, %rdi
xorl %esi, %esi
callq 0xa990
jmp 0xef16
movq -0x18(%rbp), %rdi
movl 0x318(%rdi), %eax
addl $0x69, %eax
movl %eax, 0x318(%rdi)
movq (%rdi), %rax
callq *0x10(%rax)
movq -0x18(%rbp), %rdi
callq 0xa510
movq -0x18(%rbp), %rdi
addq $0x190, %rdi            # imm = 0x190
addq $0x10, %rdi
xorl %esi, %esi
callq 0xa990
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: Neuromancer2701[P]OpenTool/src/Mid0002.cpp
// Function: Mid_0002::ParseRevision1()
void Mid_0002::ParseRevision1()
{
	int index;
	OutputStream >> std::setw(Index_size) >> index;
	OutputStream >> std::setw(Cell_Id_size) >> Cell_Id;
	OutputStream >> std::setw(Index_size) >> index;
	OutputStream >> std::setw(Channel_Id_size) >> Channel_Id;
	OutputStream >> std::setw(Index_size) >> index;
	OutputStream >> std::setw(Controller_Name_size) >> Controller_Name;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
addq $0x190, %rax            # imm = 0x190
movq %rax, -0x60(%rbp)
movl $0x2, %edi
callq 0xb070
movq -0x60(%rbp), %rdi
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %esi
callq 0xa8b0
movq %rax, %rdi
leaq -0xc(%rbp), %rsi
callq 0xa530
movq -0x30(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, -0x58(%rbp)
movl $0x4, %edi
callq 0xb070
movq -0x58(%rbp), %rdi
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %esi
callq 0xa8b0
movq -0x30(%rbp), %rsi
movq %rax, %rdi
addq $0x330, %rsi            # imm = 0x330
callq 0xa530
movq -0x30(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, -0x50(%rbp)
movl $0x2, %edi
callq 0xb070
movq -0x50(%rbp), %rdi
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %esi
callq 0xa8b0
movq %rax, %rdi
leaq -0xc(%rbp), %rsi
callq 0xa530
movq -0x30(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, -0x48(%rbp)
movl $0x2, %edi
callq 0xb070
movq -0x48(%rbp), %rdi
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %esi
callq 0xa8b0
movq -0x30(%rbp), %rsi
movq %rax, %rdi
addq $0x334, %rsi            # imm = 0x334
callq 0xa530
movq -0x30(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, -0x40(%rbp)
movl $0x2, %edi
callq 0xb070
movq -0x40(%rbp), %rdi
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %esi
callq 0xa8b0
movq %rax, %rdi
leaq -0xc(%rbp), %rsi
callq 0xa530
movq -0x30(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, -0x38(%rbp)
movl $0x19, %edi
callq 0xb070
movq -0x38(%rbp), %rdi
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %esi
callq 0xa8b0
movq -0x30(%rbp), %rsi
movq %rax, %rdi
addq $0x338, %rsi            # imm = 0x338
callq 0xaa40
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: Neuromancer2701[P]OpenTool/src/Mid0002.cpp
// Function: Mid_0002::ParseRevision3()
void Mid_0002::ParseRevision3()
{
	int index;
	ParseRevision2();
	OutputStream >> std::setw(Index_size) >> index;
	OutputStream >> std::setw(Open_Protocol_version_size) >> Open_Protocol_version;
	OutputStream >> std::setw(Index_size) >> index;
	OutputStream >> std::setw(Controller_software_version_size) >> Controller_software_version;
	OutputStream >> std::setw(Index_size) >> index;
	OutputStream >> std::setw(Tool_software_version_size) >> Tool_software_version;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
callq 0xa5d0
movq -0x30(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, -0x60(%rbp)
movl $0x2, %edi
callq 0xb070
movq -0x60(%rbp), %rdi
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %esi
callq 0xa8b0
movq %rax, %rdi
leaq -0xc(%rbp), %rsi
callq 0xa530
movq -0x30(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, -0x58(%rbp)
movl $0x13, %edi
callq 0xb070
movq -0x58(%rbp), %rdi
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %esi
callq 0xa8b0
movq -0x30(%rbp), %rsi
movq %rax, %rdi
addq $0x378, %rsi            # imm = 0x378
callq 0xaa40
movq -0x30(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, -0x50(%rbp)
movl $0x2, %edi
callq 0xb070
movq -0x50(%rbp), %rdi
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %esi
callq 0xa8b0
movq %rax, %rdi
leaq -0xc(%rbp), %rsi
callq 0xa530
movq -0x30(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, -0x48(%rbp)
movl $0x13, %edi
callq 0xb070
movq -0x48(%rbp), %rdi
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %esi
callq 0xa8b0
movq -0x30(%rbp), %rsi
movq %rax, %rdi
addq $0x398, %rsi            # imm = 0x398
callq 0xaa40
movq -0x30(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, -0x40(%rbp)
movl $0x2, %edi
callq 0xb070
movq -0x40(%rbp), %rdi
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %esi
callq 0xa8b0
movq %rax, %rdi
leaq -0xc(%rbp), %rsi
callq 0xa530
movq -0x30(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, -0x38(%rbp)
movl $0x13, %edi
callq 0xb070
movq -0x38(%rbp), %rdi
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %esi
callq 0xa8b0
movq -0x30(%rbp), %rsi
movq %rax, %rdi
addq $0x3b8, %rsi            # imm = 0x3B8
callq 0xaa40
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: Neuromancer2701[P]OpenTool/src/Mid0002.cpp
// Function: Mid_0002::UnPackMid0002()
void Mid_0002::UnPackMid0002()
{
	Unpack();

	switch(Revision)
	{
		default:
		case MID_Revision::Revision1:
			 ParseRevision1();
			 break;
		case MID_Revision::Revision2:
			 ParseRevision2();
			 break;
		case MID_Revision::Revision3:
			 ParseRevision3();
			 break;
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
movq -0x18(%rbp), %rax
movl 0x320(%rax), %eax
movl %eax, -0xc(%rbp)
subl $0x1, %eax
je 0xf2c7
jmp 0xf2b1
movl -0xc(%rbp), %eax
subl $0x2, %eax
je 0xf2d2
jmp 0xf2bb
movl -0xc(%rbp), %eax
subl $0x3, %eax
je 0xf2dd
jmp 0xf2c5
jmp 0xf2c7
movq -0x18(%rbp), %rdi
callq 0xac90
jmp 0xf2e6
movq -0x18(%rbp), %rdi
callq 0xa5d0
jmp 0xf2e6
movq -0x18(%rbp), %rdi
callq 0xaa70
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: Neuromancer2701[P]OpenTool/src/Mid0004.cpp
// Function: Mid_0004::BuildMid0004()
void Mid_0004::BuildMid0004()
{
	Length += Number_Size;
	Length += Error_Size;
	Packup();

	OutputStream << std::setw(Number_Size) << std::setfill('0') << Number;
	OutputStream << std::setw(Error_Size) << std::setfill('0') << Error;
	OutputStream << '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
movl 0x318(%rdi), %eax
addl $0x4, %eax
movl %eax, 0x318(%rdi)
movl 0x318(%rdi), %eax
addl $0x2, %eax
movl %eax, 0x318(%rdi)
movq (%rdi), %rax
callq *0x10(%rax)
movq -0x20(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
addq $0x10, %rax
movq %rax, -0x40(%rbp)
movl $0x4, %edi
callq 0xb070
movq -0x40(%rbp), %rdi
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %esi
callq 0xa970
movq %rax, -0x38(%rbp)
movl $0x30, %edi
callq 0xa9d0
movq -0x38(%rbp), %rdi
movb %al, -0xd(%rbp)
movzbl -0xd(%rbp), %esi
callq 0xad00
movq %rax, %rdi
movq -0x20(%rbp), %rax
movl 0x330(%rax), %esi
callq 0xb020
movq -0x20(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
addq $0x10, %rax
movq %rax, -0x30(%rbp)
movl $0x2, %edi
callq 0xb070
movq -0x30(%rbp), %rdi
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %esi
callq 0xa970
movq %rax, -0x28(%rbp)
movl $0x30, %edi
callq 0xa9d0
movq -0x28(%rbp), %rdi
movb %al, -0x15(%rbp)
movzbl -0x15(%rbp), %esi
callq 0xad00
movq %rax, %rdi
movq -0x20(%rbp), %rax
movl 0x334(%rax), %esi
callq 0xb000
movq -0x20(%rbp), %rdi
addq $0x190, %rdi            # imm = 0x190
addq $0x10, %rdi
xorl %esi, %esi
callq 0xa990
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: Neuromancer2701[P]OpenTool/src/Mid0005.cpp
// Function: Mid_0005::BuildMid0005()
void Mid_0005::BuildMid0005()
{
	Length += Number_Size;
	Packup();

	OutputStream << std::setw(Number_Size) << std::setfill('0') << Number;
	OutputStream << '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movl 0x318(%rdi), %eax
addl $0x4, %eax
movl %eax, 0x318(%rdi)
movq (%rdi), %rax
callq *0x10(%rax)
movq -0x18(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
addq $0x10, %rax
movq %rax, -0x28(%rbp)
movl $0x4, %edi
callq 0xb070
movq -0x28(%rbp), %rdi
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %esi
callq 0xa970
movq %rax, -0x20(%rbp)
movl $0x30, %edi
callq 0xa9d0
movq -0x20(%rbp), %rdi
movb %al, -0xd(%rbp)
movzbl -0xd(%rbp), %esi
callq 0xad00
movq %rax, %rdi
movq -0x18(%rbp), %rax
movl 0x330(%rax), %esi
callq 0xb020
movq -0x18(%rbp), %rdi
addq $0x190, %rdi            # imm = 0x190
addq $0x10, %rdi
xorl %esi, %esi
callq 0xa990
addq $0x30, %rsp
popq %rbp
retq
// File: Neuromancer2701[P]OpenTool/lib/Timer/Timer.cpp
// Function: Timer::Timer(int, int, bool)
Timer::Timer(int _seconds, int _milliseconds, bool singleshot)
{
	timerSpecs.it_value.tv_sec = seconds = _seconds;
	milliseconds =_milliseconds;
	timerSpecs.it_value.tv_nsec = MILLISECONDS_TO_NANOSECONDS * milliseconds;

	if(singleshot)
	{
		timerSpecs.it_interval.tv_sec = 0;
		timerSpecs.it_interval.tv_nsec = 0;
	}
	else
	{
		timerSpecs.it_interval.tv_sec = timerSpecs.it_value.tv_sec;
		timerSpecs.it_interval.tv_nsec = timerSpecs.it_value.tv_nsec;
	}

	sigemptyset(&SignalAction.sa_mask);
	SignalAction.sa_flags = SA_SIGINFO;
	SignalAction.sa_sigaction = Timer::signal_handler;
	memset(&signalEvent, 0, sizeof(signalEvent));
	signalEvent.sigev_notify = SIGEV_SIGNAL;
	signalEvent.sigev_value.sival_ptr = (void*) this;
	signalEvent.sigev_signo = SIGALRM;


	if (timer_create(CLOCK_REALTIME, &signalEvent, &timerID)!= 0)
	{
		perror("Could not creat the timer");
	}

	if (sigaction(SIGALRM, &SignalAction, NULL))
	{
		perror("Could not install new signal handler");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %cl, %al
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq 0x85d8(%rip), %rcx      # 0x17fe0
addq $0x10, %rcx
movq %rcx, (%rax)
movl -0xc(%rbp), %ecx
movl %ecx, 0x8(%rax)
movslq %ecx, %rcx
movq %rcx, 0x180(%rax)
movl -0x10(%rbp), %ecx
movl %ecx, 0xc(%rax)
imull $0xf4240, 0xc(%rax), %ecx # imm = 0xF4240
movslq %ecx, %rcx
movq %rcx, 0x188(%rax)
testb $0x1, -0x11(%rbp)
je 0xfa58
movq -0x20(%rbp), %rax
movq $0x0, 0x170(%rax)
movq $0x0, 0x178(%rax)
jmp 0xfa78
movq -0x20(%rbp), %rax
movq 0x180(%rax), %rcx
movq %rcx, 0x170(%rax)
movq 0x188(%rax), %rcx
movq %rcx, 0x178(%rax)
movq -0x20(%rbp), %rdi
addq $0xd8, %rdi
addq $0x8, %rdi
callq 0xaa00
movq -0x20(%rbp), %rdi
movl $0x4, 0x160(%rdi)
movq 0x84d7(%rip), %rax      # 0x17f78
movq %rax, 0xd8(%rdi)
addq $0x98, %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0xa470
movq -0x20(%rbp), %rdx
movl $0x0, 0xa4(%rdx)
movq %rdx, 0x98(%rdx)
movl $0xe, 0xa0(%rdx)
movq %rdx, %rsi
addq $0x98, %rsi
addq $0x10, %rdx
xorl %edi, %edi
callq 0xa120
cmpl $0x0, %eax
je 0xfb00
leaq 0x35db(%rip), %rdi      # 0x130d6
callq 0xa720
movq -0x20(%rbp), %rsi
addq $0xd8, %rsi
movl $0xe, %edi
xorl %eax, %eax
movl %eax, %edx
callq 0xaa20
cmpl $0x0, %eax
je 0xfb2a
leaq 0x35cb(%rip), %rdi      # 0x130f0
callq 0xa720
addq $0x20, %rsp
popq %rbp
retq
// File: Neuromancer2701[P]OpenTool/lib/Timer/Timer.cpp
// Function: Timer::init(int, int, bool)
void Timer::init(int seconds, int milliseconds, bool singleshot)
{
	timerSpecs.it_value.tv_sec = seconds;
	timerSpecs.it_value.tv_nsec = MILLISECONDS_TO_NANOSECONDS * milliseconds;

	if(singleshot)
	{
		timerSpecs.it_interval.tv_sec = 0;
		timerSpecs.it_interval.tv_nsec = 0;
	}
	else
	{
		timerSpecs.it_interval.tv_sec = timerSpecs.it_value.tv_sec;
		timerSpecs.it_interval.tv_nsec = timerSpecs.it_value.tv_nsec;
	}

	sigemptyset(&SignalAction.sa_mask);
	SignalAction.sa_flags = SA_SIGINFO;
	SignalAction.sa_sigaction = Timer::signal_handler;
	memset(&signalEvent, 0, sizeof(signalEvent));
	signalEvent.sigev_notify = SIGEV_SIGNAL;
	signalEvent.sigev_value.sival_ptr = (void*) this;
	signalEvent.sigev_signo = SIGALRM;


	if (timer_create(CLOCK_REALTIME, &signalEvent, &timerID)!= 0)
	{
		perror("Could not creat the timer");
	}

	if (sigaction(SIGALRM, &SignalAction, NULL))
	{
		perror("Could not install new signal handler");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %cl, %al
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movslq -0xc(%rbp), %rcx
movq %rcx, 0x180(%rax)
imull $0xf4240, -0x10(%rbp), %ecx # imm = 0xF4240
movslq %ecx, %rcx
movq %rcx, 0x188(%rax)
testb $0x1, -0x11(%rbp)
je 0xfc1f
movq -0x20(%rbp), %rax
movq $0x0, 0x170(%rax)
movq $0x0, 0x178(%rax)
jmp 0xfc3f
movq -0x20(%rbp), %rax
movq 0x180(%rax), %rcx
movq %rcx, 0x170(%rax)
movq 0x188(%rax), %rcx
movq %rcx, 0x178(%rax)
movq -0x20(%rbp), %rdi
addq $0xd8, %rdi
addq $0x8, %rdi
callq 0xaa00
movq -0x20(%rbp), %rdi
movl $0x4, 0x160(%rdi)
movq 0x8310(%rip), %rax      # 0x17f78
movq %rax, 0xd8(%rdi)
addq $0x98, %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0xa470
movq -0x20(%rbp), %rdx
movl $0x0, 0xa4(%rdx)
movq %rdx, 0x98(%rdx)
movl $0xe, 0xa0(%rdx)
movq %rdx, %rsi
addq $0x98, %rsi
addq $0x10, %rdx
xorl %edi, %edi
callq 0xa120
cmpl $0x0, %eax
je 0xfcc7
leaq 0x3414(%rip), %rdi      # 0x130d6
callq 0xa720
movq -0x20(%rbp), %rsi
addq $0xd8, %rsi
movl $0xe, %edi
xorl %eax, %eax
movl %eax, %edx
callq 0xaa20
cmpl $0x0, %eax
je 0xfcf1
leaq 0x3404(%rip), %rdi      # 0x130f0
callq 0xa720
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: Neuromancer2701[P]OpenTool/lib/sockets/Client.cpp
// Function: Client::Client(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned short)
Client::Client(string _ip_address,unsigned short _port) {

	ip_address = _ip_address;
	port = _port;
	client_fd = -1;
	status = Connection_Status::UNKNOWN;
	retries = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rsi, -0x30(%rbp)
movw %dx, %ax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movw %ax, -0x12(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x40(%rbp)
movq 0x821e(%rip), %rax      # 0x17fc8
addq $0x10, %rax
movq %rax, (%rdi)
addq $0x18, %rdi
movq %rdi, -0x38(%rbp)
callq 0xab90
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xa050
jmp 0xfdcd
movq -0x40(%rbp), %rax
movw -0x12(%rbp), %cx
movw %cx, 0x38(%rax)
movl $0xffffffff, 0xc(%rax)  # imm = 0xFFFFFFFF
movl $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
addq $0x40, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0xa540
movq -0x20(%rbp), %rdi
callq 0xae90
nop
// File: Neuromancer2701[P]OpenTool/lib/sockets/Client.cpp
// Function: Client::Client()
Client::Client() {

	ip_address = "";
	port = 0;
	client_fd = -1;
	status = Connection_Status::UNKNOWN;
	retries = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
movq 0x819d(%rip), %rax      # 0x17fc8
addq $0x10, %rax
movq %rax, (%rdi)
addq $0x18, %rdi
movq %rdi, -0x20(%rbp)
callq 0xab90
movq -0x20(%rbp), %rdi
leaq 0x3463(%rip), %rsi      # 0x132ad
callq 0xab00
jmp 0xfe51
movq -0x28(%rbp), %rax
movw $0x0, 0x38(%rax)
movl $0xffffffff, 0xc(%rax)  # imm = 0xFFFFFFFF
movl $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
addq $0x30, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
callq 0xa540
movq -0x10(%rbp), %rdi
callq 0xae90
nopw %cs:(%rax,%rax)
// File: Neuromancer2701[P]OpenTool/lib/sockets/Client.cpp
// Function: Client::setBlockingMode(Blocking_Mode)
Error Client::setBlockingMode(Blocking_Mode mode)
{
	Error status = Error::UNKNOWN;
	int old_flags = fcntl(client_fd,F_GETFL, 0);

	if(old_flags < 0 )
	{
		perror("failed to read old flags.");
		status = Error::FCNTL_GET;
	}
	else
	{
		if(mode == Blocking_Mode::NonBlock)
		{
			old_flags |= O_NONBLOCK;
		}
		else
		{
			old_flags &= ~O_NONBLOCK;
		}

		old_flags = fcntl(client_fd,F_SETFL, old_flags);
		if(old_flags < 0 )
		{
			perror("failed to set non-block flags.");
			status = Error::FCNTL_SET;
		}
		else
		{
			status = Error::NONE;
		}
	}

	return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x10(%rbp)
movl 0xc(%rax), %edi
movl $0x3, %esi
xorl %edx, %edx
movb $0x0, %al
callq 0xa4c0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0x1013d
leaq 0x3106(%rip), %rdi      # 0x13235
callq 0xa720
movl $0x4, -0x10(%rbp)
jmp 0x10198
cmpl $0x1, -0xc(%rbp)
jne 0x10150
movl -0x14(%rbp), %eax
orl $0x800, %eax            # imm = 0x800
movl %eax, -0x14(%rbp)
jmp 0x1015b
movl -0x14(%rbp), %eax
andl $0xfffff7ff, %eax       # imm = 0xFFFFF7FF
movl %eax, -0x14(%rbp)
movq -0x20(%rbp), %rax
movl 0xc(%rax), %edi
movl -0x14(%rbp), %edx
movl $0x4, %esi
movb $0x0, %al
callq 0xa4c0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0x1018f
leaq 0x30ce(%rip), %rdi      # 0x1324f
callq 0xa720
movl $0x3, -0x10(%rbp)
jmp 0x10196
movl $0x2, -0x10(%rbp)
jmp 0x10198
movl -0x10(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: Neuromancer2701[P]OpenTool/lib/sockets/Client.cpp
// Function: Client::Disconnect()
Connection_Status Client::Disconnect()
{
	status = Connection_Status::UNKNOWN;

	    if (client_fd >= 0)
	    {
	        close(client_fd);
	        client_fd = -1;
	        status = Connection_Status::DISCONNECTED;
	    }

	return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movl $0x0, 0x8(%rax)
cmpl $0x0, 0xc(%rax)
jl 0x105cf
movq -0x10(%rbp), %rax
movl 0xc(%rax), %edi
callq 0xb030
movq -0x10(%rbp), %rax
movl $0xffffffff, 0xc(%rax)  # imm = 0xFFFFFFFF
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: Neuromancer2701[P]OpenTool/lib/sockets/Client.cpp
// Function: Client::Read(std::vector<char, std::allocator<char>>&)
Error Client::Read(vector<char>& buffer)
{
	Error status = Error::UNKNOWN;
	int read_bytes = 0;
	char read_buffer[MAX_PACKET_LENGTH];

	read_bytes = read(client_fd, read_buffer, MAX_PACKET_LENGTH);
	if(read_bytes > 0)
	{
		buffer.resize(read_bytes);
		std::copy ( read_buffer, read_buffer + read_bytes, buffer.begin() );
		status = Error::NONE;
	}
	else
	{
		perror("failed to Read.");
		status = Error::READ;
	}

	return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2750, %rsp           # imm = 0x2750
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl 0xc(%rax), %edi
leaq -0x2730(%rbp), %rsi
movl $0x2710, %edx           # imm = 0x2710
callq 0xac00
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jle 0x1088c
movq -0x10(%rbp), %rdi
movslq -0x18(%rbp), %rsi
callq 0xae40
leaq -0x2730(%rbp), %rax
movq %rax, -0x2750(%rbp)
leaq -0x2730(%rbp), %rax
movslq -0x18(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x2748(%rbp)
movq -0x10(%rbp), %rdi
callq 0xa030
movq -0x2750(%rbp), %rdi
movq -0x2748(%rbp), %rsi
movq %rax, -0x2738(%rbp)
movq -0x2738(%rbp), %rdx
callq 0xa5e0
movq %rax, -0x2740(%rbp)
movl $0x2, -0x14(%rbp)
jmp 0x1089f
leaq 0x2a1b(%rip), %rdi      # 0x132ae
callq 0xa720
movl $0x5, -0x14(%rbp)
movl -0x14(%rbp), %eax
addq $0x2750, %rsp           # imm = 0x2750
popq %rbp
retq
nopl (%rax,%rax)
// File: Neuromancer2701[P]OpenTool/lib/sockets/Client.cpp
// Function: Client::Write(std::vector<char, std::allocator<char>>)
Error Client::Write(vector<char>  buffer)
{
	Error status = Error::UNKNOWN;
	int written_bytes = 0;
	char write_buffer[MAX_PACKET_LENGTH];
	int size = 0;

	for(unsigned int i = 0; i < buffer.size(); i ++)
	{
		write_buffer[i] = buffer[i];
	}

	written_bytes = write(client_fd, write_buffer, size);

	if(written_bytes > 0)
	{
		status = Error::NONE;
	}
	else
	{
		perror("failed to Write.");
		status = Error::WRITE;
	}

	return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2750, %rsp           # imm = 0x2750
movq %rsi, -0x2748(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x2740(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x2734(%rbp)
movl $0x0, -0x2738(%rbp)
movq -0x2748(%rbp), %rdi
movl -0x2738(%rbp), %eax
movq %rax, -0x2750(%rbp)
callq 0xa140
movq %rax, %rcx
movq -0x2750(%rbp), %rax
cmpq %rcx, %rax
jae 0x10953
movq -0x2748(%rbp), %rdi
movl -0x2738(%rbp), %eax
movl %eax, %esi
callq 0xa980
movb (%rax), %cl
movl -0x2738(%rbp), %eax
movb %cl, -0x2730(%rbp,%rax)
movl -0x2738(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2738(%rbp)
jmp 0x108f7
movq -0x2740(%rbp), %rax
movl 0xc(%rax), %edi
leaq -0x2730(%rbp), %rsi
movslq -0x2734(%rbp), %rdx
callq 0xa2e0
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jle 0x10982
movl $0x2, -0x14(%rbp)
jmp 0x10995
leaq 0x2935(%rip), %rdi      # 0x132be
callq 0xa720
movl $0x6, -0x14(%rbp)
movl -0x14(%rbp), %eax
addq $0x2750, %rsp           # imm = 0x2750
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: Neuromancer2701[P]OpenTool/lib/sockets/Server.cpp
// Function: Server::setBlockingMode(Blocking_Mode)
Error Server::setBlockingMode(Blocking_Mode mode)
{
	error_state = Error::UNKNOWN;
	int old_flags = fcntl(server_fd,F_GETFL, 0);

	if(old_flags < 0 )
	{
		perror("failed to read old flags.");
		error_state = Error::FCNTL_GET;
	}
	else
	{
		if(mode == Blocking_Mode::NonBlock)
		{
			old_flags |= O_NONBLOCK;
		}
		else
		{
			old_flags &= ~O_NONBLOCK;
		}

		old_flags = fcntl(server_fd,F_SETFL, old_flags);
		if(old_flags < 0 )
		{
			perror("failed to set non-block flags.");
			error_state = Error::FCNTL_SET;
		}
		else
		{
			error_state = Error::NONE;
		}
	}

	return error_state;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, 0x1b4(%rax)
movl 0x1a8(%rax), %edi
movl $0x3, %esi
xorl %edx, %edx
movb $0x0, %al
callq 0xa4c0
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jge 0x118ea
leaq 0x1960(%rip), %rdi      # 0x13235
callq 0xa720
movq -0x18(%rbp), %rax
movl $0x4, 0x1b4(%rax)
jmp 0x11956
cmpl $0x1, -0xc(%rbp)
jne 0x118fd
movl -0x10(%rbp), %eax
orl $0x800, %eax            # imm = 0x800
movl %eax, -0x10(%rbp)
jmp 0x11908
movl -0x10(%rbp), %eax
andl $0xfffff7ff, %eax       # imm = 0xFFFFF7FF
movl %eax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movl 0x1a8(%rax), %edi
movl -0x10(%rbp), %edx
movl $0x4, %esi
movb $0x0, %al
callq 0xa4c0
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jge 0x11946
leaq 0x191e(%rip), %rdi      # 0x1324f
callq 0xa720
movq -0x18(%rbp), %rax
movl $0x3, 0x1b4(%rax)
jmp 0x11954
movq -0x18(%rbp), %rax
movl $0x2, 0x1b4(%rax)
jmp 0x11956
movq -0x18(%rbp), %rax
movl 0x1b4(%rax), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: Neuromancer2701[P]OpenTool/lib/sockets/Server.cpp
// Function: Server::~Server()
Server::~Server() {

	if(server_fd > 0)
		close(server_fd);

	for(int i = 0;i < MAX_CONNECTIONS; i++)
	{
		client_list[i].Disconnect();
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq 0x6615(%rip), %rcx      # 0x17fa0
addq $0x10, %rcx
movq %rcx, (%rax)
cmpl $0x0, 0x1a8(%rax)
jle 0x119ae
movq -0x18(%rbp), %rax
movl 0x1a8(%rax), %edi
callq 0xb030
jmp 0x119ac
jmp 0x119ae
movl $0x0, -0xc(%rbp)
cmpl $0x6, -0xc(%rbp)
jge 0x119e3
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
movslq -0xc(%rbp), %rsi
callq 0xaac0
movq %rax, %rdi
callq 0xaf60
jmp 0x119d6
jmp 0x119d8
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x119b5
movq -0x18(%rbp), %rdi
addq $0x288, %rdi            # imm = 0x288
callq 0xae00
movq -0x18(%rbp), %rdi
addq $0x190, %rdi            # imm = 0x190
callq 0xa690
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
callq 0xa1c0
addq $0x20, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0xd050
nop
// File: Neuromancer2701[P]OpenTool/lib/sockets/Server.cpp
// Function: Server::AddClientToEvent(Client)
Error Server::AddClientToEvent(Client client)
{
	error_state = Error::UNKNOWN;
	int epoll_status;
	struct epoll_event event;

	event.data.fd = client.get_fd();
	event.events = EPOLLIN | EPOLLET | EPOLLRDHUP;

	epoll_status = epoll_ctl(event_fd, EPOLL_CTL_ADD, event.data.fd, &event);

	if (epoll_status == -1)
	{
		perror ("epoll_create");
		error_state = Error::EPOLL_CTL;
	}
	else
	{
		error_state = Error::NONE;
	}

	return error_state;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rsi, -0x30(%rbp)
movq %rdi, %rax
movq -0x30(%rbp), %rdi
movq %rax, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x0, 0x1b4(%rax)
callq 0xa180
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, -0x1c(%rbp)
movl $0x80002001, -0x20(%rbp) # imm = 0x80002001
movl 0x1b8(%rax), %edi
movl -0x1c(%rbp), %edx
movl $0x1, %esi
leaq -0x20(%rbp), %rcx
callq 0xab60
movl %eax, -0x14(%rbp)
cmpl $-0x1, -0x14(%rbp)
jne 0x11e2e
leaq 0x1455(%rip), %rdi      # 0x1326e
callq 0xa720
movq -0x28(%rbp), %rax
movl $0xc, 0x1b4(%rax)
jmp 0x11e3c
movq -0x28(%rbp), %rax
movl $0x2, 0x1b4(%rax)
movq -0x28(%rbp), %rax
movl 0x1b4(%rax), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: Neuromancer2701[P]OpenTool/lib/sockets/Server.cpp
// Function: Server::isClient(int, Client&)
bool Server::isClient(int fd, Client& client)
{
	bool found = false;
	for(auto local:client_list)
	{
		if(local.get_fd() == fd)
		{
			client = local;
			found = true;
		}
	}

	return found;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movb $0x0, -0x19(%rbp)
addq $0x10, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xa850
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0xaa10
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x38(%rbp), %rax
je 0x11f16
movq -0x30(%rbp), %rsi
leaq -0x78(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0xa0b0
movq -0x90(%rbp), %rdi
callq 0xa180
movl %eax, -0x88(%rbp)
jmp 0x11ec2
movl -0x88(%rbp), %eax
cmpl -0xc(%rbp), %eax
jne 0x11efc
movq -0x18(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0xa260
jmp 0x11edc
movb $0x1, -0x19(%rbp)
jmp 0x11efc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x78(%rbp), %rdi
callq 0xa170
jmp 0x11f24
leaq -0x78(%rbp), %rdi
callq 0xa170
movq -0x30(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x30(%rbp)
jmp 0x11e90
movb -0x19(%rbp), %al
andb $0x1, %al
addq $0x90, %rsp
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0xae90
nopl (%rax)
// File: iZhangHui[P]CppPrimer/CH13_CopyControl/examples/HasPtrValueLike.cc
// Function: HasPtr::operator=(HasPtr const&)
HasPtr& HasPtr::operator=(const HasPtr& rhs)
{
	auto newp = new string(*rhs.ps);  // copy the underlying string
	delete ps;       // free the old memory
	ps = newp;       // copy data from rhs into this object
	i = rhs.i;
	return *this;    // return this object
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x20, %edi
callq 0x1050
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x1030
jmp 0x11ea
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rcx, -0x18(%rbp)
movq (%rax), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
je 0x121a
movq -0x40(%rbp), %rdi
callq 0x1040
movq -0x40(%rbp), %rdi
movl $0x20, %esi
callq 0x1060
movq -0x38(%rbp), %rax
movq -0x18(%rbp), %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl %ecx, 0x8(%rax)
addq $0x40, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x20, %esi
callq 0x1060
movq -0x20(%rbp), %rdi
callq 0x1090
nopl (%rax,%rax)
// File: renzibei[P]TSProxy/proxyclient.cpp
// Function: sendMessage(int, unsigned char const*, unsigned long, ClientContext*, int)
ssize_t sendMessage(int sockFd, const uint8_t *src, size_t nbyte, ClientContext *ctx, int msgType = 4) {
    static InnerMsg innerMsg;
    memset(&innerMsg, 0, sizeof(innerMsg));
    ctx->cSeq++;
    innerMsg.cSeq = ctx->cSeq;
    innerMsg.sSeq = ctx->sSeq;
    innerMsg.msgType = msgType;
    if (nbyte > sizeof(innerMsg.data)) {
        LogHelper::log(Error, "Failed to send data, nbyte too large, nbyte: %lu", nbyte);
        return -1;
    }
    innerMsg.dataLength = nbyte;
    memcpy(innerMsg.data, src, nbyte);
    ssize_t sendCode = sendTSPacket(sockFd, &innerMsg, constants::serverNonBlocking);
    if (sendCode < 0) {
        LogHelper::log(Error, "Fail to send data");
        return sendCode;
    }
    return 0;
}

// Assembly:
subq $0x38, %rsp
movl %edi, 0x2c(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movl %r8d, 0xc(%rsp)
leaq 0x1e49d(%rip), %rdi     # 0x21270
xorl %esi, %esi
movl $0x10000, %edx          # imm = 0x10000
callq 0x2150
movq 0x10(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x1e473(%rip)     # 0x21270
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x1e46b(%rip)     # 0x21278
movl 0xc(%rsp), %eax
movw %ax, 0x1e468(%rip)      # 0x21280
cmpq $0xffec, 0x18(%rsp)     # imm = 0xFFEC
jbe 0x2e43
movq 0x18(%rsp), %rdx
xorl %edi, %edi
leaq 0x8310(%rip), %rsi      # 0xb141
movb $0x0, %al
callq 0x2a50
movq $-0x1, 0x30(%rsp)
jmp 0x2ead
movq 0x18(%rsp), %rax
movw %ax, 0x1e433(%rip)      # 0x21282
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq 0x1e410(%rip), %rdi     # 0x21270
addq $0x14, %rdi
callq 0x21c0
movl 0x2c(%rsp), %edi
leaq 0x1e3fc(%rip), %rsi     # 0x21270
movl $0x1, %edx
callq 0x8820
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
jge 0x2ea4
xorl %edi, %edi
leaq 0x82e0(%rip), %rsi      # 0xb172
movb $0x0, %al
callq 0x2a50
movq (%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x2ead
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopw (%rax,%rax)
// File: renzibei[P]TSProxy/proxyclient.cpp
// Function: sendRequestMsg(int, int, unsigned char const*, unsigned long, ClientContext*)
ssize_t sendRequestMsg(int serverFd, int localFd, const uint8_t *src, size_t nbyte, ClientContext *ctx) {
    static uint8_t msgBuffer[constants::AES_MAX_DATA_LENGTH];
    memset(msgBuffer, 0, sizeof(msgBuffer));
    hton_copy4bytes(msgBuffer, &localFd);
    if (sizeof(msgBuffer) < nbyte + 4) {
        LogHelper::log(Warn, "Failed to send request msg, nbyte greater than buffersize + 4");
        return -1;
    }
    memcpy(msgBuffer + 4, src, nbyte);
    ssize_t sendCode = sendMessage(serverFd, msgBuffer, nbyte + 4, ctx, 8);
    if (sendCode < 0) {
        LogHelper::log(Error, "Failed to send request msg");
        return sendCode;
    }
    return 0;
}

// Assembly:
subq $0x38, %rsp
movl %edi, 0x2c(%rsp)
movl %esi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movq %r8, 0x10(%rsp)
leaq 0x2e38e(%rip), %rdi     # 0x31270
xorl %esi, %esi
movl $0xffcc, %edx           # imm = 0xFFCC
callq 0x2150
movl 0x28(%rsp), %edi
callq 0x21a0
movl %eax, 0x2e373(%rip)     # 0x31270
movq 0x18(%rsp), %rcx
addq $0x4, %rcx
movl $0xffcc, %eax           # imm = 0xFFCC
cmpq %rcx, %rax
jae 0x2f2e
movl $0x1, %edi
leaq 0x8268(%rip), %rsi      # 0xb184
movb $0x0, %al
callq 0x2a50
movq $-0x1, 0x30(%rsp)
jmp 0x2f9e
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq 0x2e331(%rip), %rdi     # 0x31270
addq $0x4, %rdi
callq 0x21c0
movl 0x2c(%rsp), %edi
movq 0x18(%rsp), %rdx
addq $0x4, %rdx
movq 0x10(%rsp), %rcx
leaq 0x2e30f(%rip), %rsi     # 0x31270
movl $0x8, %r8d
callq 0x2db0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jge 0x2f95
xorl %edi, %edi
leaq 0x8240(%rip), %rsi      # 0xb1c2
movb $0x0, %al
callq 0x2a50
movq 0x8(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x2f9e
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: renzibei[P]TSProxy/proxyclient.cpp
// Function: recvReplyMsg(int, unsigned char*, unsigned long, ClientContext*, int*)
int recvReplyMsg(int serverFd, uint8_t *dst, size_t bufferSize, ClientContext *ctx, int *localFdPtr) {
    static uint8_t msgBuffer[constants::MAX_MSG_DATA_LENGTH];
    memset(msgBuffer, 0, sizeof(msgBuffer));
    uint8_t msgType = 0;
    ssize_t recvCode = recvMessage(serverFd, msgBuffer, sizeof(msgBuffer), ctx, &msgType);
    if (msgType != 9) {
        LogHelper::log(Error, "Failed in reply msg, error msg type, get :%d, expected: %d", msgType, 9);
        return -3;
    }
    if (recvCode < 0) {
        LogHelper::log(Error, "Failed to recv reply msg");
        return recvCode;
    }
    if (recvCode > bufferSize + 4) {
        LogHelper::log(Error, "buffer size less than recv msg len + 4, buffersize: %d, msgLen: %d", bufferSize, recvCode);
        return -1;
    }
    if (recvCode < 4) {
        LogHelper::log(Error, "recv msg len less than 4, recv len: %d", recvCode);
        return -2;
    }
    int localFd = 0;
    ntoh_copy4bytes(&localFd, msgBuffer);
    memcpy(dst, msgBuffer + 4, recvCode - 4);
    assert(localFdPtr != NULL);
    *localFdPtr = localFd;
    return recvCode - 4;
}

// Assembly:
subq $0x48, %rsp
movl %edi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq %r8, 0x20(%rsp)
leaq 0x4e0cd(%rip), %rdi     # 0x51240
xorl %esi, %esi
movl $0xffec, %edx           # imm = 0xFFEC
callq 0x2150
movb $0x0, 0x1f(%rsp)
movl 0x40(%rsp), %edi
movq 0x28(%rsp), %rcx
leaq 0x4e0ac(%rip), %rsi     # 0x51240
movl $0xffec, %edx           # imm = 0xFFEC
leaq 0x1f(%rsp), %r8
callq 0x2fb0
movq %rax, 0x10(%rsp)
movzbl 0x1f(%rsp), %eax
cmpl $0x9, %eax
je 0x31d9
movzbl 0x1f(%rsp), %edx
xorl %edi, %edi
leaq 0x80e2(%rip), %rsi      # 0xb2a2
movl $0x9, %ecx
movb $0x0, %al
callq 0x2a50
movl $0xfffffffd, 0x44(%rsp) # imm = 0xFFFFFFFD
jmp 0x32d6
cmpq $0x0, 0x10(%rsp)
jge 0x31ff
xorl %edi, %edi
leaq 0x80f3(%rip), %rsi      # 0xb2dd
movb $0x0, %al
callq 0x2a50
movq 0x10(%rsp), %rax
movl %eax, 0x44(%rsp)
jmp 0x32d6
movq 0x10(%rsp), %rax
movq 0x30(%rsp), %rcx
addq $0x4, %rcx
cmpq %rcx, %rax
jbe 0x3239
movq 0x30(%rsp), %rdx
movq 0x10(%rsp), %rcx
xorl %edi, %edi
leaq 0x80d1(%rip), %rsi      # 0xb2f6
movb $0x0, %al
callq 0x2a50
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x32d6
cmpq $0x4, 0x10(%rsp)
jge 0x3260
movq 0x10(%rsp), %rdx
xorl %edi, %edi
leaq 0x80ea(%rip), %rsi      # 0xb339
movb $0x0, %al
callq 0x2a50
movl $0xfffffffe, 0x44(%rsp) # imm = 0xFFFFFFFE
jmp 0x32d6
movl $0x0, 0xc(%rsp)
movl 0x4dfd2(%rip), %edi     # 0x51240
callq 0x22a0
movl %eax, 0xc(%rsp)
movq 0x38(%rsp), %rdi
movq 0x10(%rsp), %rdx
subq $0x4, %rdx
leaq 0x4dfb4(%rip), %rsi     # 0x51240
addq $0x4, %rsi
callq 0x21c0
cmpq $0x0, 0x20(%rsp)
je 0x329f
jmp 0x32be
leaq 0x80ba(%rip), %rdi      # 0xb360
leaq 0x80c6(%rip), %rsi      # 0xb373
movl $0xac, %edx
leaq 0x80ca(%rip), %rcx      # 0xb383
callq 0x2170
movl 0xc(%rsp), %ecx
movq 0x20(%rsp), %rax
movl %ecx, (%rax)
movq 0x10(%rsp), %rax
subq $0x4, %rax
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nop
// File: renzibei[P]TSProxy/proxyclient.cpp
// Function: loopSend(int, ClientContext*)
void loopSend(int sockFd, ClientContext *ctx) {
    static char sendBuf[] = "Hello Server!";
    while (true) {
        ssize_t sendCode = sendMessage(sockFd, (const uint8_t *)sendBuf, sizeof(sendBuf), ctx);
        if (sendCode < 0) {
            LogHelper::log(Error, "Fail to send msg to Server, break");
            break;
        }
        LogHelper::log(Debug, "Send hello to server");
        std::this_thread::sleep_for(std::chrono::milliseconds(10));
    }
}

// Assembly:
subq $0x28, %rsp
movl %edi, 0x24(%rsp)
movq %rsi, 0x18(%rsp)
movl 0x24(%rsp), %edi
movq 0x18(%rsp), %rcx
leaq 0xdf0b(%rip), %rsi      # 0x11208
movl $0xe, %edx
movl $0x4, %r8d
callq 0x2db0
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jge 0x332c
xorl %edi, %edi
leaq 0x80a1(%rip), %rsi      # 0xb3c4
movb $0x0, %al
callq 0x2a50
jmp 0x3362
movl $0x3, %edi
leaq 0x80ae(%rip), %rsi      # 0xb3e6
movb $0x0, %al
callq 0x2a50
movl $0xa, 0x4(%rsp)
leaq 0x8(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x4ec0
leaq 0x8(%rsp), %rdi
callq 0x4df0
jmp 0x32ed
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: renzibei[P]TSProxy/proxyclient.cpp
// Function: loopRead(int, ClientContext*)
void loopRead(int sockFd, ClientContext *ctx) {
    static char buf[65536];
    while (true) {
        memset(buf, 0, sizeof(buf));
        ssize_t recvCode = recvMessage(sockFd, (uint8_t *)buf, sizeof(buf), ctx, NULL);
        if (recvCode < 0) {
            LogHelper::log(Error, "Fail to recv msg from server, break");
            break;
        }
        LogHelper::log(Debug, "recv msg from server: %s", buf);
        // std::this_thread::sleep_for(std::chrono::milliseconds(500));
    }
}

// Assembly:
subq $0x18, %rsp
movl %edi, 0x14(%rsp)
movq %rsi, 0x8(%rsp)
leaq 0x5deac(%rip), %rdi     # 0x61230
xorl %esi, %esi
movl $0x10000, %edx          # imm = 0x10000
callq 0x2150
movl 0x14(%rsp), %edi
movq 0x8(%rsp), %rcx
leaq 0x5de90(%rip), %rsi     # 0x61230
movl $0x10000, %edx          # imm = 0x10000
xorl %eax, %eax
movl %eax, %r8d
callq 0x2fb0
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
jge 0x33cc
xorl %edi, %edi
leaq 0x8038(%rip), %rsi      # 0xb3fb
movb $0x0, %al
callq 0x2a50
jmp 0x33e8
movl $0x3, %edi
leaq 0x8047(%rip), %rsi      # 0xb41f
leaq 0x5de51(%rip), %rdx     # 0x61230
movb $0x0, %al
callq 0x2a50
jmp 0x337d
addq $0x18, %rsp
retq
nopl (%rax)
// File: renzibei[P]TSProxy/proxyclient.cpp
// Function: launch_client()
int launch_client() {

    // ignore signal
    signal(SIGPIPE, SIG_IGN);
    const char tempBuf[] = "Hello, test!";
    while (true) {
        ClientContext context;
        if (SocketPlugin::getInstance()->connectSocket(serverAddrStr.c_str(),  serverListenPort, constants::clientNonBlocking) < 0 ) {
            LogHelper::log(Error, "Client Fail to connect to server");
            std::this_thread::sleep_for(std::chrono::milliseconds(200));
            break;
        }
        ssize_t shakeCode = clientHandleShake(&context);
        if (shakeCode < 0) {
            return shakeCode;
        }
        
        LogHelper::log(Debug, "Hand shake success");
        int sockFd = SocketPlugin::getInstance()->getSockFd();
        // std::thread readThread(loopRead, sockFd, &context), writeThread(loopSend, sockFd, &context);
        // readThread.join();
        // writeThread.join();
        std::thread listenThread(startListen, sockFd, &context);
        listenThread.join();

        SocketPlugin::getInstance()->closeSocket();
        // break;
        std::this_thread::sleep_for(std::chrono::milliseconds(20));
    }
    return 0;
}

// Assembly:
subq $0x98, %rsp
movl $0xd, %edi
movl $0x1, %esi
callq 0x2280
movq 0x6ffb(%rip), %rax      # 0xbad8
movq %rax, 0x87(%rsp)
movl 0x6ff5(%rip), %eax      # 0xbae0
movl %eax, 0x8f(%rsp)
movb 0x6fec(%rip), %al       # 0xbae4
movb %al, 0x93(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x5000
callq 0x4d10
movq %rax, 0x18(%rsp)
leaq 0xc716(%rip), %rdi      # 0x11230
callq 0x2120
movq 0x18(%rsp), %rdi
movq %rax, %rsi
movl $0x1bb, %edx            # imm = 0x1BB
movl $0x1, %ecx
callq 0x7800
cmpl $0x0, %eax
jge 0x4b71
xorl %edi, %edi
leaq 0x6fa1(%rip), %rsi      # 0xbae5
movb $0x0, %al
callq 0x2a50
movl $0xc8, 0x64(%rsp)
leaq 0x68(%rsp), %rdi
leaq 0x64(%rsp), %rsi
callq 0x4ec0
leaq 0x68(%rsp), %rdi
callq 0x4df0
jmp 0x4c59
leaq 0x70(%rsp), %rdi
callq 0x2ba0
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x58(%rsp)
jge 0x4b99
movq 0x58(%rsp), %rax
movl %eax, 0x94(%rsp)
jmp 0x4c64
leaq 0x6f66(%rip), %rsi      # 0xbb06
xorl %eax, %eax
movl $0x3, %edi
callq 0x2a50
callq 0x4d10
movq %rax, %rdi
callq 0x78e0
movl %eax, 0x54(%rsp)
leaq 0x70(%rsp), %rax
movq %rax, 0x40(%rsp)
leaq -0xc1e(%rip), %rsi      # 0x3fb0
leaq 0x48(%rsp), %rdi
movq %rdi, 0x10(%rsp)
leaq 0x54(%rsp), %rdx
leaq 0x40(%rsp), %rcx
callq 0x5020
movq 0x10(%rsp), %rdi
callq 0x2390
jmp 0x4bf3
callq 0x4d10
movq %rax, 0x8(%rsp)
jmp 0x4bff
movq 0x8(%rsp), %rdi
callq 0x7880
jmp 0x4c0b
movl $0x14, 0x24(%rsp)
leaq 0x28(%rsp), %rdi
leaq 0x24(%rsp), %rsi
callq 0x4ec0
jmp 0x4c24
leaq 0x28(%rsp), %rdi
callq 0x4df0
jmp 0x4c30
leaq 0x48(%rsp), %rdi
callq 0x50f0
jmp 0x4aff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x50f0
jmp 0x4c73
movl $0x0, 0x94(%rsp)
movl 0x94(%rsp), %eax
addq $0x98, %rsp
retq
movq 0x38(%rsp), %rdi
callq 0x23a0
nopl (%rax)
// File: renzibei[P]TSProxy/./Singleton.h
// Function: Singleton<SocketPlugin>::getInstance()
static T* getInstance() {
        if(_instance == nullptr) {
            std::lock_guard<std::mutex> lockGuard(singleMutex);
            if(_instance == nullptr)
                _instance = new T();
        }
        return _instance;
    }

// Assembly:
subq $0x28, %rsp
cmpq $0x0, 0x8c7bc(%rip)     # 0x914d8
jne 0x4daa
leaq 0x20(%rsp), %rdi
leaq 0x8c7b2(%rip), %rsi     # 0x914e0
callq 0x5810
cmpq $0x0, 0x8c79d(%rip)     # 0x914d8
jne 0x4d92
movl $0x10, %edi
callq 0x2240
movq %rax, 0x8(%rsp)
jmp 0x4d4e
movq 0x8(%rsp), %rdi
callq 0x5840
jmp 0x4d5a
movq 0x8(%rsp), %rax
movq %rax, 0x8c772(%rip)     # 0x914d8
jmp 0x4d92
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x18(%rsp)
movl %eax, 0x14(%rsp)
jmp 0x4d9e
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x18(%rsp)
movl %eax, 0x14(%rsp)
callq 0x2210
jmp 0x4d9e
leaq 0x20(%rsp), %rdi
callq 0x5870
jmp 0x4daa
leaq 0x20(%rsp), %rdi
callq 0x5870
jmp 0x4db6
movq 0x8c727(%rip), %rax     # 0x914d8
addq $0x28, %rsp
retq
movq 0x18(%rsp), %rdi
callq 0x23a0
// File: renzibei[P]TSProxy/SocketPlugin.cpp
// Function: SocketPlugin::closeSocket()
int SocketPlugin::closeSocket() {

    int ret = close(this->m_sockfd);
    if(ret == -1) {
        LogHelper::log(Error, "close socket failed", strerror(errno));
    }
    LogHelper::log(Info, "close socket");
    return ret;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movl 0x8(%rax), %edi
callq 0x23e0
movl %eax, 0xc(%rsp)
cmpl $-0x1, 0xc(%rsp)
jne 0x78c0
callq 0x2040
movl (%rax), %edi
callq 0x20f0
movq %rax, %rdx
xorl %edi, %edi
leaq 0x42f9(%rip), %rsi      # 0xbbb2
movb $0x0, %al
callq 0x2a50
movl $0x2, %edi
leaq 0x42fa(%rip), %rsi      # 0xbbc6
movb $0x0, %al
callq 0x2a50
movl 0xc(%rsp), %eax
addq $0x18, %rsp
retq
nopl (%rax)