LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/nmmmnu[P]HM3/net/asyncloop_impl.h
// Function: net::AsyncLoop<net::selector::PollSelector, net::worker::KeyValueWorker<net::protocol::RedisProtocol, KeyValueMockAdapter>>::handleWrite_(int)
void AsyncLoop<SELECTOR, WORKER>::handleWrite_(int const fd){
	if ( isServerFD_(fd) ){
		// WTF?!?
		return;
	}

	// -------------------------------------

	auto it = clients_.find(fd);

	if (it == clients_.end())
		return handleDisconnect_(fd, DisconnectStatus::PROBLEM_MAP_NOT_FOUND);

	ClientBuffer &buffer = it->second;

	// -------------------------------------

	auto available = buffer.size();

	if (available <= 0){
		// this must never happen, disconnect.
		return handleDisconnect_(fd, DisconnectStatus::PROBLEM_BUFFER_WRITE);
	}

	ssize_t const size = ::write(fd, buffer.data(), available);

	// -------------------------------------

	if (size <= 0)
		return handleSocketOps_(fd, size);

	buffer.pop(size);

	buffer.restartTimer();

	if (buffer.size() == 0){
		// process with read
		selector_.updateFD(fd, selector::FDEvent::READ);

		return;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0xc(%rsp), %rdx
movl %esi, (%rdx)
movq 0x38(%rdi), %rdi
movq 0x40(%r14), %rsi
callq 0x2f07
cmpq 0x40(%r14), %rax
jne 0x2d2f
movslq %ebx, %rax
movq 0x50(%r14), %rsi
movq 0x58(%r14), %rdi
xorl %r9d, %r9d
xorl %edx, %edx
divq %rdi
movq (%rsi,%rdx,8), %rax
testq %rax, %rax
je 0x2cf5
movq (%rax), %r8
movq %rax, %r9
cmpl %ebx, 0x8(%r8)
je 0x2cf5
movq %rdx, %rcx
movq %r8, %r10
movq (%r8), %r8
testq %r8, %r8
je 0x2cf2
movslq 0x8(%r8), %rsi
movq %rsi, %rax
xorl %edx, %edx
divq %rdi
movl $0x0, %r9d
cmpq %rcx, %rdx
jne 0x2cf5
movq %r10, %r9
cmpl %ebx, %esi
jne 0x2cc7
jmp 0x2cf5
xorl %r9d, %r9d
testq %r9, %r9
je 0x2cff
movq (%r9), %r15
jmp 0x2d02
xorl %r15d, %r15d
testq %r15, %r15
je 0x2d20
movq 0x10(%r15), %rsi
movq 0x20(%r15), %rdx
subq %rsi, %rdx
jne 0x2d39
movq %r14, %rdi
movl %ebx, %esi
movl $0x7, %edx
jmp 0x2d2a
movq %r14, %rdi
movl %ebx, %esi
movl $0x5, %edx
callq 0x2da6
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
addq 0x18(%r15), %rsi
movl %ebx, %edi
callq 0x20b0
testq %rax, %rax
jle 0x2d6e
movq 0x10(%r15), %rcx
movq 0x20(%r15), %rdx
subq %rcx, %rdx
cmpq %rax, %rdx
jb 0x2d84
jne 0x2d7d
movq $0x0, 0x20(%r15)
movq 0x18(%r15), %rax
movb $0x0, (%rax)
xorl %ecx, %ecx
jmp 0x2d80
movq %r14, %rdi
movl %ebx, %esi
movq %rax, %rdx
callq 0x2e56
jmp 0x2d2f
addq %rax, %rcx
movq %rcx, 0x10(%r15)
callq 0x46dc
movl %eax, 0x38(%r15)
movq 0x20(%r15), %rax
cmpq 0x10(%r15), %rax
jne 0x2d2f
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x4068
jmp 0x2d2f
nop
// File: /workspace/github_cpp_makefile_star2_O1/nmmmnu[P]HM3/net/asyncloop_impl.h
// Function: net::AsyncLoop<net::selector::PollSelector, net::worker::KeyValueWorker<net::protocol::RedisProtocol, KeyValueMockAdapter>>::handleDisconnect_(int, net::AsyncLoop<net::selector::PollSelector, net::worker::KeyValueWorker<net::protocol::RedisProtocol, KeyValueMockAdapter>>::DisconnectStatus)
void AsyncLoop<SELECTOR, WORKER>::handleDisconnect_(int const fd, const DisconnectStatus error){
	removeFD_(fd);

	socket_close(fd);

	switch(error){
	case DisconnectStatus::NORMAL			: return log_("Normal  Disconnect",				fd);
	case DisconnectStatus::ERROR			: return log_("Error   Disconnect",				fd);
	case DisconnectStatus::TIMEOUT			: return log_("Timeout Disconnect",				fd);

	case DisconnectStatus::WORKER_NORMAL		: return log_("Worker  Disconnect - Normal",			fd);
	case DisconnectStatus::WORKER_ERROR		: return log_("Worker  Disconnect - Error",			fd);

	case DisconnectStatus::PROBLEM_MAP_NOT_FOUND	: return log_("Problem Disconnect - FD not found",		fd);
	case DisconnectStatus::PROBLEM_BUFFER_READ	: return log_("Problem Disconnect - Read buffer full",		fd);
	case DisconnectStatus::PROBLEM_BUFFER_WRITE	: return log_("Problem Disconnect - Write buffer problem",	fd);
	};
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x4(%rsp), %r15
movl %esi, (%r15)
callq 0x40ac
leaq 0x50(%r14), %rdi
movq %r15, %rsi
callq 0x3bba
decl 0x88(%r14)
movl %ebx, %edi
callq 0x4849
cmpl $0x7, %ebp
ja 0x2dfa
movl %ebp, %eax
leaq 0x2543(%rip), %rcx      # 0x532c
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
movq %r14, %rdi
movl %ebx, %edx
callq 0x2ab8
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/nmmmnu[P]HM3/net/asyncloop_impl.h
// Function: net::AsyncLoop<net::selector::PollSelector, net::worker::KeyValueWorker<net::protocol::RedisProtocol, KeyValueMockAdapter>>::handleConnect_(int)
bool AsyncLoop<SELECTOR, WORKER>::handleConnect_(int const fd){
	// fd is same as serverFD_
	int const newFD = socket_accept(fd);

	// serverFD_ is non blocking, so we do not need to check EAGAIN
	if (newFD < 0)
		return false;

	if ( insertFD_(newFD) ){
		// socket_makeNonBlocking(newFD);

		log_("Connect", newFD);
	}else{
		socket_close(newFD);

		log_("Drop connect", newFD);
	}

	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl %esi, %edi
callq 0x4879
movl %eax, %ebx
testl %eax, %eax
js 0x2e49
movq %r14, %rdi
movl %ebx, %esi
callq 0x2fa0
testb %al, %al
je 0x2e31
leaq 0x22b2(%rip), %rsi      # 0x50e1
jmp 0x2e3f
movl %ebx, %edi
callq 0x4849
leaq 0x22aa(%rip), %rsi      # 0x50e9
movq %r14, %rdi
movl %ebx, %edx
callq 0x2ab8
testl %ebx, %ebx
setns %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/nmmmnu[P]HM3/net/asyncloop_impl.h
// Function: net::AsyncLoop<net::selector::PollSelector, net::worker::KeyValueWorker<net::protocol::RedisProtocol, KeyValueMockAdapter>>::handleSocketOps_(int, long)
void AsyncLoop<SELECTOR, WORKER>::handleSocketOps_(int const fd, ssize_t const size){
	if (size < 0){
		if ( socket_check_eagain() ){
			// try again
			return;
		}else{
			// error, disconnect.
			return handleDisconnect_(fd, DisconnectStatus::ERROR);
		}
	}

	if (size == 0){
		// normal, disconnect.
		return handleDisconnect_(fd, DisconnectStatus::NORMAL);
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
testq %rdx, %rdx
js 0x2e6a
jne 0x2e78
xorl %ebp, %ebp
jmp 0x2e7d
movl $0x1, %ebp
callq 0x4798
testb %al, %al
je 0x2e7d
popq %rbx
popq %r14
popq %rbp
retq
movq %r14, %rdi
movl %ebx, %esi
movl %ebp, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x2da6
nop
// File: /workspace/github_cpp_makefile_star2_O1/nmmmnu[P]HM3/net/asyncloop_impl.h
// Function: net::AsyncLoop<net::selector::PollSelector, net::worker::KeyValueWorker<net::protocol::RedisProtocol, KeyValueMockAdapter>>::handleWorker_(int, net::ClientBuffer&)
bool AsyncLoop<SELECTOR, WORKER>::handleWorker_(int const fd, ClientBuffer &buffer){
//	static const char *redis_ok  = "$2\r\nOK\r\n";
//	static const char *redis_err = "-ERR Error\r\n";

	const WorkerStatus status = worker_( buffer );

	switch( status ){
	case WorkerStatus::PASS:
		return false;

	case WorkerStatus::READ:
		selector_.updateFD(fd, selector::FDEvent::READ);

		return true;

	case WorkerStatus::WRITE:
		selector_.updateFD(fd, selector::FDEvent::WRITE);

		return true;

	case WorkerStatus::DISCONNECT:
		handleDisconnect_(fd, DisconnectStatus::WORKER_NORMAL);

		return true;

	case WorkerStatus::SHUTDOWN:
	//	handleDisconnect_(fd, DisconnectStatus::WORKER_NORMAL);
		keepProcessing_ = false;

		return true;

	default:
	case WorkerStatus::DISCONNECT_ERROR:
		handleDisconnect_(fd, DisconnectStatus::WORKER_ERROR);

		return true;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
addq $0x18, %rdi
movq %rdx, %rsi
callq 0x333c
cmpl $0x5, %eax
ja 0x2ebe
movl %eax, %eax
leaq 0x2163(%rip), %rcx      # 0x5014
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %eax, %eax
jmp 0x2eff
movq %r14, %rdi
movl %ebx, %esi
movl $0x4, %edx
jmp 0x2eee
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
jmp 0x2edd
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x4068
jmp 0x2efd
movq %r14, %rdi
movl %ebx, %esi
movl $0x3, %edx
callq 0x2da6
jmp 0x2efd
movb $0x0, 0x8c(%r14)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/nmmmnu[P]HM3/net/asyncloop_impl.h
// Function: net::AsyncLoop<net::selector::PollSelector, net::worker::KeyValueWorker<net::protocol::RedisProtocol, KeyValueMockAdapter>>::insertFD_(int)
bool AsyncLoop<SELECTOR, WORKER>::insertFD_(int const fd){
	// one for server fd
	if (connectedClients_ + 1 >= selector_.maxFD() )
		return false;

	bool const result = selector_.insertFD(fd);

	if (result == false)
		return false;

	//clients_.insert(std::make_pair(fd, ClientBuffer{}));
	clients_[fd];

	++connectedClients_;

	return true;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, 0x4(%rsp)
movl 0x88(%rdi), %ebp
incl %ebp
callq 0x3f84
cmpl %eax, %ebp
jae 0x2fe5
movl 0x4(%rsp), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3ff2
movl %eax, %ebp
testb %al, %al
je 0x2fe7
leaq 0x50(%rbx), %rdi
leaq 0x4(%rsp), %rsi
callq 0x2ff0
incl 0x88(%rbx)
jmp 0x2fe7
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/nmmmnu[P]HM3/net/protocol/redisprotocol_impl.h
// Function: void net::protocol::RedisProtocol::response_string<net::ClientBuffer>(net::ClientBuffer&, StringRef const&)
void RedisProtocol::response_string(CONNECTION &buffer, const StringRef &msg){
	buffer.push(DOLLAR);
	buffer.push(std::to_string(msg.size()));
	buffer.push(ENDLN);

	buffer.push(msg);
	buffer.push(ENDLN);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq %r14, %rdi
movl $0x24, %esi
callq 0x2160
movq (%r15), %r12
movl $0x1, %esi
cmpq $0xa, %r12
jb 0x37e0
movl $0x4, %esi
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
movq %r12, %rcx
cmpq $0x63, %rcx
jbe 0x37d9
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x37de
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x37e0
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x37a3
addl $-0x3, %esi
jmp 0x37e0
addl $-0x2, %esi
jmp 0x37e0
decl %esi
movl %esi, %esi
leaq 0x18(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x8(%rsp), %r13
movq %r13, %rdi
xorl %edx, %edx
callq 0x21e0
movq (%r13), %rdi
movl 0x8(%r13), %esi
movq %r12, %rdx
callq 0x38eb
movq (%r13), %rsi
movq 0x8(%r13), %rdx
testq %rdx, %rdx
setne %al
testq %rsi, %rsi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x382d
movq %r14, %rdi
callq 0x2060
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3844
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
leaq 0x18d9(%rip), %rsi      # 0x5124
movq %rbx, %rdi
callq 0x38ac
movq (%r15), %rdx
testq %rdx, %rdx
je 0x386c
movq 0x8(%r15), %rsi
testq %rsi, %rsi
je 0x386c
movq %r14, %rdi
callq 0x2060
leaq 0x18b1(%rip), %rsi      # 0x5124
movq %rbx, %rdi
callq 0x38ac
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x38a4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O1/nmmmnu[P]HM3/net/protocol/redisprotocol_impl.h
// Function: void net::protocol::RedisProtocol::response_strings<net::ClientBuffer, std::vector<StringRef, std::allocator<StringRef>>>(net::ClientBuffer&, std::vector<StringRef, std::allocator<StringRef>> const&)
void RedisProtocol::response_strings(CONNECTION &buffer, const CONTAINER &list){
	buffer.push(STAR);
	buffer.push(std::to_string(list.size()));
	buffer.push(ENDLN);

	for(const auto &msg : list)
		response_string(buffer, msg);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rdi), %r15
movq %r15, %rdi
movl $0x2a, %esi
callq 0x2160
movq 0x8(%r14), %r12
subq (%r14), %r12
sarq $0x4, %r12
movl $0x1, %esi
cmpq $0xa, %r12
jb 0x39f0
movl $0x4, %esi
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
movq %r12, %rcx
cmpq $0x63, %rcx
jbe 0x39e9
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x39ee
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x39f0
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x39b3
addl $-0x3, %esi
jmp 0x39f0
addl $-0x2, %esi
jmp 0x39f0
decl %esi
movl %esi, %esi
leaq 0x18(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x8(%rsp), %r13
movq %r13, %rdi
xorl %edx, %edx
callq 0x21e0
movq (%r13), %rdi
movl 0x8(%r13), %esi
movq %r12, %rdx
callq 0x38eb
movq (%r13), %rsi
movq 0x8(%r13), %rdx
testq %rdx, %rdx
setne %al
testq %rsi, %rsi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x3a3d
movq %r15, %rdi
callq 0x2060
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3a54
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
leaq 0x16c9(%rip), %rsi      # 0x5124
movq %rbx, %rdi
callq 0x38ac
movq (%r14), %r15
movq 0x8(%r14), %r14
cmpq %r14, %r15
je 0x3a80
movq %rbx, %rdi
movq %r15, %rsi
callq 0x375e
addq $0x10, %r15
jmp 0x3a6a
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3aa9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x2280
nop
// File: /workspace/github_cpp_makefile_star2_O1/nmmmnu[P]HM3/net/selector/pollselector.cc
// Function: net::selector::PollSelector::wait(int)
WaitStatus PollSelector::wait(int const timeout){
	// size cast is for FreeBSD and OSX warning
	int const activity = poll(statusData_.data(), (nfds_t) statusData_.size(), timeout);

	if (activity < 0)
		return WaitStatus::ERROR;

	if (activity == 0)
		return WaitStatus::NONE;

	return WaitStatus::OK;
}

// Assembly:
pushq %rax
movl %esi, %edx
movq (%rdi), %rax
movq 0x8(%rdi), %rsi
subq %rax, %rsi
sarq $0x3, %rsi
movq %rax, %rdi
callq 0x2230
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
movl $0x2, %eax
cmovnsl %ecx, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O1/nmmmnu[P]HM3/net/selector/pollselector.cc
// Function: net::selector::PollSelector::getFDStatus(unsigned int) const
FDResult PollSelector::getFDStatus(uint32_t const no) const{
	const auto &p = statusData_[no];
	int  const fd = p.fd;
	auto const ev = p.revents;

	if (ev & POLLERR)
		return { fd, FDStatus::ERROR };

	if (ev & POLLIN)
		return { fd, FDStatus::READ };

	if (ev & POLLOUT)
		return { fd, FDStatus::WRITE };

	return { fd, FDStatus::NONE };
}

// Assembly:
movl %esi, %eax
movq (%rdi), %rdx
movl (%rdx,%rax,8), %ecx
movzwl 0x6(%rdx,%rax,8), %eax
testb $0x8, %al
jne 0x3fd8
testb $0x1, %al
jne 0x3fe4
andl $0x4, %eax
shlq $0x1f, %rax
jmp 0x3fee
movabsq $0x300000000, %rax      # imm = 0x300000000
jmp 0x3fee
movabsq $0x100000000, %rax      # imm = 0x100000000
orq %rcx, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/nmmmnu[P]HM3/net/selector/pollselector.cc
// Function: net::selector::PollSelector::insertFD(int, net::selector::FDEvent)
bool PollSelector::insertFD(int const fd, const FDEvent event){
	uint32_t pos = 0;
	bool     pok = false;

	for(uint32_t i = 0; i < statusData_.size(); ++i){
		if (statusData_[i].fd == fd){
			pos = i;
			pok = true;
			break;
		}

		if (pok == false && statusData_[i].fd < 0){
			pos = i;
			pok = true;
		}
	}

	if (! pok)
		return false;

	statusData_[pos].fd = fd;
	statusData_[pos].events = pollConvert(event);

	return true;
}

// Assembly:
pushq %rbx
movq (%rdi), %rcx
movq 0x8(%rdi), %r8
subq %rcx, %r8
je 0x403d
sarq $0x3, %r8
xorl %r9d, %r9d
movl $0x1, %r10d
xorl %eax, %eax
xorl %edi, %edi
movl (%rcx,%r9,8), %r11d
cmpl %esi, %r11d
je 0x4043
testb $0x1, %al
sete %bl
testl %r11d, %r11d
sets %r11b
testb %r11b, %bl
cmovnel %r9d, %edi
movzbl %al, %eax
cmovnel %r10d, %eax
incl %r9d
cmpq %r9, %r8
ja 0x4010
jmp 0x4048
xorl %edi, %edi
xorl %eax, %eax
jmp 0x4048
movb $0x1, %al
movl %r9d, %edi
testb $0x1, %al
je 0x4064
movl %edi, %edi
movl %esi, (%rcx,%rdi,8)
xorl %esi, %esi
cmpl $0x1, %edx
sete %sil
leal (%rsi,%rsi,2), %edx
incl %edx
movw %dx, 0x4(%rcx,%rdi,8)
andb $0x1, %al
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/nmmmnu[P]HM3/net/protocol/redisprotocol.cc
// Function: net::protocol::RedisProtocol::operator()(StringRef const&)
auto RedisProtocol::operator()(const StringRef &src) -> Status{
	// this doing more harm than relps.
//	if (src.size() < 8)	// 4 bytes - "*1\r\n$1\r\n"
//		return Status::BUFFER_NOT_READ;

	size_t pos = 0;

	if (src[pos] != STAR)
		return err_(Error::NO_STAR);

	++pos;

	if (pos + 1 > src.size())
		// at least one character for parameter count
		return Status::BUFFER_NOT_READ;

	size_t const paramsCount = (size_t) readInt_(src, pos);

	params_.clear();

	if (paramsCount == 0 || paramsCount > MAX_PARAMS)
		return err_(Error::PARAM_COUNT);

	{
		Status stat = readLn_(src, pos);
		if ( stat != Status::OK )
			return stat;
	}

	for(size_t i = 0; i < paramsCount; ++i)
		if ( const auto p = readParam_(src, pos) )
			params_.push_back( p.get() );
		else
			return p.code();

	return Status::OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq $0x0, 0x8(%rsp)
movq 0x8(%rsi), %r15
movl $0x2, %ebp
cmpb $0x2a, (%r15)
jne 0x43d8
movq %rsi, %rbx
movq $0x1, 0x8(%rsp)
movq (%rsi), %r12
movl $0x1, %ebp
cmpq $0x2, %r12
jb 0x43d8
movq %rdi, %r14
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x43ea
movq (%r14), %rcx
cmpq %rcx, 0x8(%r14)
je 0x432b
movq %rcx, 0x8(%r14)
leal -0x5(%rax), %ecx
movl $0x2, %ebp
cmpl $-0x4, %ecx
jb 0x43d8
movq 0x8(%rsp), %rdx
leaq 0x1(%rdx), %rsi
cmpq %r12, %rsi
jbe 0x4351
movl $0x1, %ebp
jmp 0x4370
cmpb $0xd, (%r15,%rdx)
jne 0x4370
xorl %ecx, %ecx
cmpb $0xa, (%r15,%rsi)
jne 0x4372
addq $0x2, %rdx
movq %rdx, 0x8(%rsp)
movb $0x1, %cl
xorl %ebp, %ebp
jmp 0x4372
xorl %ecx, %ecx
testb %cl, %cl
je 0x43d8
testl %eax, %eax
je 0x43d6
movslq %eax, %r15
leaq 0x8(%rsp), %r13
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x447a
movl 0x10(%rsp), %r12d
movl %r12d, %eax
testl %r12d, %r12d
jne 0x43ca
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0x43bb
leaq 0x18(%rsp), %rax
movups (%rax), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x8(%r14)
jmp 0x43c8
movq %r14, %rdi
leaq 0x18(%rsp), %rdx
callq 0x45b6
movl %ebp, %eax
movl %eax, %ebp
testl %r12d, %r12d
jne 0x43d8
decq %r15
jne 0x4382
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/nmmmnu[P]HM3/net/protocol/redisprotocol.cc
// Function: net::protocol::RedisProtocol::readInt_(StringRef const&, unsigned long&)
int RedisProtocol::readInt_(const StringRef &src, size_t &pos){
	char buff[INT_BUFFER_SIZE + 1];

	size_t bpos = 0;

	while(pos < src.size() && bpos < INT_BUFFER_SIZE){
		char const c = src[pos];
		if (c != '-' && c != '+' && (c < '0' || c > '9') )
			break;

		buff[bpos] = c;

		++pos;
		++bpos;
	}

	buff[bpos] = '\0';

	return atoi(buff);
}

// Assembly:
subq $0x18, %rsp
movq 0x8(%rdi), %rcx
xorl %eax, %eax
movq (%rsi), %rdx
cmpq (%rdi), %rdx
jae 0x4435
cmpq $0x7, %rax
ja 0x4435
movzbl (%rcx,%rdx), %r8d
cmpl $0x2b, %r8d
je 0x4421
cmpl $0x2d, %r8d
je 0x4421
leal -0x3a(%r8), %r9d
cmpb $-0xa, %r9b
jae 0x4421
xorl %edx, %edx
jmp 0x4431
movb %r8b, 0xf(%rsp,%rax)
incq %rdx
movq %rdx, (%rsi)
incq %rax
movb $0x1, %dl
testb %dl, %dl
jne 0x43f4
movb $0x0, 0xf(%rsp,%rax)
leaq 0xf(%rsp), %rdi
callq 0x2250
addq $0x18, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/nmmmnu[P]HM3/net/protocol/redisprotocol.cc
// Function: net::protocol::RedisProtocol::readLn_(StringRef const&, unsigned long&)
auto RedisProtocol::readLn_(const StringRef &src, size_t &pos) -> Status{
	if (pos + 1 > src.size())
		return Status::BUFFER_NOT_READ;

	if (src[pos] == '\r' && src[pos + 1] == '\n'){
		pos += 2;
		return Status::OK;
	}

	return err_(Error::NO_CRLF);
}

// Assembly:
movq (%rsi), %rcx
leaq 0x1(%rcx), %rdx
movl $0x1, %eax
cmpq (%rdi), %rdx
ja 0x4479
movq 0x8(%rdi), %rdi
movl $0x2, %eax
cmpb $0xd, (%rdi,%rcx)
jne 0x4479
cmpb $0xa, (%rdi,%rdx)
jne 0x4479
addq $0x2, %rcx
movq %rcx, (%rsi)
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/nmmmnu[P]HM3/net/protocol/redisprotocol.cc
// Function: net::protocol::RedisProtocol::readParam_(StringRef const&, unsigned long&)
auto RedisProtocol::readParam_(const StringRef &src, size_t &pos) -> CheckedStringref{
	if (pos + 1 > src.size())
		return Status::BUFFER_NOT_READ;

	if (src[pos] != DOLLAR)
		return err_(Error::NO_DOLLAR);

	++pos;

	if (pos + 1 > src.size())
		return Status::BUFFER_NOT_READ;

	const size_t size = (size_t) readInt_(src, pos);
	if (size <= 0 || size > MAX_PARAM_SIZE)
		return err_(Error::PARAM_SIZE);

	{
		Status stat = readLn_(src, pos);
		if ( stat != Status::OK )
			return stat;
	}

	const auto pos_save = pos;

	// store param must be here, but is optimized at the end.

	pos += size;

	// check if all data is there.
	if (pos > src.size())
		return Status::BUFFER_NOT_READ;

	{
		Status stat = readLn_(src, pos);
		if ( stat != Status::OK )
			return stat;
	}

	return StringRef( & src[pos_save], size);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rdi, %rbx
movq (%rdx), %rax
leaq 0x1(%rax), %rdx
leaq 0xc90(%rip), %r12       # 0x5126
movl $0x1, %ecx
cmpq (%rsi), %rdx
jbe 0x44a4
xorl %eax, %eax
jmp 0x44dd
movq %rsi, %r14
movq 0x8(%rsi), %rsi
cmpb $0x24, (%rsi,%rax)
jne 0x44d6
movq %rdx, (%r15)
addq $0x2, %rax
cmpq (%r14), %rax
ja 0x44a0
movq %r14, %rdi
movq %r15, %rsi
callq 0x43ea
leal -0x4001(%rax), %ecx
cmpl $0xffffc000, %ecx       # imm = 0xFFFFC000
jae 0x44f6
xorl %eax, %eax
movl $0x2, %ecx
movl %ecx, (%rbx)
movq %rax, 0x8(%rbx)
movq %r12, 0x10(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq (%r15), %rsi
leaq 0x1(%rsi), %rdi
cmpq (%r14), %rdi
jbe 0x4509
movl $0x1, %ecx
jmp 0x452f
movq 0x8(%r14), %r8
movl $0x2, %ecx
cmpb $0xd, (%r8,%rsi)
jne 0x452f
xorl %edx, %edx
cmpb $0xa, (%r8,%rdi)
jne 0x4531
addq $0x2, %rsi
movq %rsi, (%r15)
movb $0x1, %dl
xorl %ecx, %ecx
jmp 0x4531
xorl %edx, %edx
testb %dl, %dl
je 0x44a0
cltq
movq (%r15), %rdx
leaq (%rdx,%rax), %rsi
movq %rsi, (%r15)
movq (%r14), %rcx
cmpq %rcx, %rsi
jbe 0x4557
movl $0x1, %ecx
jmp 0x44a0
leaq 0x1(%rsi), %r8
cmpq %rcx, %r8
jbe 0x4567
movl $0x1, %ecx
jmp 0x458e
movq 0x8(%r14), %r9
movl $0x2, %ecx
cmpb $0xd, (%r9,%rsi)
jne 0x458e
xorl %edi, %edi
cmpb $0xa, (%r9,%r8)
jne 0x4590
addq $0x2, %rsi
movq %rsi, (%r15)
movb $0x1, %dil
xorl %ecx, %ecx
jmp 0x4590
xorl %edi, %edi
testb %dil, %dil
je 0x44a0
movq 0x8(%r14), %rcx
addq %rcx, %rdx
testq %rcx, %rcx
leaq 0xb7c(%rip), %r12       # 0x5126
cmovneq %rdx, %r12
xorl %ecx, %ecx
jmp 0x44dd
nop
// File: /workspace/github_cpp_makefile_star2_O1/nmmmnu[P]HM3/net/sockets.cc
// Function: net::socket_read(int, void*, unsigned long, int)
ssize_t socket_read(int const fd, void *buf, size_t const count, int const timeout) noexcept{
	bool const ready = socket_poll_(fd, POLLIN, timeout);

	if (!ready){
		// simulate EAGAIN
		errno = EAGAIN;
		return -1;
	}

	return socket_read(fd, buf, count);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
leaq 0x8(%rsp), %rdi
movl %ebp, (%rdi)
movw $0x1, 0x4(%rdi)
movl $0x1, %esi
movl %ecx, %edx
callq 0x2230
cmpl $0x1, %eax
jne 0x48d4
movzwl 0xe(%rsp), %eax
andl $0x1, %eax
je 0x48d4
movl %ebp, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2210
jmp 0x48e6
callq 0x2030
movl $0xb, (%rax)
movq $-0x1, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x48f1
movq %rax, %rdi
callq 0x2818
// File: /workspace/github_cpp_makefile_star2_O1/nmmmnu[P]HM3/net/sockets.cc
// Function: net::socket_write(int, void const*, unsigned long, int)
ssize_t socket_write(int const fd, const void *buf, size_t const count, int const timeout) noexcept{
	bool const ready = socket_poll_(fd, POLLOUT, timeout);

	if (!ready){
		// simulate EAGAIN
		errno = EAGAIN;
		return -1;
	}

	return socket_write(fd, buf, count);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
leaq 0x8(%rsp), %rdi
movl %ebp, (%rdi)
movw $0x4, 0x4(%rdi)
movl $0x1, %esi
movl %ecx, %edx
callq 0x2230
cmpl $0x1, %eax
jne 0x4940
movzwl 0xe(%rsp), %eax
andl $0x4, %eax
je 0x4940
movl %ebp, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x20b0
jmp 0x4952
callq 0x2030
movl $0xb, (%rax)
movq $-0x1, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x495d
movq %rax, %rdi
callq 0x2818
// File: /workspace/github_cpp_makefile_star2_O1/nmmmnu[P]HM3/net/sockets.cc
// Function: net::socket_create(net::SOCKET_TCP, char const*, unsigned short, unsigned short, unsigned char)
int socket_create(const SOCKET_TCP,  const char *ip, uint16_t const port, uint16_t const backlog, options_type const options) noexcept{
	int fd = socket(AF_INET , SOCK_STREAM , 0);

	if(fd < 0)
		return SOCKET_ERROR_CREATE;

	if (options & SOCKET_REUSEADDR)
	if (! socket_makeReuseAddr_(fd))
		socket_error_(fd, SOCKET_ERROR_OPTIONS);

	if (options & SOCKET_NONBLOCK)
	if (! socket_makeNonBlocking(fd) )
		socket_error_(fd, SOCKET_ERROR_NONBLOCK);

	if (options & SOCKET_TCPNODELAY)
	if (! socket_makeTCPNoDelay(fd) )
		socket_error_(fd, SOCKET_ERROR_NODELAY);

	if (options & SOCKET_KEEPALIVE)
	if (! socket_makeKeepAlive(fd) )
		socket_error_(fd, SOCKET_ERROR_KEEPALIVE);

	struct sockaddr_in address;

	address.sin_family = AF_INET;
	address.sin_addr.s_addr = INADDR_ANY;
	address.sin_port = htons(port);

	return socket_server_(fd, address, backlog);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r15d
movl %edx, %ebx
movl %esi, %ebp
movl $0x2, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x2080
testl %eax, %eax
js 0x4a71
movl %eax, %r14d
testb $0x2, %r15b
je 0x49c7
leaq 0x8(%rsp), %rcx
movl $0x1, (%rcx)
movl %r14d, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x2290
testl %eax, %eax
jns 0x49c7
movl %r14d, %edi
callq 0x22a0
testb $0x1, %r15b
je 0x49e1
movl %r14d, %edi
callq 0x47b0
testb %al, %al
jne 0x49e1
movl %r14d, %edi
callq 0x22a0
testb $0x4, %r15b
je 0x4a16
leaq 0x8(%rsp), %rcx
movl $0x1, (%rcx)
movl %r14d, %edi
movl $0x6, %esi
movl $0x1, %edx
movl $0x4, %r8d
callq 0x2290
testl %eax, %eax
jns 0x4a16
movl %r14d, %edi
callq 0x22a0
testb $0x8, %r15b
je 0x4a4b
leaq 0x8(%rsp), %rcx
movl $0x1, (%rcx)
movl %r14d, %edi
movl $0x1, %esi
movl $0x9, %edx
movl $0x4, %r8d
callq 0x2290
testl %eax, %eax
jns 0x4a4b
movl %r14d, %edi
callq 0x22a0
leaq 0x8(%rsp), %rsi
movw $0x2, (%rsi)
movl $0x0, 0x4(%rsi)
rolw $0x8, %bp
movw %bp, 0x2(%rsi)
movzwl %bx, %edx
movl %r14d, %edi
callq 0x4b25
jmp 0x4a76
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0x2818
// File: /workspace/github_cpp_makefile_star2_O1/nmmmnu[P]HM3/net/sockets.cc
// Function: net::socket_create(net::SOCKET_UNIX, char const*, unsigned short, unsigned char)
int socket_create(const SOCKET_UNIX, const char *path, uint16_t const backlog, options_type const options) noexcept{
	if (sizeof sockaddr_un::sun_path < strlen(path))
		return SOCKET_NAME_SIZE;


	int fd = socket(AF_UNIX , SOCK_STREAM , 0);

	if(fd < 0)
		return SOCKET_ERROR_CREATE;

	if (options & SOCKET_NONBLOCK)
	if (! socket_makeNonBlocking(fd) )
		socket_error_(fd, SOCKET_ERROR_NONBLOCK);

	struct sockaddr_un address;
	address.sun_family = AF_UNIX;
	strcpy(address.sun_path, path);

	unlink(address.sun_path);

	return socket_server_(fd, address, backlog);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x78, %rsp
movl %edx, %r15d
movl %esi, %ebx
movq %rdi, %r14
callq 0x20e0
movq %rax, %rcx
movl $0xfffffff8, %eax       # imm = 0xFFFFFFF8
cmpq $0x6c, %rcx
ja 0x4b12
movl $0x1, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x2080
testl %eax, %eax
js 0x4b0d
movl %eax, %ebp
testb $0x1, %r15b
je 0x4add
movl %ebp, %edi
callq 0x47b0
testb %al, %al
jne 0x4add
movl %ebp, %edi
callq 0x22a0
leaq 0xc(%rsp), %r15
movw $0x1, -0x2(%r15)
movq %r15, %rdi
movq %r14, %rsi
callq 0x2180
movq %r15, %rdi
callq 0x20f0
movzwl %bx, %edx
leaq 0xa(%rsp), %rsi
movl %ebp, %edi
callq 0x4b71
jmp 0x4b12
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0x2818
// File: /workspace/github_cpp_makefile_star2_O1/cpottamus[P]btree_lab/freebuffer.cc
// Function: main
int main(int argc, char *argv[])
{
  if (argc<5) { 
    usage();
    exit(-1);
  }
  SIZE_T cachesize=atoi(argv[2]);
  SIZE_T blocknum=atoi(argv[3]);
  SIZE_T numblocks=atoi(argv[4]);

  DiskSystem disk(argv[1]);
  BufferCache cache(&disk,cachesize);

  cache.Attach();

  for (unsigned i=blocknum;i<(blocknum+numblocks);i++) { 
    ERROR_T rc=cache.NotifyDeallocateBlock(i);
    if (rc!=ERROR_NOERROR) { 
      cerr << "Error " << rc <<" occured when notifying cache of allocation of block "<< i << endl;
      return -1;
    }
  }

  cache.Detach();

  cerr << "Deallocation done\n";

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
cmpl $0x4, %edi
jle 0x2725
movq %rsi, %r15
movq 0x10(%rsi), %rdi
callq 0x22e0
movl %eax, %ebp
movq 0x18(%r15), %rdi
callq 0x22e0
movl %eax, %ebx
movq 0x20(%r15), %rdi
callq 0x22e0
movl %eax, %r14d
movq 0x8(%r15), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x2780
subq $0x8, %rsp
xorl %eax, %eax
leaq 0x70(%rsp), %rdi
leaq 0x10(%rsp), %rsi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %rax
pushq %rax
pushq %rax
callq 0x2850
addq $0x20, %rsp
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2600
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21c0
leaq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
movl %ebp, %edx
callq 0x4244
leaq 0x8(%rsp), %rdi
callq 0x433c
addl %ebx, %r14d
xorl %ebp, %ebp
cmpl %r14d, %ebx
setb %r13b
jae 0x26d3
movl %ebx, %ebx
movl %r14d, %r14d
xorl %ebp, %ebp
movq 0x59b5(%rip), %r15      # 0x7ff0
leaq 0x8(%rsp), %rdi
movl %ebx, %esi
callq 0x4374
movl %eax, %r12d
testl %eax, %eax
je 0x26be
movl $0x6, %edx
movq %r15, %rdi
leaq 0x29e0(%rip), %rsi      # 0x503d
callq 0x2210
movq %r15, %rdi
movl %r12d, %esi
callq 0x2340
movq %rax, %rbp
movl $0x35, %edx
movq %rax, %rdi
leaq 0x29c5(%rip), %rsi      # 0x5044
callq 0x2210
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x2100
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbp, %rdi
callq 0x2040
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rax, %rdi
callq 0x2110
testl %r12d, %r12d
jne 0x26d3
incq %rbx
cmpq %r14, %rbx
setb %r13b
jne 0x263b
testb $0x1, %r13b
jne 0x26fd
leaq 0x8(%rsp), %rdi
callq 0x42ac
xorl %ebp, %ebp
movq 0x5904(%rip), %rdi      # 0x7ff0
leaq 0x2987(%rip), %rsi      # 0x507a
movl $0x12, %edx
callq 0x2210
leaq 0x8(%rsp), %rdi
callq 0x4274
leaq 0x68(%rsp), %rdi
callq 0x2df0
movl %ebp, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x254c
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2250
movq %rax, %rbx
jmp 0x276d
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2777
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21c0
jmp 0x2777
movq %rax, %rbx
jmp 0x2777
jmp 0x2760
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x4274
leaq 0x68(%rsp), %rdi
callq 0x2df0
movq %rbx, %rdi
callq 0x2350
nop
// File: /workspace/github_cpp_makefile_star2_O1/jcipar[P]stack-distance/src/rank-tree.cpp
// Function: RankTreeNode::RankTreeNode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned long)
RankTreeNode::RankTreeNode(string name, uint64_t weight) {
	_name = name;
	_subtreeWeight = 0;
	_weight = weight;
	_priority = rand();
	_left = nullptr;
	_right = nullptr;
	_parent = nullptr;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
callq 0x20b0
xorl %r15d, %r15d
movq %r15, 0x20(%rbx)
movq %r14, 0x28(%rbx)
callq 0x2060
movl %eax, 0x30(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
movq %r15, 0x48(%rbx)
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x23e3
callq 0x2140
movq %r14, %rdi
callq 0x2210
nop
// File: /workspace/github_cpp_makefile_star2_O1/jcipar[P]stack-distance/src/rank-tree.cpp
// Function: RankTreeNode::~RankTreeNode()
RankTreeNode::~RankTreeNode() {
	if (_left != nullptr) {
		delete _left;
	}
	if (_right != nullptr) {
		delete _right;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x38(%rdi), %r14
testq %r14, %r14
je 0x240c
movq %r14, %rdi
callq 0x23ec
movq %r14, %rdi
callq 0x2140
movq 0x40(%rbx), %r14
testq %r14, %r14
je 0x2425
movq %r14, %rdi
callq 0x23ec
movq %r14, %rdi
callq 0x2140
movq (%rbx), %rdi
addq $0x10, %rbx
addq $0x8, %rsp
cmpq %rbx, %rdi
je 0x243d
popq %rbx
popq %r14
jmp 0x2140
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/jcipar[P]stack-distance/src/rank-tree.cpp
// Function: RankTreeNode::print(int)
void RankTreeNode::print(int level) {
	for (int i=0; i< level; i++) {
		cout << "  ";
	}
	cout << _name 
	<< " " << _subtreeWeight
	<< " " << _priority 
	<< " " << Rank()
	<< endl;
	if (_left) {
		_left->print(level+1);
	} else { 
		for (int i=0; i< level+1; i++) {
			cout << "  ";
		}
		cout << "<empty subtree>\n";
	}

	if (_right) {
		_right->print(level+1);
	} else { 
		for (int i=0; i< level+1; i++) {
			cout << "  ";
		}
		cout << "<empty subtree>\n";
	}

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movq 0x4b71(%rip), %r15      # 0x6fd0
leaq 0x1b9e(%rip), %r12      # 0x4004
leaq 0x1b98(%rip), %r13      # 0x4005
movl %ebx, %ebp
testl %ebx, %ebx
jle 0x2487
movl $0x2, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x21a0
decl %ebp
jne 0x2473
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x21a0
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x21a0
movq 0x20(%r14), %rsi
movq %rbp, %rdi
callq 0x2150
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x21a0
movl 0x30(%r14), %esi
movq %rbp, %rdi
callq 0x2200
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x21a0
movq %r14, %rdi
callq 0x25ce
movq %rbp, %rdi
movq %rax, %rsi
callq 0x2150
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %rbp, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq 0x38(%r14), %rdi
testq %rdi, %rdi
je 0x2537
leal 0x1(%rbx), %esi
callq 0x2448
jmp 0x256a
testl %ebx, %ebx
js 0x2556
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl $0x2, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x21a0
incl %ebp
cmpl %ebp, %ebx
jne 0x2540
movl $0x10, %edx
movq %r15, %rdi
leaq 0x1aa2(%rip), %rsi      # 0x4007
callq 0x21a0
movq 0x40(%r14), %r14
testq %r14, %r14
je 0x257a
incl %ebx
jmp 0x246d
testl %ebx, %ebx
js 0x25a7
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x4a46(%rip), %r14      # 0x6fd0
leaq 0x1a73(%rip), %r15      # 0x4004
movl $0x2, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x21a0
incl %ebp
cmpl %ebp, %ebx
jne 0x2591
movq 0x4a22(%rip), %rdi      # 0x6fd0
leaq 0x1a52(%rip), %rsi      # 0x4007
movl $0x10, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21a0
nop
// File: /workspace/github_cpp_makefile_star2_O1/jcipar[P]stack-distance/src/rank-tree.cpp
// Function: RankTreeNode::Rank()
int64_t RankTreeNode::Rank() {
	if (root()) {
		return leftWeight();
	} else if (leftChild()) {
		return _parent->leftChildRank(leftWeight());
	} else {
		assert(rightChild());
		return _parent->rightChildRank(leftWeight());
	}
}

// Assembly:
movq %rdi, %rax
movq 0x48(%rdi), %rdi
testq %rdi, %rdi
je 0x25f8
cmpq %rax, 0x38(%rdi)
je 0x2606
cmpq %rax, 0x40(%rdi)
jne 0x2629
movq 0x38(%rax), %rax
testq %rax, %rax
je 0x2618
movq 0x20(%rax), %rsi
jmp 0x2aba
movq 0x38(%rax), %rax
testq %rax, %rax
je 0x261f
movq 0x20(%rax), %rax
retq
movq 0x38(%rax), %rax
testq %rax, %rax
je 0x2622
movq 0x20(%rax), %rsi
jmp 0x2a76
xorl %esi, %esi
jmp 0x2aba
xorl %eax, %eax
retq
xorl %esi, %esi
jmp 0x2a76
pushq %rax
leaq 0x1b65(%rip), %rdi      # 0x4196
leaq 0x1a15(%rip), %rsi      # 0x404d
leaq 0x1c2f(%rip), %rcx      # 0x426e
movl $0xf5, %edx
callq 0x20e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/jcipar[P]stack-distance/src/rank-tree.cpp
// Function: RankTreeNode::checkWeights()
int64_t RankTreeNode::checkWeights() {
	int64_t leftWeight = 0;
	int64_t rightWeight = 0;
	if (_left != nullptr) {
		leftWeight = _left->checkWeights();
	}
	if (_right != nullptr) {
		rightWeight = _right->checkWeights();
	}
	assert(_subtreeWeight == _weight + leftWeight + rightWeight);
	return _subtreeWeight;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x38(%rdi), %rdi
testq %rdi, %rdi
je 0x2664
callq 0x264a
movq %rax, %r14
jmp 0x2667
xorl %r14d, %r14d
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0x2677
callq 0x264a
jmp 0x2679
xorl %eax, %eax
addq %r14, %rax
movq 0x20(%rbx), %rcx
addq 0x28(%rbx), %rax
cmpq %rax, %rcx
jne 0x2694
movq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x197d(%rip), %rdi      # 0x4018
leaq 0x19ab(%rip), %rsi      # 0x404d
leaq 0x19b6(%rip), %rcx      # 0x405f
movl $0x48, %edx
callq 0x20e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/jcipar[P]stack-distance/src/rank-tree.cpp
// Function: RankTreeNode::checkPriorities(int)
void RankTreeNode::checkPriorities(int parentPriority) {
	assert(_priority <= parentPriority);
	if (_left != nullptr) {
		_left->checkPriorities(_priority);
	}
	if (_right != nullptr) {
		_right->checkPriorities(_priority);
	}
}

// Assembly:
pushq %rbx
movl %esi, %eax
movq %rdi, %rbx
movl 0x30(%rbx), %esi
cmpl %eax, %esi
jg 0x26e2
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x26cf
callq 0x26b4
movq 0x40(%rbx), %rcx
testq %rcx, %rcx
je 0x26e0
movl 0x30(%rbx), %eax
movq %rcx, %rbx
jmp 0x26ba
popq %rbx
retq
leaq 0x199b(%rip), %rdi      # 0x4084
leaq 0x195d(%rip), %rsi      # 0x404d
leaq 0x19a9(%rip), %rcx      # 0x40a0
movl $0x4e, %edx
callq 0x20e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/jcipar[P]stack-distance/src/rank-tree.cpp
// Function: RankTreeNode::checkParentPointers(RankTreeNode*)
void RankTreeNode::checkParentPointers(RankTreeNode* parent) {
	assert(_parent == parent);
	if (_left != nullptr) {
		_left->checkParentPointers(this);
	}
	if (_right != nullptr) {
		_right->checkParentPointers(this);
	}
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
cmpq %rbx, 0x48(%rdi)
jne 0x272b
movq %rdi, %rbx
movq 0x38(%rdi), %rdi
testq %rdi, %rdi
je 0x2720
movq %rbx, %rsi
callq 0x2702
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
jne 0x2706
popq %rbx
retq
leaq 0x1996(%rip), %rdi      # 0x40c8
leaq 0x1914(%rip), %rsi      # 0x404d
leaq 0x199a(%rip), %rcx      # 0x40da
movl $0x59, %edx
callq 0x20e0
// File: /workspace/github_cpp_makefile_star2_O1/jcipar[P]stack-distance/src/rank-tree.cpp
// Function: RankTreeNode::checkUniqueness(std::set<RankTreeNode*, std::less<RankTreeNode*>, std::allocator<RankTreeNode*>>&)
void RankTreeNode::checkUniqueness(std::set<RankTreeNode*>& ptrs) {
	assert(ptrs.count(this) == 0);
	ptrs.insert(this);
	if (_left != nullptr) {
		_left->checkUniqueness(ptrs);
	}
	if (_right != nullptr) {
		_right->checkUniqueness(ptrs);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rsi), %rdx
leaq 0x8(%rsi), %rax
movq %rax, %rcx
testq %rdx, %rdx
je 0x277f
movq %rax, %rcx
xorl %esi, %esi
cmpq %r14, 0x20(%rdx)
setb %sil
cmovaeq %rdx, %rcx
movq 0x10(%rdx,%rsi,8), %rdx
testq %rdx, %rdx
jne 0x2767
movq %rax, %rdx
cmpq %rax, %rcx
je 0x2792
cmpq %r14, 0x20(%rcx)
cmovaq %rax, %rcx
movq %rcx, %rdx
cmpq %rax, %rdx
jne 0x27cf
movq %rsp, %rsi
movq %r14, (%rsi)
movq %rbx, %rdi
callq 0x2eb4
movq 0x38(%r14), %rdi
testq %rdi, %rdi
je 0x27b6
movq %rbx, %rsi
callq 0x274a
movq 0x40(%r14), %rdi
testq %rdi, %rdi
je 0x27c7
movq %rbx, %rsi
callq 0x274a
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x193b(%rip), %rdi      # 0x4111
leaq 0x1870(%rip), %rsi      # 0x404d
leaq 0x1943(%rip), %rcx      # 0x4127
movl $0x64, %edx
callq 0x20e0
// File: /workspace/github_cpp_makefile_star2_O1/jcipar[P]stack-distance/src/rank-tree.cpp
// Function: RankTreeNode::promote()
void RankTreeNode::promote() {
	assert(_parent != nullptr);
	auto A = _parent;
	auto GP = _parent->_parent;
	if (leftChild()) {
		auto E = _right;
		_right = A;
		A->_parent = this;
		A->_left = E;
		if (E != nullptr) {
			E->_parent = A;
		}
	} else {
		assert(rightChild());
		auto E = _left;
		_left = A;
		A->_parent = this;
		A->_right = E;
		if (E != nullptr) {
			E->_parent = A;
		}
	}
	_parent = GP;
	if (GP != nullptr) {
		if (GP->_left == A) {
			GP->_left = this;
		} else {
			assert(GP->_right == A);
			GP->_right = this;
		}
	}
}

// Assembly:
pushq %rax
movq 0x48(%rdi), %rcx
testq %rcx, %rcx
je 0x2857
movq 0x48(%rcx), %rax
cmpq %rdi, 0x38(%rcx)
je 0x281a
cmpq %rdi, 0x40(%rcx)
jne 0x2876
movq 0x38(%rdi), %rdx
movq %rcx, 0x38(%rdi)
movq %rdi, 0x48(%rcx)
movq %rdx, 0x40(%rcx)
jmp 0x282a
movq 0x40(%rdi), %rdx
movq %rcx, 0x40(%rdi)
movq %rdi, 0x48(%rcx)
movq %rdx, 0x38(%rcx)
testq %rdx, %rdx
je 0x2833
movq %rcx, 0x48(%rdx)
movq %rax, 0x48(%rdi)
testq %rax, %rax
je 0x2855
cmpq %rcx, 0x38(%rax)
je 0x284e
cmpq %rcx, 0x40(%rax)
jne 0x2895
addq $0x40, %rax
jmp 0x2852
addq $0x38, %rax
movq %rdi, (%rax)
popq %rax
retq
leaq 0x1908(%rip), %rdi      # 0x4166
leaq 0x17e8(%rip), %rsi      # 0x404d
leaq 0x190d(%rip), %rcx      # 0x4179
movl $0x79, %edx
callq 0x20e0
leaq 0x1919(%rip), %rdi      # 0x4196
leaq 0x17c9(%rip), %rsi      # 0x404d
leaq 0x18ee(%rip), %rcx      # 0x4179
movl $0x85, %edx
callq 0x20e0
leaq 0x1907(%rip), %rdi      # 0x41a3
leaq 0x17aa(%rip), %rsi      # 0x404d
leaq 0x18cf(%rip), %rcx      # 0x4179
movl $0x93, %edx
callq 0x20e0
// File: /workspace/github_cpp_makefile_star2_O1/jcipar[P]stack-distance/src/rank-tree.cpp
// Function: RankTreeNode::unlink()
void RankTreeNode::unlink() {
	assert(leaf());
	if (_parent == nullptr) {
		return;
	}
	if (_parent->_right == this) {
		_parent->_right = nullptr;
	} else {
		assert(_parent->_left == this);
		_parent->_left = nullptr;
	}
	_parent->fixWeights();
}

// Assembly:
pushq %rax
movq 0x40(%rdi), %rcx
orq 0x38(%rdi), %rcx
jne 0x2988
movq %rdi, %rax
movq 0x48(%rdi), %rdi
testq %rdi, %rdi
je 0x2975
cmpq %rax, 0x40(%rdi)
je 0x2977
cmpq %rax, 0x38(%rdi)
jne 0x29a7
leaq 0x38(%rdi), %rax
jmp 0x297b
popq %rax
retq
leaq 0x40(%rdi), %rax
movq $0x0, (%rax)
popq %rax
jmp 0x29c6
leaq 0x1825(%rip), %rdi      # 0x41b4
leaq 0x16b7(%rip), %rsi      # 0x404d
leaq 0x1843(%rip), %rcx      # 0x41e0
movl $0xaf, %edx
callq 0x20e0
leaq 0x184e(%rip), %rdi      # 0x41fc
leaq 0x1698(%rip), %rsi      # 0x404d
leaq 0x1824(%rip), %rcx      # 0x41e0
movl $0xb6, %edx
callq 0x20e0
// File: /workspace/github_cpp_makefile_star2_O1/jcipar[P]stack-distance/src/rank-tree.cpp
// Function: RankTreeNode::fixWeights()
int64_t RankTreeNode::leftWeight() {
	if (_left != nullptr) {
		return _left->_subtreeWeight;
	} else {
		return 0;
	}
}

// Assembly:
movq 0x38(%rdi), %rax
testq %rax, %rax
je 0x29d5
movq 0x20(%rax), %rax
jmp 0x29d7
xorl %eax, %eax
movq 0x40(%rdi), %rcx
testq %rcx, %rcx
je 0x29e6
movq 0x20(%rcx), %rcx
jmp 0x29e8
xorl %ecx, %ecx
addq 0x28(%rdi), %rax
addq %rcx, %rax
movq %rax, 0x20(%rdi)
movq 0x48(%rdi), %rdi
testq %rdi, %rdi
jne 0x29c6
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/jcipar[P]stack-distance/src/rank-tree.cpp
// Function: RankTreeNode::fixPriority()
bool RankTreeNode::fixPriority() {
	while(_parent != nullptr
		  and _parent->_priority < _priority) {
		promote();
	}
	if (_parent == nullptr) {
		return true;
	} else {
		return false;
	}
}

// Assembly:
movq 0x48(%rdi), %rcx
testq %rcx, %rcx
sete %al
je 0x2a75
pushq %rbx
movq %rdi, %rbx
movl 0x30(%rcx), %ecx
cmpl 0x30(%rbx), %ecx
jge 0x2a74
movq %rbx, %rdi
callq 0x27ee
movq 0x48(%rbx), %rcx
testq %rcx, %rcx
sete %al
jne 0x2a58
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/jcipar[P]stack-distance/src/rank-tree.cpp
// Function: RankTreeNode::leftChildRank(long)
int64_t RankTreeNode::leftChildRank(int64_t rank) {
	if (root()) {
		return rank;
	} else if (leftChild()) {
		return _parent->leftChildRank(rank);
	} else {
		assert(rightChild());
		return _parent->rightChildRank(rank);
	}
}

// Assembly:
pushq %rax
movq %rdi, %rax
movq 0x48(%rdi), %rdi
testq %rdi, %rdi
je 0x2a95
cmpq %rax, 0x38(%rdi)
je 0x2a77
cmpq %rax, 0x40(%rdi)
jne 0x2a9a
popq %rax
jmp 0x2aba
movq %rsi, %rax
popq %rcx
retq
leaq 0x16f5(%rip), %rdi      # 0x4196
leaq 0x15a5(%rip), %rsi      # 0x404d
leaq 0x1764(%rip), %rcx      # 0x4213
movl $0xdd, %edx
callq 0x20e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/jcipar[P]stack-distance/src/rank-tree.cpp
// Function: RankTreeNode::rightChildRank(long)
int64_t RankTreeNode::rightChildRank(int64_t rank) {
	if (root()) {
		return _weight + rank + leftWeight();
	} else if (leftChild()) {
		return _parent->leftChildRank(_weight + rank + leftWeight());
	} else {
		assert(rightChild());
		return _parent->rightChildRank(_weight + rank + leftWeight());
	}
}

// Assembly:
pushq %rax
movq %rdi, %rax
movq 0x48(%rdi), %rdi
testq %rdi, %rdi
je 0x2aed
cmpq %rax, 0x38(%rdi)
je 0x2b00
cmpq %rax, 0x40(%rdi)
jne 0x2b28
movq 0x38(%rax), %rcx
testq %rcx, %rcx
je 0x2ae2
movq 0x20(%rcx), %rcx
jmp 0x2ae4
xorl %ecx, %ecx
addq 0x28(%rax), %rsi
addq %rcx, %rsi
jmp 0x2abb
addq 0x28(%rax), %rsi
movq 0x38(%rax), %rax
testq %rax, %rax
je 0x2b13
movq 0x20(%rax), %rax
jmp 0x2b15
addq 0x28(%rax), %rsi
movq 0x38(%rax), %rax
testq %rax, %rax
je 0x2b1d
movq 0x20(%rax), %rax
jmp 0x2b1f
xorl %eax, %eax
addq %rax, %rsi
movq %rsi, %rax
popq %rcx
retq
xorl %eax, %eax
addq %rax, %rsi
popq %rax
jmp 0x2a76
leaq 0x1667(%rip), %rdi      # 0x4196
leaq 0x1517(%rip), %rsi      # 0x404d
leaq 0x1703(%rip), %rcx      # 0x4240
movl $0xe9, %edx
callq 0x20e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/jcipar[P]stack-distance/src/rank-tree.cpp
// Function: RankTree::InsertNode(RankTreeNode*)
void RankTree::InsertNode(RankTreeNode* node) {
	if (_root == nullptr) {
		_root = node;
	} else {
		auto first_ = first();
		first_->_left = node;
		node->_parent = first_;
		if(node->fixPriority()) {
			_root = node;
		}
	}
	node->fixWeights();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rax
testq %rax, %rax
je 0x2c90
movq %rax, %rcx
movq 0x38(%rax), %rax
testq %rax, %rax
jne 0x2c70
movq %rbx, 0x38(%rcx)
movq %rcx, 0x48(%rbx)
movq %rbx, %rdi
callq 0x2a48
testb %al, %al
je 0x2c93
movq %rbx, (%r14)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x29c6
// File: /workspace/github_cpp_makefile_star2_O1/jcipar[P]stack-distance/src/rank-tree.cpp
// Function: RankTree::check()
void RankTree::check() {
	if (_root != nullptr) {
		_root->checkPriorities(_root->_priority);
		_root->checkParentPointers(nullptr);
		_root->checkWeights();
		std::set<RankTreeNode*> nodes;
		_root->checkUniqueness(nodes);
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x2d2b
movl 0x30(%rdi), %esi
callq 0x26b4
movq (%rbx), %rdi
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x2702
movq (%rbx), %rdi
callq 0x264a
leaq 0x10(%rsp), %rax
movl $0x0, (%rax)
movq %r14, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %r14, 0x20(%rax)
movq (%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x274a
leaq 0x8(%rsp), %rdi
callq 0x2dda
addq $0x38, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2dda
movq %rbx, %rdi
callq 0x2210
// File: /workspace/github_cpp_makefile_star2_O1/jcipar[P]stack-distance/src/rank-tree.cpp
// Function: RankTree::Remove(RankTreeNode*)
void RankTree::Remove(RankTreeNode* node) {
	auto newRoot = node->makeLeaf();
	if (newRoot != nullptr) {
		_root = newRoot;
	}
	if (_root == node) {
		_root = nullptr;
	} else {
		node->unlink();
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x29fe
testq %rax, %rax
je 0x2d62
movq %rax, (%r14)
cmpq %rbx, (%r14)
je 0x2d76
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x294c
movq $0x0, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop