LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/nmmmnu[P]HM3/net/test/test_selector_impl.h
// Function: main
int main(){
	int const fd1 = net::socket_create(net::SOCKET_TCP{},  "localhost.not.used.yet", 2000);
	int const fd2 = net::socket_create(net::SOCKET_TCP{},  "localhost.not.used.yet", 2002);
	int const fd3 = net::socket_create(net::SOCKET_UNIX{}, "/tmp/echo");

	net::AsyncLoop<MySelector, MyWorker> loop( MySelector{ 4 }, myWorkerFactory(), { fd1, fd2, fd3 } );

	while(loop.process());
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x1100, %rsp           # imm = 0x1100
leaq 0x2bd5(%rip), %r14      # 0x502c
movq %r14, %rdi
movl $0x7d0, %esi            # imm = 0x7D0
xorl %edx, %edx
movl $0x7, %ecx
callq 0x4869
movl %eax, %ebx
movq %r14, %rdi
movl $0x7d2, %esi            # imm = 0x7D2
xorl %edx, %edx
movl $0x7, %ecx
callq 0x4869
movl %eax, %ebp
leaq 0x2bb9(%rip), %rdi      # 0x5043
xorl %esi, %esi
movl $0x1, %edx
callq 0x498d
movl %eax, %r14d
leaq 0x28(%rsp), %rdi
movl $0x4, %esi
callq 0x3c3c
leaq 0x8(%rsp), %rdi
callq 0x2824
leaq 0x5cb8(%rip), %rax      # 0x8171
leaq 0x8(%rsp), %rdx
movq %rax, 0x18(%rdx)
leaq 0x44(%rsp), %rax
movl %ebx, (%rax)
movl %ebp, 0x4(%rax)
movl %r14d, 0x8(%rax)
leaq 0x50(%rsp), %rcx
movq %rax, (%rcx)
movq $0x3, 0x8(%rcx)
leaq 0x60(%rsp), %rdi
leaq 0x28(%rsp), %rsi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2580
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x250c
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
leaq 0x28(%rsp), %rdi
callq 0x3ea8
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0x26c6
testb %al, %al
jne 0x251b
leaq 0x60(%rsp), %rdi
callq 0x27aa
xorl %eax, %eax
addq $0x1100, %rsp           # imm = 0x1100
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x255e
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
jmp 0x255e
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3ea8
jmp 0x2577
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x27aa
movq %rbx, %rdi
callq 0x2280
nop
// File: /workspace/github_cpp_makefile_star2_O3/nmmmnu[P]HM3/net/asyncloop_impl.h
// Function: net::AsyncLoop<net::selector::PollSelector, net::worker::KeyValueWorker<net::protocol::RedisProtocol, KeyValueMockAdapter>>::process()
bool AsyncLoop<SELECTOR, WORKER>::process(){
	using WaitStatus = selector::WaitStatus;
	using FDStatus   = selector::FDStatus;

	keepProcessing_ = true;

	log_("poll()-ing...");
	const WaitStatus status = selector_.wait(WAIT_TIMEOUT_MS);

	if (status == WaitStatus::ERROR){
		log_("poll() error");

		return false;
	}

	if (status == WaitStatus::NONE){
		// idle loop, check for expired conn
		expireFD_();
		return true;
	}

	for(uint32_t i = 0; i < selector_.getFDStatusCount(); ++i){
		const auto &t = selector_.getFDStatus(i);

		switch(t.status){
		case FDStatus::READ:
			handleRead_( t.fd );
			break;

		case FDStatus::WRITE:
			handleWrite_( t.fd );
			break;

		case FDStatus::ERROR:
			handleDisconnect_( t.fd, DisconnectStatus::ERROR );
			break;

		case FDStatus::STOP:
			goto break2;

		case FDStatus::NONE:
		default:
			break;

		}
	}

	break2: // label for goto... ;)

	return keepProcessing_;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movb $0x1, 0x8c(%rdi)
movl 0x88(%rdi), %edx
leaq 0x29c8(%rip), %rdi      # 0x50a9
leaq 0x29a6(%rip), %rsi      # 0x508e
xorl %eax, %eax
callq 0x2040
movq %rbx, %rdi
movl $0x1388, %esi           # imm = 0x1388
callq 0x3f30
cmpl $0x1, %eax
je 0x2725
cmpl $0x2, %eax
jne 0x2731
movl 0x88(%rbx), %edx
leaq 0x2996(%rip), %rdi      # 0x50a9
leaq 0x2982(%rip), %rsi      # 0x509c
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x2040
jmp 0x27a2
movq %rbx, %rdi
callq 0x2ad4
movb $0x1, %bl
jmp 0x27a2
movq %rbx, %rdi
callq 0x3f24
testl %eax, %eax
je 0x279c
xorl %ebp, %ebp
leaq 0x28be(%rip), %r14      # 0x5004
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3f5a
movq %rax, %rcx
shrq $0x20, %rcx
decl %ecx
cmpl $0x3, %ecx
ja 0x278e
movslq (%r14,%rcx,4), %rcx
addq %r14, %rcx
jmpq *%rcx
movq %rbx, %rdi
movl %eax, %esi
callq 0x2b28
jmp 0x278e
movq %rbx, %rdi
movl %eax, %esi
movl $0x1, %edx
callq 0x2cf8
jmp 0x278e
movq %rbx, %rdi
movl %eax, %esi
callq 0x2c1e
incl %ebp
movq %rbx, %rdi
callq 0x3f24
cmpl %eax, %ebp
jb 0x2746
movb 0x8c(%rbx), %bl
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/nmmmnu[P]HM3/net/asyncloop.h
// Function: net::AsyncLoop<net::selector::PollSelector, net::worker::KeyValueWorker<net::protocol::RedisProtocol, KeyValueMockAdapter>>::log_(char const*, int) const
void log_(const char *s, int const fd = -1) const{
		if (fd < 0)
			printf("%-40s | clients: %5u |\n",         s, connectedClients_);
		else
			printf("%-40s | clients: %5u | fd: %5d\n", s, connectedClients_, fd);
	}

// Assembly:
movl %edx, %ecx
movl 0x88(%rdi), %edx
testl %ecx, %ecx
js 0x2ac6
leaq 0x2602(%rip), %rdi      # 0x50c1
xorl %eax, %eax
jmp 0x2040
leaq 0x25dc(%rip), %rdi      # 0x50a9
xorl %eax, %eax
jmp 0x2040
// File: /workspace/github_cpp_makefile_star2_O3/nmmmnu[P]HM3/net/asyncloop_impl.h
// Function: net::AsyncLoop<net::selector::PollSelector, net::worker::KeyValueWorker<net::protocol::RedisProtocol, KeyValueMockAdapter>>::expireFD_()
void AsyncLoop<SELECTOR, WORKER>::expireFD_(){
	for(const auto &p : clients_){
		int const fd = p.first;
		auto &c = p.second;

		if (c.expired(conf_connectionTimeout_)){
			handleDisconnect_(fd, DisconnectStatus::TIMEOUT);
			// iterator is invalid now...
			return;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x60(%rdi), %r14
movq (%r14), %r14
testq %r14, %r14
je 0x2b1c
movl 0x8(%r14), %ebp
movl 0x38(%r14), %r15d
addl 0x90(%rbx), %r15d
callq 0x45e0
cmpl %eax, %r15d
jae 0x2ae2
movq %rbx, %rdi
movl %ebp, %esi
movl $0x2, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2cf8
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/nmmmnu[P]HM3/net/asyncloop_impl.h
// Function: net::AsyncLoop<net::selector::PollSelector, net::worker::KeyValueWorker<net::protocol::RedisProtocol, KeyValueMockAdapter>>::handleRead_(int)
void AsyncLoop<SELECTOR, WORKER>::handleRead_(int const fd){
	if ( isServerFD_(fd) ){
		while (handleConnect_(fd));
		return;
	}

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

	auto it = clients_.find(fd);

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

	auto &buffer = it->second;

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

	ssize_t const size = ::read(fd, inputBuffer_, BUFFER_CAPACITY);

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

	if (buffer.size() + (size_t) size > conf_maxPacketSize_)
		return handleDisconnect_(fd, DisconnectStatus::ERROR);

	buffer.push(size, inputBuffer_);

	buffer.restartTimer();

	handleWorker_(fd, buffer);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movl %esi, 0x8(%rsp)
leaq 0xc(%rsp), %rdx
movl %esi, (%rdx)
movq 0x38(%rdi), %rdi
movq 0x40(%rbx), %rsi
callq 0x2e59
cmpq 0x40(%rbx), %rax
je 0x2b6a
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2d58
testb %al, %al
jne 0x2b57
jmp 0x2c11
leaq 0x50(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3264
testq %rax, %rax
je 0x2bbf
movq %rax, %r14
movl 0x8(%rsp), %edi
leaq 0xa0(%rbx), %r15
movl $0x1000, %edx           # imm = 0x1000
movq %r15, %rsi
callq 0x2210
testq %rax, %rax
jle 0x2bd2
movq 0x20(%r14), %rcx
addq %rax, %rcx
subq 0x10(%r14), %rcx
cmpq 0x98(%rbx), %rcx
jbe 0x2be3
movl 0x8(%rsp), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x2bcb
movl 0x8(%rsp), %esi
movq %rbx, %rdi
movl $0x5, %edx
callq 0x2cf8
jmp 0x2c11
movl 0x8(%rsp), %esi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x2da8
jmp 0x2c11
leaq 0x10(%r14), %r12
movq %r14, %rdi
addq $0x18, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x2060
callq 0x45e0
movl %eax, 0x38(%r14)
movl 0x8(%rsp), %esi
movq %rbx, %rdi
movq %r12, %rdx
callq 0x2de0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, (%rsp)
leaq 0x4(%rsp), %rdx
movl %esi, (%rdx)
movq 0x38(%rdi), %rdi
movq 0x40(%rbx), %rsi
callq 0x2e59
cmpq 0x40(%rbx), %rax
jne 0x2c80
leaq 0x50(%rbx), %rdi
movq %rsp, %rsi
callq 0x3264
testq %rax, %rax
je 0x2c70
movq %rax, %r14
movq 0x10(%rax), %rsi
movq 0x20(%rax), %rdx
subq %rsi, %rdx
jne 0x2c88
movl (%rsp), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x2c7b
movl (%rsp), %esi
movq %rbx, %rdi
movl $0x5, %edx
callq 0x2cf8
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl (%rsp), %edi
addq 0x18(%r14), %rsi
callq 0x20b0
testq %rax, %rax
jle 0x2cbe
movq 0x10(%r14), %rcx
movq 0x20(%r14), %rdx
subq %rcx, %rdx
cmpq %rax, %rdx
jb 0x2cd5
jne 0x2cce
movq $0x0, 0x20(%r14)
movq 0x18(%r14), %rax
movb $0x0, (%rax)
xorl %ecx, %ecx
jmp 0x2cd1
movl (%rsp), %esi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x2da8
jmp 0x2c80
addq %rax, %rcx
movq %rcx, 0x10(%r14)
callq 0x45e0
movl %eax, 0x38(%r14)
movq 0x20(%r14), %rax
cmpq 0x10(%r14), %rax
jne 0x2c80
movl (%rsp), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x4008
jmp 0x2c80
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4036
leaq 0x50(%r14), %rdi
movq %r15, %rsi
callq 0x3b4e
decl 0x88(%r14)
movl %ebx, %edi
callq 0x474d
cmpl $0x7, %ebp
ja 0x2d4c
movl %ebp, %eax
leaq 0x25f1(%rip), %rcx      # 0x532c
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
movq %r14, %rdi
movl %ebx, %edx
callq 0x2aac
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x477d
movl %eax, %ebx
testl %eax, %eax
js 0x2d9b
movq %r14, %rdi
movl %ebx, %esi
callq 0x2efe
testb %al, %al
je 0x2d83
leaq 0x2360(%rip), %rsi      # 0x50e1
jmp 0x2d91
movl %ebx, %edi
callq 0x474d
leaq 0x2358(%rip), %rsi      # 0x50e9
movq %r14, %rdi
movl %ebx, %edx
callq 0x2aac
testl %ebx, %ebx
setns %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2dbc
jne 0x2dca
xorl %ebp, %ebp
jmp 0x2dcf
movl $0x1, %ebp
callq 0x469c
testb %al, %al
je 0x2dcf
popq %rbx
popq %r14
popq %rbp
retq
movq %r14, %rdi
movl %ebx, %esi
movl %ebp, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x2cf8
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x32c0
cmpl $0x5, %eax
ja 0x2e10
movl %eax, %eax
leaq 0x2211(%rip), %rcx      # 0x5014
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %eax, %eax
jmp 0x2e51
movq %r14, %rdi
movl %ebx, %esi
movl $0x4, %edx
jmp 0x2e40
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
jmp 0x2e2f
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x4008
jmp 0x2e4f
movq %r14, %rdi
movl %ebx, %esi
movl $0x3, %edx
callq 0x2cf8
jmp 0x2e4f
movb $0x0, 0x8c(%r14)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %r14d
movq %rdi, %rbx
movl %esi, 0xc(%rsp)
movl 0x88(%rdi), %ebp
incl %ebp
callq 0x3f24
cmpl %eax, %ebp
jae 0x2f4d
xorl %ebp, %ebp
movq %rbx, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0x3f92
testb %al, %al
je 0x2f4f
leaq 0x50(%rbx), %rdi
leaq 0xc(%rsp), %rsi
callq 0x2f5a
incl 0x88(%rbx)
movb $0x1, %bpl
jmp 0x2f4f
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3764
movl $0x4, %esi
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
movq %r12, %rcx
cmpq $0x63, %rcx
jbe 0x375d
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x3762
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x3764
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x3727
addl $-0x3, %esi
jmp 0x3764
addl $-0x2, %esi
jmp 0x3764
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 0x3875
movq (%r13), %rax
movq 0x8(%r13), %rdx
testq %rdx, %rdx
sete %cl
testq %rax, %rax
sete %sil
orb %cl, %sil
jne 0x37b8
movq %r14, %rdi
movq %rax, %rsi
callq 0x2060
movq 0x8(%rsp), %rax
cmpq %rbp, %rax
je 0x37cd
movq 0x18(%rsp), %rsi
incq %rsi
movq %rax, %rdi
callq 0x21a0
leaq 0x1950(%rip), %rsi      # 0x5124
movq %rbx, %rdi
callq 0x3836
movq (%r15), %rdx
testq %rdx, %rdx
je 0x37f5
movq 0x8(%r15), %rsi
testq %rsi, %rsi
je 0x37f5
movq %r14, %rdi
callq 0x2060
leaq 0x1928(%rip), %rsi      # 0x5124
movq %rbx, %rdi
callq 0x3836
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 0x382d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x2280
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x397a
movl $0x4, %esi
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
movq %r12, %rcx
cmpq $0x63, %rcx
jbe 0x3973
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x3978
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x397a
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x393d
addl $-0x3, %esi
jmp 0x397a
addl $-0x2, %esi
jmp 0x397a
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 0x3875
movq (%r13), %rax
movq 0x8(%r13), %rdx
testq %rdx, %rdx
sete %cl
testq %rax, %rax
sete %sil
orb %cl, %sil
jne 0x39ce
movq %r15, %rdi
movq %rax, %rsi
callq 0x2060
movq 0x8(%rsp), %rax
cmpq %rbp, %rax
je 0x39e3
movq 0x18(%rsp), %rsi
incq %rsi
movq %rax, %rdi
callq 0x21a0
leaq 0x173a(%rip), %rsi      # 0x5124
movq %rbx, %rdi
callq 0x3836
movq (%r14), %r15
movq 0x8(%r14), %r14
cmpq %r14, %r15
je 0x3a0f
movq %rbx, %rdi
movq %r15, %rsi
callq 0x36e2
addq $0x10, %r15
jmp 0x39f9
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 0x3a38
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3f78
testb $0x1, %al
jne 0x3f84
andl $0x4, %eax
shlq $0x1f, %rax
jmp 0x3f8e
movabsq $0x300000000, %rax      # imm = 0x300000000
jmp 0x3f8e
movabsq $0x100000000, %rax      # imm = 0x100000000
orq %rcx, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O3/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:
movq (%rdi), %rcx
movq 0x8(%rdi), %rdi
xorl %eax, %eax
subq %rcx, %rdi
je 0x4007
pushq %rbx
sarq $0x3, %rdi
movl $0x1, %r9d
xorl %r10d, %r10d
xorl %r8d, %r8d
movl (%rcx,%rax,8), %r11d
cmpl %esi, %r11d
je 0x3fe8
testb $0x1, %r10b
sete %bl
testl %r11d, %r11d
sets %r11b
testb %r11b, %bl
cmovnel %eax, %r8d
movzbl %r10b, %r10d
cmovnel %r9d, %r10d
incl %eax
cmpq %rax, %rdi
ja 0x3fb1
testb $0x1, %r10b
jne 0x3feb
xorl %eax, %eax
jmp 0x4006
movl %eax, %r8d
movl %r8d, %eax
movl %esi, (%rcx,%rax,8)
xorl %esi, %esi
cmpl $0x1, %edx
sete %sil
leal (%rsi,%rsi,2), %edx
incl %edx
movw %dx, 0x4(%rcx,%rax,8)
movb $0x1, %al
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 (%rsi), %rax
cmpq (%rdi), %rax
jae 0x4387
movq 0x8(%rdi), %rcx
addq %rax, %rcx
incq %rax
xorl %edx, %edx
movzbl (%rcx,%rdx), %r8d
cmpl $0x2b, %r8d
je 0x4367
cmpl $0x2d, %r8d
je 0x4367
leal -0x3a(%r8), %r9d
cmpb $-0xa, %r9b
jb 0x438c
movb %r8b, 0xf(%rsp,%rdx)
leaq (%rax,%rdx), %r9
movq %r9, (%rsi)
leaq 0x1(%rdx), %r8
cmpq (%rdi), %r9
jae 0x438f
cmpq $0x7, %rdx
movq %r8, %rdx
jb 0x434c
jmp 0x438f
xorl %r8d, %r8d
jmp 0x438f
movq %rdx, %r8
movb $0x0, 0xf(%rsp,%r8)
leaq 0xf(%rsp), %rdi
callq 0x2250
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x43d3
movq 0x8(%rdi), %rdi
movl $0x2, %eax
cmpb $0xd, (%rdi,%rcx)
jne 0x43d3
cmpb $0xa, (%rdi,%rdx)
jne 0x43d3
addq $0x2, %rcx
movq %rcx, (%rsi)
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdx), %rax
leaq 0x1(%rax), %rcx
leaq 0xd39(%rip), %r12       # 0x5126
movl $0x1, %ebp
cmpq (%rsi), %rcx
jbe 0x43fb
xorl %eax, %eax
jmp 0x4437
movq %rdx, %r14
movq %rsi, %r15
movq 0x8(%rsi), %rdx
cmpb $0x24, (%rdx,%rax)
jne 0x4430
movq %rcx, (%r14)
addq $0x2, %rax
cmpq (%r15), %rax
ja 0x43f7
movq %r15, %rdi
movq %r14, %rsi
callq 0x4334
leal -0x4001(%rax), %ecx
cmpl $0xffffc000, %ecx       # imm = 0xFFFFC000
jae 0x444d
xorl %eax, %eax
movl $0x2, %ebp
movl %ebp, (%rbx)
movq %rax, 0x8(%rbx)
movq %r12, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rcx
leaq 0x1(%rcx), %rsi
cmpq (%r15), %rsi
ja 0x43f7
movq 0x8(%r15), %rdx
cmpb $0xd, (%rdx,%rcx)
jne 0x4430
cmpb $0xa, (%rdx,%rsi)
jne 0x4430
cltq
leaq (%rcx,%rax), %rsi
addq $0x2, %rsi
movq %rsi, (%r14)
movq (%r15), %r8
cmpq %r8, %rsi
ja 0x43f7
leaq 0x1(%rsi), %rdi
cmpq %r8, %rdi
ja 0x43f7
cmpb $0xd, (%rdx,%rsi)
jne 0x4430
cmpb $0xa, (%rdx,%rdi)
jne 0x44b0
addq $0x2, %rcx
addq $0x2, %rsi
movq %rsi, (%r14)
addq %rcx, %rdx
xorl %ebp, %ebp
movq %rdx, %r12
jmp 0x4437
movl $0x2, %ebp
jmp 0x43f7
// File: /workspace/github_cpp_makefile_star2_O3/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 0x47d8
movzwl 0xe(%rsp), %eax
andl $0x1, %eax
je 0x47d8
movl %ebp, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2210
jmp 0x47ea
callq 0x2030
movl $0xb, (%rax)
movq $-0x1, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x47f5
movq %rax, %rdi
callq 0x2818
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4844
movzwl 0xe(%rsp), %eax
andl $0x4, %eax
je 0x4844
movl %ebp, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x20b0
jmp 0x4856
callq 0x2030
movl $0xb, (%rax)
movq $-0x1, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x4861
movq %rax, %rdi
callq 0x2818
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4975
movl %eax, %r14d
testb $0x2, %r15b
je 0x48cb
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 0x48cb
movl %r14d, %edi
callq 0x22a0
testb $0x1, %r15b
je 0x48e5
movl %r14d, %edi
callq 0x46b4
testb %al, %al
jne 0x48e5
movl %r14d, %edi
callq 0x22a0
testb $0x4, %r15b
je 0x491a
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 0x491a
movl %r14d, %edi
callq 0x22a0
testb $0x8, %r15b
je 0x494f
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 0x494f
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 0x4a29
jmp 0x497a
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_O3/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 0x4a16
movl $0x1, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x2080
testl %eax, %eax
js 0x4a11
movl %eax, %ebp
testb $0x1, %r15b
je 0x49e1
movl %ebp, %edi
callq 0x46b4
testb %al, %al
jne 0x49e1
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 0x4a75
jmp 0x4a16
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_O3/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 %rbx
subq $0xe8, %rsp
cmpl $0x4, %edi
jle 0x26fb
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 0x2758
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 0x282c
addq $0x20, %rsp
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x25fc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21c0
leaq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
movl %ebp, %edx
callq 0x4258
leaq 0x8(%rsp), %rdi
callq 0x4336
leal (%r14,%rbx), %eax
cmpl %eax, %ebx
jae 0x263b
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movl %ebx, %esi
callq 0x436e
movl %eax, %ebp
testl %eax, %eax
jne 0x2661
incl %ebx
decl %r14d
jne 0x2624
leaq 0x8(%rsp), %rdi
callq 0x42c0
xorl %ebx, %ebx
movq 0x59a2(%rip), %rdi      # 0x7ff0
leaq 0x2a25(%rip), %rsi      # 0x507a
movl $0x12, %edx
callq 0x2210
jmp 0x26d7
movq 0x5988(%rip), %rdi      # 0x7ff0
leaq 0x29ce(%rip), %rsi      # 0x503d
movl $0x6, %edx
callq 0x2210
movq 0x5970(%rip), %rdi      # 0x7ff0
movl %ebp, %esi
callq 0x2340
movq %rax, %r14
leaq 0x29b3(%rip), %rsi      # 0x5044
movl $0x35, %edx
movq %rax, %rdi
callq 0x2210
movl %ebx, %esi
movq %r14, %rdi
callq 0x2100
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq %rax, %rdi
callq 0x2110
leaq 0x8(%rsp), %rdi
callq 0x4288
leaq 0x68(%rsp), %rdi
callq 0x2dcc
movl %ebx, %eax
addq $0xe8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x254c
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2250
movq %rax, %rbx
jmp 0x2745
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x274f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21c0
jmp 0x274f
movq %rax, %rbx
jmp 0x274f
jmp 0x2738
jmp 0x2738
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x4288
leaq 0x68(%rsp), %rdi
callq 0x2dcc
movq %rbx, %rdi
callq 0x2350
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
movq %rdi, %rbx
movq 0x4b73(%rip), %r14      # 0x6fd0
leaq 0x1ba0(%rip), %r15      # 0x4004
movl %esi, %ebp
movl %ebp, %eax
movl %esi, %r13d
movq %rax, (%rsp)
testl %eax, %eax
jle 0x2487
movl $0x2, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x21a0
decl %ebp
jne 0x2473
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x21a0
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
leaq 0x1b5d(%rip), %r12      # 0x4005
movq %r12, %rsi
callq 0x21a0
movq 0x20(%rbx), %rsi
movq %rbp, %rdi
callq 0x2150
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x21a0
movl 0x30(%rbx), %esi
movq %rbp, %rdi
callq 0x2200
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x25ea
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(%rbx), %rdi
testq %rdi, %rdi
je 0x2545
movq (%rsp), %r12
leal 0x1(%r12), %ebp
movl %ebp, %esi
callq 0x2448
jmp 0x2583
movq (%rsp), %r12
testl %r12d, %r12d
js 0x256a
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl $0x2, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x21a0
incl %ebp
cmpl %ebp, %r13d
jne 0x2553
movl $0x10, %edx
movq %r14, %rdi
leaq 0x1a8e(%rip), %rsi      # 0x4007
callq 0x21a0
leal 0x1(%r12), %ebp
leal 0x1(%r13), %esi
movq 0x40(%rbx), %rbx
testq %rbx, %rbx
jne 0x2466
testl %r12d, %r12d
js 0x25c3
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x4a2b(%rip), %rbx      # 0x6fd0
leaq 0x1a58(%rip), %r14      # 0x4004
movl $0x2, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21a0
incl %ebp
cmpl %ebp, %r13d
jne 0x25ac
movq 0x4a06(%rip), %rdi      # 0x6fd0
leaq 0x1a36(%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_O3/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 0x2614
cmpq %rax, 0x38(%rdi)
je 0x2622
cmpq %rax, 0x40(%rdi)
jne 0x2645
movq 0x38(%rax), %rax
testq %rax, %rax
je 0x2634
movq 0x20(%rax), %rsi
jmp 0x2b14
movq 0x38(%rax), %rax
testq %rax, %rax
je 0x263b
movq 0x20(%rax), %rax
retq
movq 0x38(%rax), %rax
testq %rax, %rax
je 0x263e
movq 0x20(%rax), %rsi
jmp 0x2ad0
xorl %esi, %esi
jmp 0x2b14
xorl %eax, %eax
retq
xorl %esi, %esi
jmp 0x2ad0
pushq %rax
leaq 0x1b49(%rip), %rdi      # 0x4196
leaq 0x19f9(%rip), %rsi      # 0x404d
leaq 0x1c13(%rip), %rcx      # 0x426e
movl $0xf5, %edx
callq 0x20e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2680
callq 0x2666
movq %rax, %r14
jmp 0x2683
xorl %r14d, %r14d
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0x2693
callq 0x2666
jmp 0x2695
xorl %eax, %eax
addq %r14, %rax
movq 0x20(%rbx), %rcx
addq 0x28(%rbx), %rax
cmpq %rax, %rcx
jne 0x26b0
movq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x1961(%rip), %rdi      # 0x4018
leaq 0x198f(%rip), %rsi      # 0x404d
leaq 0x199a(%rip), %rcx      # 0x405f
movl $0x48, %edx
callq 0x20e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r14
pushq %rbx
pushq %rax
movl %esi, %eax
movl 0x30(%rdi), %esi
cmpl %eax, %esi
jg 0x270a
movq %rdi, %rbx
leaq 0x30(%rdi), %r14
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x26f2
callq 0x26d0
movq 0x40(%rbx), %rbx
testq %rbx, %rbx
je 0x2729
leaq 0x30(%rbx), %rax
movl 0x30(%rbx), %esi
cmpl (%r14), %esi
movq %rax, %r14
jle 0x26e4
leaq 0x1973(%rip), %rdi      # 0x4084
leaq 0x1935(%rip), %rsi      # 0x404d
leaq 0x1981(%rip), %rcx      # 0x40a0
movl $0x4e, %edx
callq 0x20e0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x275b
movq %rdi, %rbx
movq 0x38(%rdi), %rdi
testq %rdi, %rdi
je 0x2750
movq %rbx, %rsi
callq 0x2732
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
jne 0x2736
popq %rbx
retq
leaq 0x1966(%rip), %rdi      # 0x40c8
leaq 0x18e4(%rip), %rsi      # 0x404d
leaq 0x196a(%rip), %rcx      # 0x40da
movl $0x59, %edx
callq 0x20e0
// File: /workspace/github_cpp_makefile_star2_O3/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), %rax
testq %rax, %rax
je 0x27b7
leaq 0x8(%rbx), %rdx
movq %rdx, %rcx
xorl %esi, %esi
cmpq %r14, 0x20(%rax)
setb %sil
cmovaeq %rax, %rcx
movq 0x10(%rax,%rsi,8), %rax
testq %rax, %rax
jne 0x2794
cmpq %rdx, %rcx
je 0x27b7
cmpq %r14, 0x20(%rcx)
jbe 0x27ef
movq %rsp, %rsi
movq %r14, (%rsi)
movq %rbx, %rdi
callq 0x2f5a
movq 0x38(%r14), %rdi
testq %rdi, %rdi
je 0x27d6
movq %rbx, %rsi
callq 0x277a
movq 0x40(%r14), %rdi
testq %rdi, %rdi
je 0x27e7
movq %rbx, %rsi
callq 0x277a
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x191b(%rip), %rdi      # 0x4111
leaq 0x1850(%rip), %rsi      # 0x404d
leaq 0x1923(%rip), %rcx      # 0x4127
movl $0x64, %edx
callq 0x20e0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2877
movq 0x48(%rcx), %rax
cmpq %rdi, 0x38(%rcx)
je 0x283a
cmpq %rdi, 0x40(%rcx)
jne 0x2896
movq 0x38(%rdi), %rdx
movq %rcx, 0x38(%rdi)
movq %rdi, 0x48(%rcx)
movq %rdx, 0x40(%rcx)
jmp 0x284a
movq 0x40(%rdi), %rdx
movq %rcx, 0x40(%rdi)
movq %rdi, 0x48(%rcx)
movq %rdx, 0x38(%rcx)
testq %rdx, %rdx
je 0x2853
movq %rcx, 0x48(%rdx)
movq %rax, 0x48(%rdi)
testq %rax, %rax
je 0x2875
cmpq %rcx, 0x38(%rax)
je 0x286e
cmpq %rcx, 0x40(%rax)
jne 0x28b5
addq $0x40, %rax
jmp 0x2872
addq $0x38, %rax
movq %rdi, (%rax)
popq %rax
retq
leaq 0x18e8(%rip), %rdi      # 0x4166
leaq 0x17c8(%rip), %rsi      # 0x404d
leaq 0x18ed(%rip), %rcx      # 0x4179
movl $0x79, %edx
callq 0x20e0
leaq 0x18f9(%rip), %rdi      # 0x4196
leaq 0x17a9(%rip), %rsi      # 0x404d
leaq 0x18ce(%rip), %rcx      # 0x4179
movl $0x85, %edx
callq 0x20e0
leaq 0x18e7(%rip), %rdi      # 0x41a3
leaq 0x178a(%rip), %rsi      # 0x404d
leaq 0x18af(%rip), %rcx      # 0x4179
movl $0x93, %edx
callq 0x20e0
// File: /workspace/github_cpp_makefile_star2_O3/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), %rax
orq 0x38(%rdi), %rax
jne 0x29d5
movq 0x48(%rdi), %rax
testq %rax, %rax
je 0x29d3
cmpq %rdi, 0x40(%rax)
je 0x2992
cmpq %rdi, 0x38(%rax)
jne 0x29f4
leaq 0x38(%rax), %rcx
jmp 0x2996
leaq 0x40(%rax), %rcx
movq $0x0, (%rcx)
movq 0x38(%rax), %rcx
testq %rcx, %rcx
je 0x29ac
movq 0x20(%rcx), %rcx
jmp 0x29ae
xorl %ecx, %ecx
movq 0x40(%rax), %rdx
testq %rdx, %rdx
je 0x29bd
movq 0x20(%rdx), %rdx
jmp 0x29bf
xorl %edx, %edx
addq 0x28(%rax), %rcx
addq %rdx, %rcx
movq %rcx, 0x20(%rax)
movq 0x48(%rax), %rax
testq %rax, %rax
jne 0x299d
popq %rax
retq
leaq 0x17d8(%rip), %rdi      # 0x41b4
leaq 0x166a(%rip), %rsi      # 0x404d
leaq 0x17f6(%rip), %rcx      # 0x41e0
movl $0xaf, %edx
callq 0x20e0
leaq 0x1801(%rip), %rdi      # 0x41fc
leaq 0x164b(%rip), %rsi      # 0x404d
leaq 0x17d7(%rip), %rcx      # 0x41e0
movl $0xb6, %edx
callq 0x20e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2a23
movq 0x20(%rax), %rax
jmp 0x2a25
xorl %eax, %eax
movq 0x40(%rdi), %rcx
testq %rcx, %rcx
je 0x2a34
movq 0x20(%rcx), %rcx
jmp 0x2a36
xorl %ecx, %ecx
addq 0x28(%rdi), %rax
addq %rcx, %rax
movq %rax, 0x20(%rdi)
movq 0x48(%rdi), %rdi
testq %rdi, %rdi
jne 0x2a14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbp
pushq %rbx
pushq %rax
movq 0x48(%rdi), %rax
testq %rax, %rax
je 0x2ac4
movq %rdi, %rbx
movl 0x30(%rax), %eax
cmpl 0x30(%rbx), %eax
setl %bpl
jge 0x2ac7
movq %rbx, %rdi
callq 0x280e
movq 0x48(%rbx), %rax
testq %rax, %rax
jne 0x2aa5
jmp 0x2ac7
movb $0x1, %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2aef
cmpq %rax, 0x38(%rdi)
je 0x2ad1
cmpq %rax, 0x40(%rdi)
jne 0x2af4
popq %rax
jmp 0x2b14
movq %rsi, %rax
popq %rcx
retq
leaq 0x169b(%rip), %rdi      # 0x4196
leaq 0x154b(%rip), %rsi      # 0x404d
leaq 0x170a(%rip), %rcx      # 0x4213
movl $0xdd, %edx
callq 0x20e0
nop