LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: superblocks[P]superblocks/utils.cpp
// Function: Superblocks::generateMTRandom(unsigned int, int, int)
int /*static*/ Superblocks::generateMTRandom(unsigned int s, int range_low, int range_high) 
{
	if( debug ) { 
		cout << "generateMTRandom: seed: " << s << endl;
		cout << "generateMTRandom: range_low: " << range_low << endl;
		cout << "generateMTRandom: range_high: " << range_high << endl;
	}
	random::mt19937 gen(s);
	random::uniform_int_distribution<> dist(range_low, range_high);
	int result = dist(gen);
	if( debug ) { cout << "generateMTRandom: result: " << result << endl; }	
	return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa00, %rsp            # imm = 0xA00
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x9f8(%rbp)
cmpl $0x0, (%rax)
je 0x3a83
movq 0x45d5(%rip), %rdi      # 0x7fd8
leaq 0x1b55(%rip), %rsi      # 0x555f
callq 0x2110
movq %rax, %rdi
movl -0xc(%rbp), %esi
callq 0x2190
movq %rax, %rdi
movq 0x45a4(%rip), %rsi      # 0x7fc8
callq 0x2130
movq 0x45a8(%rip), %rdi      # 0x7fd8
leaq 0x1b41(%rip), %rsi      # 0x5578
callq 0x2110
movq %rax, %rdi
movl -0x10(%rbp), %esi
callq 0x21f0
movq %rax, %rdi
movq 0x4577(%rip), %rsi      # 0x7fc8
callq 0x2130
movq 0x457b(%rip), %rdi      # 0x7fd8
leaq 0x1b32(%rip), %rsi      # 0x5596
callq 0x2110
movq %rax, %rdi
movl -0x14(%rbp), %esi
callq 0x21f0
movq %rax, %rdi
movq 0x454a(%rip), %rsi      # 0x7fc8
callq 0x2130
leaq -0x9e0(%rbp), %rdi
leaq -0xc(%rbp), %rsi
callq 0x3b10
movl -0x10(%rbp), %esi
movl -0x14(%rbp), %edx
leaq -0x9e8(%rbp), %rdi
callq 0x3b40
leaq -0x9e8(%rbp), %rdi
leaq -0x9e0(%rbp), %rsi
callq 0x3b90
movl %eax, %ecx
movq -0x9f8(%rbp), %rax
movl %ecx, -0x9ec(%rbp)
cmpl $0x0, (%rax)
je 0x3afc
movq 0x4505(%rip), %rdi      # 0x7fd8
leaq 0x1adb(%rip), %rsi      # 0x55b5
callq 0x2110
movq %rax, %rdi
movl -0x9ec(%rbp), %esi
callq 0x21f0
movq %rax, %rdi
movq 0x44d1(%rip), %rsi      # 0x7fc8
callq 0x2130
movl -0x9ec(%rbp), %eax
addq $0xa00, %rsp            # imm = 0xA00
popq %rbp
retq
nopl (%rax,%rax)
// File: superblocks[P]superblocks/set-red.cpp
// Function: Superblocks::init()
void Superblocks::init() {

  coin = "RED"; 
	coin_name = "Redcoin";

	hash_length = 64;

	// normal (step 0)
	reward[0] = 50;
		secondary_rand[0] = 1;
		cutout_start[0] = 6;
		cutout_length[0] = 7;
		secondary_rand_type[0] = SECONDARY_REWARD_PLUS_RAND_MINUS_X;
		secondary_rand_low[0] = 0;
		secondary_rand_high[0] = 100;
		secondary_rand_x[0] = 0;

	// superblock (step 1)
	seed_type[1] = SEED_WITH_PREVIOUS_BLOCK_HASH;
	cutout_start[1] = 1;
	cutout_length[1] = 7;
	rnd_range_low[1] = 0;
	rnd_range_high[1] = 99999;
	luck_type[1] = LUCK_WITH_MORE_THAN_X_AND_LESS_THAN_Y;
	luck_x[1] = 30000;
	luck_y[1] = 30006;
		secondary_rand[1] = 1;
		secondary_rand_type[1] = SECONDARY_REWARD_PLUS_RAND_MINUS_X;
		secondary_rand_low[1] = 0;
		secondary_rand_high[1] = 5000;
		secondary_rand_x[1] = 0;
	reward[1] = 5000;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x10(%rbp)
addq $0x18, %rdi
leaq 0x1811(%rip), %rsi      # 0x5e80
callq 0x21a0
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
leaq 0x1801(%rip), %rsi      # 0x5e84
callq 0x21a0
movq -0x10(%rbp), %rax
movl $0x40, 0x58(%rax)
movl $0x32, 0xd4(%rax)
movl $0x1, 0x84(%rax)
movl $0x6, 0x64(%rax)
movl $0x7, 0x6c(%rax)
movl $0x1, 0x8c(%rax)
movl $0x0, 0x94(%rax)
movl $0x64, 0x9c(%rax)
movl $0x0, 0xa4(%rax)
movl $0x2, 0x60(%rax)
movl $0x1, 0x68(%rax)
movl $0x7, 0x70(%rax)
movl $0x0, 0x78(%rax)
movl $0x1869f, 0x80(%rax)    # imm = 0x1869F
movl $0x3, 0xc0(%rax)
movl $0x7530, 0xc8(%rax)     # imm = 0x7530
movl $0x7536, 0xd0(%rax)     # imm = 0x7536
movl $0x1, 0x88(%rax)
movl $0x1, 0x90(%rax)
movl $0x0, 0x98(%rax)
movl $0x1388, 0xa0(%rax)     # imm = 0x1388
movl $0x0, 0xa8(%rax)
movl $0x1388, 0xd8(%rax)     # imm = 0x1388
addq $0x10, %rsp
popq %rbp
retq
// File: 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:
subq $0x1148, %rsp           # imm = 0x1148
movl $0x0, 0x1144(%rsp)
leaq 0x9b8b(%rip), %rdi      # 0xc064
movq %rdi, 0x10(%rsp)
movl $0x7d0, %esi            # imm = 0x7D0
xorl %edx, %edx
movl %edx, 0x20(%rsp)
movl $0x7, %ecx
movl %ecx, 0x1c(%rsp)
callq 0xae60
movq 0x10(%rsp), %rdi
movl 0x1c(%rsp), %ecx
movl 0x20(%rsp), %edx
movl %eax, 0x1140(%rsp)
movl $0x7d2, %esi            # imm = 0x7D2
callq 0xae60
movl 0x20(%rsp), %esi
movl %eax, 0x1138(%rsp)
leaq 0x9b54(%rip), %rdi      # 0xc07b
movl $0x1, %edx
callq 0xafb0
movl %eax, 0x1130(%rsp)
leaq 0x70(%rsp), %rdi
movl $0x4, %esi
callq 0x86a0
leaq 0x50(%rsp), %rdi
callq 0x2490
jmp 0x2553
movl 0x1140(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x1138(%rsp), %eax
movl %eax, 0x28(%rsp)
movl 0x1130(%rsp), %eax
movl %eax, 0x2c(%rsp)
leaq 0x24(%rsp), %rax
movq %rax, 0x30(%rsp)
movq $0x3, 0x38(%rsp)
xorl %r8d, %r8d
movl %r8d, %r9d
leaq 0x88(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x50(%rsp), %rdx
leaq 0x30(%rsp), %rcx
callq 0x2690
jmp 0x25ab
leaq 0x50(%rsp), %rdi
callq 0x2900
leaq 0x70(%rsp), %rdi
callq 0x8820
leaq 0x88(%rsp), %rdi
callq 0x2910
movb %al, 0xf(%rsp)
jmp 0x25d2
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x25dc
jmp 0x262f
jmp 0x25bf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
jmp 0x2606
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x2900
leaq 0x70(%rsp), %rdi
callq 0x8820
jmp 0x264b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x2a80
jmp 0x264b
leaq 0x88(%rsp), %rdi
callq 0x2a80
movl 0x1144(%rsp), %eax
addq $0x1148, %rsp           # imm = 0x1148
retq
movq 0x48(%rsp), %rdi
callq 0x2300
nopw %cs:(%rax,%rax)
nop
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movb $0x1, 0x8c(%rdi)
leaq 0x9795(%rip), %rsi      # 0xc0c6
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4650
movq 0x18(%rsp), %rdi
movl $0x1388, %esi           # imm = 0x1388
callq 0x88f0
movl %eax, 0x34(%rsp)
cmpl $0x2, 0x34(%rsp)
jne 0x2975
movq 0x18(%rsp), %rdi
leaq 0x9773(%rip), %rsi      # 0xc0d4
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4650
movb $0x0, 0x47(%rsp)
jmp 0x2a66
cmpl $0x1, 0x34(%rsp)
jne 0x2990
movq 0x18(%rsp), %rdi
callq 0x46c0
movb $0x1, 0x47(%rsp)
jmp 0x2a66
movl $0x0, 0x30(%rsp)
movq 0x18(%rsp), %rdi
movl 0x30(%rsp), %eax
movl %eax, 0x14(%rsp)
callq 0x4790
movl %eax, %ecx
movl 0x14(%rsp), %eax
cmpl %ecx, %eax
jae 0x2a53
movq 0x18(%rsp), %rdi
movl 0x30(%rsp), %esi
callq 0x8970
movq %rax, 0x20(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movl 0x4(%rax), %eax
movq %rax, 0x8(%rsp)
subq $0x4, %rax
ja 0x2a3f
movq 0x8(%rsp), %rax
leaq 0x9610(%rip), %rcx      # 0xc004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x18(%rsp), %rdi
movq 0x28(%rsp), %rax
movl (%rax), %esi
callq 0x47a0
jmp 0x2a41
movq 0x18(%rsp), %rdi
movq 0x28(%rsp), %rax
movl (%rax), %esi
callq 0x4900
jmp 0x2a41
movq 0x18(%rsp), %rdi
movq 0x28(%rsp), %rax
movl (%rax), %esi
movl $0x1, %edx
callq 0x4a50
jmp 0x2a41
jmp 0x2a55
jmp 0x2a3f
jmp 0x2a41
jmp 0x2a43
movl 0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
jmp 0x2998
jmp 0x2a55
movq 0x18(%rsp), %rax
movb 0x8c(%rax), %al
andb $0x1, %al
movb %al, 0x47(%rsp)
movb 0x47(%rsp), %al
andb $0x1, %al
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl %edx, 0x14(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpl $0x0, 0x14(%rsp)
jge 0x4693
movq 0x8(%rsp), %rax
movq 0x18(%rsp), %rsi
movl 0x88(%rax), %edx
leaq 0x7a57(%rip), %rdi      # 0xc0e1
movb $0x0, %al
callq 0x2040
jmp 0x46b5
movq 0x8(%rsp), %rax
movq 0x18(%rsp), %rsi
movl 0x88(%rax), %edx
movl 0x14(%rsp), %ecx
leaq 0x7a4b(%rip), %rdi      # 0xc0f9
movb $0x0, %al
callq 0x2040
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x8(%rsp)
addq $0x50, %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
callq 0x4b70
movq %rax, 0x30(%rsp)
movq 0x38(%rsp), %rdi
callq 0x4ba0
movq %rax, 0x28(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x4bd0
testb $0x1, %al
jne 0x470f
jmp 0x477f
leaq 0x30(%rsp), %rdi
callq 0x4bf0
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x20(%rsp)
movq 0x20(%rsp), %rcx
movl (%rcx), %ecx
movl %ecx, 0x1c(%rsp)
movq 0x20(%rsp), %rcx
addq $0x8, %rcx
movq %rcx, 0x10(%rsp)
movq 0x10(%rsp), %rdi
addq $0x28, %rdi
movl 0x90(%rax), %esi
callq 0x4c10
testb $0x1, %al
jne 0x4759
jmp 0x476e
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl $0x2, %edx
callq 0x4a50
jmp 0x477f
jmp 0x4770
leaq 0x30(%rsp), %rdi
callq 0x4c50
jmp 0x46fa
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, (%rsp)
movl 0x2c(%rsp), %esi
callq 0x4d80
testb $0x1, %al
jne 0x47c5
jmp 0x47e1
jmp 0x47c7
movq (%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x4e00
testb $0x1, %al
jne 0x47da
jmp 0x47dc
jmp 0x47c7
jmp 0x48ed
movq (%rsp), %rdi
addq $0x50, %rdi
leaq 0x2c(%rsp), %rsi
callq 0x4e90
movq (%rsp), %rdi
movq %rax, 0x20(%rsp)
addq $0x50, %rdi
callq 0x4ba0
movq %rax, 0x18(%rsp)
leaq 0x20(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x4ec0
testb $0x1, %al
jne 0x481f
jmp 0x4836
movq (%rsp), %rdi
movl 0x2c(%rsp), %esi
movl $0x5, %edx
callq 0x4a50
jmp 0x48ed
leaq 0x20(%rsp), %rdi
callq 0x4ee0
movq (%rsp), %rsi
addq $0x8, %rax
movq %rax, 0x10(%rsp)
movl 0x2c(%rsp), %edi
addq $0xa0, %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x2290
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jg 0x4883
movq (%rsp), %rdi
movl 0x2c(%rsp), %esi
movq 0x8(%rsp), %rdx
callq 0x4f00
jmp 0x48ed
movq 0x10(%rsp), %rdi
callq 0x4f70
movq (%rsp), %rcx
addq 0x8(%rsp), %rax
cmpq 0x98(%rcx), %rax
jbe 0x48b3
movq (%rsp), %rdi
movl 0x2c(%rsp), %esi
movl $0x1, %edx
callq 0x4a50
jmp 0x48ed
movq (%rsp), %rdx
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
addq $0xa0, %rdx
callq 0x4fa0
movq 0x10(%rsp), %rdi
addq $0x28, %rdi
callq 0x4fd0
movq (%rsp), %rdi
movl 0x2c(%rsp), %esi
movq 0x10(%rsp), %rdx
callq 0x5000
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movq 0x40(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movl 0x3c(%rsp), %esi
callq 0x4d80
testb $0x1, %al
jne 0x4926
jmp 0x492b
jmp 0x4a47
movq 0x8(%rsp), %rdi
addq $0x50, %rdi
leaq 0x3c(%rsp), %rsi
callq 0x4e90
movq 0x8(%rsp), %rdi
movq %rax, 0x30(%rsp)
addq $0x50, %rdi
callq 0x4ba0
movq %rax, 0x28(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x4ec0
testb $0x1, %al
jne 0x496b
jmp 0x4983
movq 0x8(%rsp), %rdi
movl 0x3c(%rsp), %esi
movl $0x5, %edx
callq 0x4a50
jmp 0x4a47
leaq 0x30(%rsp), %rdi
callq 0x4ee0
addq $0x8, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
callq 0x4f70
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
ja 0x49c5
movq 0x8(%rsp), %rdi
movl 0x3c(%rsp), %esi
movl $0x7, %edx
callq 0x4a50
jmp 0x4a47
movl 0x3c(%rsp), %eax
movl %eax, 0x4(%rsp)
movq 0x20(%rsp), %rdi
callq 0x6980
movl 0x4(%rsp), %edi
movq %rax, %rsi
movq 0x18(%rsp), %rdx
callq 0x20c0
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jg 0x4a0a
movq 0x8(%rsp), %rdi
movl 0x3c(%rsp), %esi
movq 0x10(%rsp), %rdx
callq 0x4f00
jmp 0x4a47
movq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x8290
movq 0x20(%rsp), %rdi
addq $0x28, %rdi
callq 0x4fd0
movq 0x20(%rsp), %rdi
callq 0x4f70
cmpq $0x0, %rax
jne 0x4a47
movq 0x8(%rsp), %rdi
movl 0x3c(%rsp), %esi
xorl %edx, %edx
callq 0x8b90
addq $0x48, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movl %edx, 0x18(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movl 0x1c(%rsp), %esi
callq 0x8350
movl 0x1c(%rsp), %edi
callq 0xac90
movl 0x18(%rsp), %eax
movq %rax, 0x10(%rsp)
subq $0x7, %rax
ja 0x4b61
movq 0x10(%rsp), %rax
leaq 0x7580(%rip), %rcx      # 0xc01c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %edx
leaq 0x7740(%rip), %rsi      # 0xc1f5
callq 0x4650
jmp 0x4b61
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %edx
leaq 0x7739(%rip), %rsi      # 0xc208
callq 0x4650
jmp 0x4b61
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %edx
leaq 0x7732(%rip), %rsi      # 0xc21b
callq 0x4650
jmp 0x4b61
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %edx
leaq 0x772e(%rip), %rsi      # 0xc22e
callq 0x4650
jmp 0x4b61
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %edx
leaq 0x7733(%rip), %rsi      # 0xc24a
callq 0x4650
jmp 0x4b61
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %edx
leaq 0x7737(%rip), %rsi      # 0xc265
callq 0x4650
jmp 0x4b61
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %edx
leaq 0x7742(%rip), %rsi      # 0xc287
callq 0x4650
jmp 0x4b61
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %edx
leaq 0x7751(%rip), %rsi      # 0xc2ad
callq 0x4650
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movl %esi, 0x14(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x14(%rsp), %edi
callq 0xad30
movl %eax, 0x10(%rsp)
cmpl $0x0, 0x10(%rsp)
jge 0x4e32
movb $0x0, 0x27(%rsp)
jmp 0x4e80
movq 0x8(%rsp), %rdi
movl 0x10(%rsp), %esi
callq 0x55a0
testb $0x1, %al
jne 0x4e46
jmp 0x4e5d
movq 0x8(%rsp), %rdi
movl 0x10(%rsp), %edx
leaq 0x72c3(%rip), %rsi      # 0xc119
callq 0x4650
jmp 0x4e7b
movl 0x10(%rsp), %edi
callq 0xac90
movq 0x8(%rsp), %rdi
movl 0x10(%rsp), %edx
leaq 0x72ab(%rip), %rsi      # 0xc121
callq 0x4650
movb $0x1, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x10(%rsp)
jge 0x4f46
callq 0xab80
testb $0x1, %al
jne 0x4f2f
jmp 0x4f31
jmp 0x4f5e
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl $0x1, %edx
callq 0x4a50
jmp 0x4f5e
cmpq $0x0, 0x10(%rsp)
jne 0x4f5e
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %esi
xorl %edx, %edx
callq 0x4a50
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
movq %rdx, 0x18(%rsp)
movq 0x28(%rsp), %rdi
movq %rdi, (%rsp)
addq $0x18, %rdi
movq 0x18(%rsp), %rsi
callq 0x6880
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %eax
movq %rax, 0x8(%rsp)
subq $0x5, %rax
ja 0x50b2
movq 0x8(%rsp), %rax
leaq 0x6ff4(%rip), %rcx      # 0xc03c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x0, 0x37(%rsp)
jmp 0x50cb
movq (%rsp), %rdi
movl 0x24(%rsp), %esi
xorl %edx, %edx
callq 0x8b90
movb $0x1, 0x37(%rsp)
jmp 0x50cb
movq (%rsp), %rdi
movl 0x24(%rsp), %esi
movl $0x1, %edx
callq 0x8b90
movb $0x1, 0x37(%rsp)
jmp 0x50cb
movq (%rsp), %rdi
movl 0x24(%rsp), %esi
movl $0x3, %edx
callq 0x4a50
movb $0x1, 0x37(%rsp)
jmp 0x50cb
movq (%rsp), %rax
movb $0x0, 0x8c(%rax)
movb $0x1, 0x37(%rsp)
jmp 0x50cb
jmp 0x50b4
movq (%rsp), %rdi
movl 0x24(%rsp), %esi
movl $0x4, %edx
callq 0x4a50
movb $0x1, 0x37(%rsp)
movb 0x37(%rsp), %al
andb $0x1, %al
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movl %esi, 0x14(%rsp)
movq 0x18(%rsp), %rdi
movq %rdi, (%rsp)
movl 0x88(%rdi), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
callq 0x88e0
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jb 0x55d9
movb $0x0, 0x27(%rsp)
jmp 0x562d
movq (%rsp), %rdi
movl 0x14(%rsp), %esi
xorl %edx, %edx
callq 0x8a30
andb $0x1, %al
movb %al, 0x13(%rsp)
movb 0x13(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x5603
movb $0x0, 0x27(%rsp)
jmp 0x562d
movq (%rsp), %rdi
addq $0x50, %rdi
leaq 0x14(%rsp), %rsi
callq 0x5640
movq (%rsp), %rax
movl 0x88(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x88(%rax)
movb $0x1, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: nmmmnu[P]HM3/net/iobuffer.h
// Function: net::IOBuffer::push_(unsigned long, char const*)
bool push_(size_t const len, const char *ptr){
		if (ptr == nullptr || len == 0)
			return false;

		buffer_.append(ptr, len);

		return true;
	}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x684c
cmpq $0x0, 0x10(%rsp)
jne 0x6853
movb $0x0, 0x27(%rsp)
jmp 0x686f
movq (%rsp), %rdi
addq $0x8, %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq 0x2070
movb $0x1, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: nmmmnu[P]HM3/net/worker/keyvalueworker_impl.h
// Function: net::WorkerStatus net::worker::KeyValueWorker<net::protocol::RedisProtocol, KeyValueMockAdapter>::operator()<net::ClientBuffer>(net::ClientBuffer&)
WorkerStatus KeyValueWorker<PROTOCOL, DB_ADAPTER>::operator()(CONNECTION &buffer){
	if (buffer.size() == 0)
		return WorkerStatus::PASS;

	using Status = net::protocol::ProtocolStatus;

	const Status status = protocol_( StringRef{ buffer.data(), buffer.size() } );

	switch(status){
		case Status::BUFFER_NOT_READ :
			return WorkerStatus::PASS;

		case Status::OK :
			return process_request_(buffer);

		default: // for GCC warning...
		case Status::ERROR :
			return sendResponseError_(buffer, "Internal Error");
	}

	// must not get here
	//return WorkerStatus::WRITE;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %rdi
callq 0x4f70
cmpq $0x0, %rax
jne 0x68b5
movl $0x0, 0x64(%rsp)
jmp 0x696e
movq 0x50(%rsp), %rdi
callq 0x6980
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rdi
callq 0x4f70
movq 0x8(%rsp), %rsi
movq %rax, %rdx
leaq 0x38(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x69c0
movq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x9af0
movl %eax, 0x4c(%rsp)
movl 0x4c(%rsp), %eax
movl %eax, 0x1c(%rsp)
testl %eax, %eax
je 0x6926
jmp 0x6906
movl 0x1c(%rsp), %eax
subl $0x1, %eax
je 0x691c
jmp 0x6911
movl 0x1c(%rsp), %eax
subl $0x2, %eax
je 0x693d
jmp 0x693b
movl $0x0, 0x64(%rsp)
jmp 0x696e
movq 0x20(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x6a00
movl %eax, 0x64(%rsp)
jmp 0x696e
jmp 0x693d
movq 0x50(%rsp), %rax
movq %rax, (%rsp)
leaq 0x28(%rsp), %rdi
leaq 0x57dc(%rip), %rsi      # 0xc12e
callq 0x6f10
movq 0x20(%rsp), %rdi
movq (%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x6ed0
movl %eax, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq 0x60(%rsp), %rdi
movl $0x24, %esi
callq 0x7740
movq 0x60(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rdi
callq 0x74f0
movq %rax, %rsi
leaq 0x28(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x77e0
movq 0x10(%rsp), %rsi
leaq 0x48(%rsp), %rdi
callq 0x71f0
jmp 0x76c4
movq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x7770
jmp 0x76d5
leaq 0x28(%rsp), %rdi
callq 0x2150
movq 0x60(%rsp), %rdi
leaq 0x4abd(%rip), %rsi      # 0xc1a8
callq 0x78e0
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0x7770
movq 0x60(%rsp), %rdi
leaq 0x4a9d(%rip), %rsi      # 0xc1a8
callq 0x78e0
addq $0x68, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x2150
movq 0x20(%rsp), %rdi
callq 0x2300
nopw (%rax,%rax)
// File: nmmmnu[P]HM3/net/iobuffer.h
// Function: net::IOBuffer::push(char const*)
bool push(const char *p){
		size_t size;

		// C++17 if :)
		if (p && ( size = strlen(p) ) )
			return push_(size, p);

		return false;
	}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, 0x10(%rsp)
je 0x792f
movq 0x10(%rsp), %rdi
callq 0x20f0
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x792f
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq 0x6820
andb $0x1, %al
movb %al, 0x27(%rsp)
jmp 0x7934
movb $0x0, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nop
// File: 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:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq 0x80(%rsp), %rdi
movl $0x2a, %esi
callq 0x7740
movq 0x80(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x78(%rsp), %rdi
callq 0x2f70
movq %rax, %rsi
leaq 0x48(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x77e0
movq 0x10(%rsp), %rsi
leaq 0x68(%rsp), %rdi
callq 0x71f0
jmp 0x7b60
movq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x7770
jmp 0x7b71
leaq 0x48(%rsp), %rdi
callq 0x2150
movq 0x80(%rsp), %rdi
leaq 0x461e(%rip), %rsi      # 0xc1a8
callq 0x78e0
movq 0x78(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
callq 0x7c30
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rdi
callq 0x7c60
movq %rax, 0x20(%rsp)
leaq 0x28(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x7c90
testb $0x1, %al
jne 0x7bcc
jmp 0x7c13
leaq 0x28(%rsp), %rdi
callq 0x7cd0
movq %rax, 0x18(%rsp)
movq 0x80(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x7670
leaq 0x28(%rsp), %rdi
callq 0x7ce0
jmp 0x7bb7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x40(%rsp)
movl %eax, 0x3c(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x2150
jmp 0x7c1b
addq $0x88, %rsp
retq
movq 0x40(%rsp), %rdi
callq 0x2300
nopw %cs:(%rax,%rax)
nop
// File: nmmmnu[P]HM3/net/iobuffer.h
// Function: net::IOBuffer::pop(unsigned long)
bool pop(size_t const len){
		if (len == 0)
			return false;

		auto const available = size();

		if (available < len)
			return false;

		if (available == len){
			clear();
			return true;
		}

		head_ = head_ + len;

		return true;
	}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x82e6
movb $0x0, 0x27(%rsp)
jmp 0x8337
movq (%rsp), %rdi
callq 0x4f70
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpq 0x10(%rsp), %rax
jae 0x8307
movb $0x0, 0x27(%rsp)
jmp 0x8337
movq 0x8(%rsp), %rax
cmpq 0x10(%rsp), %rax
jne 0x8323
movq (%rsp), %rdi
callq 0x7640
movb $0x1, 0x27(%rsp)
jmp 0x8337
movq (%rsp), %rax
movq (%rax), %rcx
addq 0x10(%rsp), %rcx
movq %rcx, (%rax)
movb $0x1, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movl %esi, 0x14(%rsp)
movq 0x18(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x8e70
movq (%rsp), %rdi
movq %rax, 0x8(%rsp)
callq 0x8e50
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movl 0x14(%rsp), %edx
callq 0x22b0
movl %eax, 0x10(%rsp)
cmpl $0x0, 0x10(%rsp)
jge 0x893f
movl $0x2, 0x24(%rsp)
jmp 0x8958
cmpl $0x0, 0x10(%rsp)
jne 0x8950
movl $0x1, 0x24(%rsp)
jmp 0x8958
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movl %esi, 0x14(%rsp)
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %eax
movl %eax, %esi
callq 0x8e90
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x4(%rsp)
movq 0x8(%rsp), %rax
movw 0x6(%rax), %ax
movw %ax, 0x2(%rsp)
movswl 0x2(%rsp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x89cd
movl 0x4(%rsp), %esi
leaq 0x20(%rsp), %rdi
movl $0x3, %edx
callq 0x8eb0
jmp 0x8a21
movswl 0x2(%rsp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x89ef
movl 0x4(%rsp), %esi
leaq 0x20(%rsp), %rdi
movl $0x1, %edx
callq 0x8eb0
jmp 0x8a21
movswl 0x2(%rsp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x8a11
movl 0x4(%rsp), %esi
leaq 0x20(%rsp), %rdi
movl $0x2, %edx
callq 0x8eb0
jmp 0x8a21
movl 0x4(%rsp), %esi
leaq 0x20(%rsp), %rdi
xorl %edx, %edx
callq 0x8eb0
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movl %esi, 0x34(%rsp)
movl %edx, 0x30(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x18(%rsp)
movl $0x0, 0x2c(%rsp)
movb $0x0, 0x2b(%rsp)
movl $0x0, 0x24(%rsp)
movq 0x18(%rsp), %rdi
movl 0x24(%rsp), %eax
movq %rax, 0x10(%rsp)
callq 0x8e50
movq %rax, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
jae 0x8ae9
movq 0x18(%rsp), %rdi
movl 0x24(%rsp), %eax
movl %eax, %esi
callq 0x8ed0
movl (%rax), %eax
cmpl 0x34(%rsp), %eax
jne 0x8aa7
movl 0x24(%rsp), %eax
movl %eax, 0x2c(%rsp)
movb $0x1, 0x2b(%rsp)
jmp 0x8ae9
movb 0x2b(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x8ad7
movq 0x18(%rsp), %rdi
movl 0x24(%rsp), %eax
movl %eax, %esi
callq 0x8ed0
cmpl $0x0, (%rax)
jge 0x8ad7
movl 0x24(%rsp), %eax
movl %eax, 0x2c(%rsp)
movb $0x1, 0x2b(%rsp)
jmp 0x8ad9
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x8a60
testb $0x1, 0x2b(%rsp)
jne 0x8af7
movb $0x0, 0x47(%rsp)
jmp 0x8b41
movq 0x18(%rsp), %rdi
movl 0x34(%rsp), %eax
movl %eax, 0x8(%rsp)
movl 0x2c(%rsp), %eax
movl %eax, %esi
callq 0x8ed0
movl 0x8(%rsp), %ecx
movl %ecx, (%rax)
movl 0x30(%rsp), %edi
callq 0x8b50
movq 0x18(%rsp), %rdi
movw %ax, 0xe(%rsp)
movl 0x2c(%rsp), %eax
movl %eax, %esi
callq 0x8ed0
movw 0xe(%rsp), %cx
movw %cx, 0x4(%rax)
movb $0x1, 0x47(%rsp)
movb 0x47(%rsp), %al
andb $0x1, %al
addq $0x48, %rsp
retq
nopl (%rax)
// File: nmmmnu[P]HM3/net/selector/pollselector.cc
// Function: net::selector::(anonymous namespace)::pollConvert(net::selector::FDEvent)
auto pollConvert(const FDEvent event) -> decltype(pollfd::events){
	switch(event){
		default:
		case FDEvent::READ	: return POLLIN;
		case FDEvent::WRITE	: return POLLOUT;
	}
}

// Assembly:
movl %edi, -0x8(%rsp)
movl -0x8(%rsp), %eax
movl %eax, -0xc(%rsp)
testl %eax, %eax
je 0x8b6f
jmp 0x8b62
movl -0xc(%rsp), %eax
subl $0x1, %eax
je 0x8b78
jmp 0x8b6d
jmp 0x8b6f
movw $0x1, -0x2(%rsp)
jmp 0x8b7f
movw $0x4, -0x2(%rsp)
movw -0x2(%rsp), %ax
retq
nopw %cs:(%rax,%rax)
// File: nmmmnu[P]HM3/net/selector/pollselector.cc
// Function: net::selector::PollSelector::updateFD(int, net::selector::FDEvent)
bool PollSelector::updateFD(int const fd, const FDEvent event){
	// bit ugly.
	for(auto &item : statusData_)
		if (item.fd == fd){
			item.events = pollConvert(event);
			return true;
		}

	return false;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
movl %edx, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x8ef0
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
callq 0x8f20
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x8f50
testb $0x1, %al
jne 0x8bde
jmp 0x8c21
leaq 0x10(%rsp), %rdi
callq 0x8f90
movq %rax, (%rsp)
movq (%rsp), %rax
movl (%rax), %eax
cmpl 0x24(%rsp), %eax
jne 0x8c13
movl 0x20(%rsp), %edi
callq 0x8b50
movw %ax, %cx
movq (%rsp), %rax
movw %cx, 0x4(%rax)
movb $0x1, 0x37(%rsp)
jmp 0x8c26
jmp 0x8c15
leaq 0x10(%rsp), %rdi
callq 0x8fa0
jmp 0x8bc9
movb $0x0, 0x37(%rsp)
movb 0x37(%rsp), %al
andb $0x1, %al
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: nmmmnu[P]HM3/net/selector/pollselector.cc
// Function: net::selector::PollSelector::removeFD(int)
bool PollSelector::removeFD(int const fd){
	// bit ugly.
	for(auto &item : statusData_)
		if (item.fd == fd){
			item.fd = -1;
			return true;
		}

	return false;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x8ef0
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
callq 0x8f20
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x8f50
testb $0x1, %al
jne 0x8c8a
jmp 0x8cc3
leaq 0x10(%rsp), %rdi
callq 0x8f90
movq %rax, (%rsp)
movq (%rsp), %rax
movl (%rax), %eax
cmpl 0x24(%rsp), %eax
jne 0x8cb5
movq (%rsp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movb $0x1, 0x37(%rsp)
jmp 0x8cc8
jmp 0x8cb7
leaq 0x10(%rsp), %rdi
callq 0x8fa0
jmp 0x8c75
movb $0x0, 0x37(%rsp)
movb 0x37(%rsp), %al
andb $0x1, %al
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: 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:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x8(%rsp)
movq $0x0, 0x48(%rsp)
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0xa070
movsbl (%rax), %eax
cmpl $0x2a, %eax
je 0x9b43
movl $0x0, 0x44(%rsp)
leaq 0x44(%rsp), %rdi
callq 0xa090
movl %eax, 0x64(%rsp)
jmp 0x9c6c
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, (%rsp)
movq 0x50(%rsp), %rdi
callq 0x74f0
movq %rax, %rcx
movq (%rsp), %rax
cmpq %rcx, %rax
jbe 0x9b81
movl $0x1, 0x64(%rsp)
jmp 0x9c6c
movq 0x50(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x9c80
movq 0x8(%rsp), %rdi
cltq
movq %rax, 0x38(%rsp)
callq 0xa0a0
cmpq $0x0, 0x38(%rsp)
je 0x9bb1
cmpq $0x4, 0x38(%rsp)
jbe 0x9bcc
movl $0x2, 0x34(%rsp)
leaq 0x34(%rsp), %rdi
callq 0xa090
movl %eax, 0x64(%rsp)
jmp 0x9c6c
movq 0x50(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x9d60
movl %eax, 0x30(%rsp)
cmpl $0x0, 0x30(%rsp)
je 0x9bf0
movl 0x30(%rsp), %eax
movl %eax, 0x64(%rsp)
jmp 0x9c6c
movq $0x0, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x38(%rsp), %rax
jae 0x9c64
movq 0x50(%rsp), %rsi
leaq 0x10(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x9e10
leaq 0x10(%rsp), %rdi
callq 0xa0c0
testb $0x1, %al
jne 0x9c29
jmp 0x9c42
leaq 0x10(%rsp), %rdi
callq 0xa150
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0xa0e0
jmp 0x9c52
leaq 0x10(%rsp), %rdi
callq 0xa160
movl %eax, 0x64(%rsp)
jmp 0x9c6c
jmp 0x9c54
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x9bf9
movl $0x0, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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 $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq $0x0, 0x10(%rsp)
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq %rax, (%rsp)
movq 0x30(%rsp), %rdi
callq 0x74f0
movq (%rsp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, 0xe(%rsp)
jae 0x9ccc
cmpq $0x8, 0x10(%rsp)
setb %al
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
testb $0x1, %al
jne 0x9cd6
jmp 0x9d47
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rax
movq (%rax), %rsi
callq 0xa070
movb (%rax), %al
movb %al, 0xf(%rsp)
movsbl 0xf(%rsp), %eax
cmpl $0x2d, %eax
je 0x9d18
movsbl 0xf(%rsp), %eax
cmpl $0x2b, %eax
je 0x9d18
movsbl 0xf(%rsp), %eax
cmpl $0x30, %eax
jl 0x9d16
movsbl 0xf(%rsp), %eax
cmpl $0x39, %eax
jle 0x9d18
jmp 0x9d47
movb 0xf(%rsp), %cl
movq 0x10(%rsp), %rax
movb %cl, 0x1f(%rsp,%rax)
movq 0x28(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x9c97
movq 0x10(%rsp), %rax
movb $0x0, 0x1f(%rsp,%rax)
leaq 0x1f(%rsp), %rdi
callq 0x22d0
addq $0x38, %rsp
retq
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rax
addq $0x1, %rax
movq %rax, (%rsp)
movq 0x18(%rsp), %rdi
callq 0x74f0
movq %rax, %rcx
movq (%rsp), %rax
cmpq %rcx, %rax
jbe 0x9d9e
movl $0x1, 0x24(%rsp)
jmp 0x9e05
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rax
movq (%rax), %rsi
callq 0xa070
movsbl (%rax), %eax
cmpl $0xd, %eax
jne 0x9def
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rax
movq (%rax), %rsi
addq $0x1, %rsi
callq 0xa070
movsbl (%rax), %eax
cmpl $0xa, %eax
jne 0x9def
movq 0x10(%rsp), %rax
movq (%rax), %rcx
addq $0x2, %rcx
movq %rcx, (%rax)
movl $0x0, 0x24(%rsp)
jmp 0x9e05
movl $0x4, 0xc(%rsp)
leaq 0xc(%rsp), %rdi
callq 0xa090
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nop
// File: 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:
subq $0x78, %rsp
movq %rdi, 0x18(%rsp)
movq %rdi, 0x20(%rsp)
movq %rsi, 0x70(%rsp)
movq %rdx, 0x68(%rsp)
movq 0x68(%rsp), %rax
movq (%rax), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
movq 0x70(%rsp), %rdi
callq 0x74f0
movq %rax, %rcx
movq 0x28(%rsp), %rax
cmpq %rcx, %rax
jbe 0x9e64
movq 0x18(%rsp), %rdi
movl $0x1, %esi
callq 0xa170
jmp 0xa011
movq 0x70(%rsp), %rdi
movq 0x68(%rsp), %rax
movq (%rax), %rsi
callq 0xa070
movsbl (%rax), %eax
cmpl $0x24, %eax
je 0x9ea1
movl $0x1, 0x64(%rsp)
leaq 0x64(%rsp), %rdi
callq 0xa090
movq 0x18(%rsp), %rdi
movl %eax, %esi
callq 0xa170
jmp 0xa011
movq 0x68(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq 0x68(%rsp), %rax
movq (%rax), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
movq 0x70(%rsp), %rdi
callq 0x74f0
movq %rax, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
jbe 0x9eec
movq 0x18(%rsp), %rdi
movl $0x1, %esi
callq 0xa170
jmp 0xa011
movq 0x70(%rsp), %rdi
movq 0x68(%rsp), %rsi
callq 0x9c80
cltq
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x58(%rsp)
jbe 0x9f15
cmpq $0x4000, 0x58(%rsp)     # imm = 0x4000
jbe 0x9f38
movl $0x3, 0x54(%rsp)
leaq 0x54(%rsp), %rdi
callq 0xa090
movq 0x18(%rsp), %rdi
movl %eax, %esi
callq 0xa170
jmp 0xa011
movq 0x70(%rsp), %rdi
movq 0x68(%rsp), %rsi
callq 0x9d60
movl %eax, 0x50(%rsp)
cmpl $0x0, 0x50(%rsp)
je 0x9f65
movq 0x18(%rsp), %rdi
movl 0x50(%rsp), %esi
callq 0xa170
jmp 0xa011
movq 0x68(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x58(%rsp), %rcx
movq 0x68(%rsp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq 0x68(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x70(%rsp), %rdi
callq 0x74f0
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
jbe 0x9fb7
movq 0x18(%rsp), %rdi
movl $0x1, %esi
callq 0xa170
jmp 0xa011
movq 0x70(%rsp), %rdi
movq 0x68(%rsp), %rsi
callq 0x9d60
movl %eax, 0x44(%rsp)
cmpl $0x0, 0x44(%rsp)
je 0x9fe1
movq 0x18(%rsp), %rdi
movl 0x44(%rsp), %esi
callq 0xa170
jmp 0xa011
movq 0x70(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0xa070
movq %rax, %rsi
movq 0x58(%rsp), %rdx
leaq 0x30(%rsp), %rdi
callq 0x69c0
movq 0x18(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0xa1b0
movq 0x20(%rsp), %rax
addq $0x78, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movl %edi, 0x1c(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movl %ecx, 0x4(%rsp)
movl 0x1c(%rsp), %edi
movl 0x4(%rsp), %edx
movl $0x1, %esi
callq 0xb110
movb %al, 0x2(%rsp)
jmp 0xad8e
movb 0x2(%rsp), %al
andb $0x1, %al
movb %al, 0x3(%rsp)
testb $0x1, 0x3(%rsp)
jne 0xadb5
callq 0x2030
movl $0xb, (%rax)
movq $-0x1, 0x20(%rsp)
jmp 0xadcd
movl 0x1c(%rsp), %edi
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
callq 0xacb0
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
movq %rax, %rdi
callq 0x2bf0
nop
// File: 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:
subq $0x28, %rsp
movl %edi, 0x1c(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movl %ecx, 0x4(%rsp)
movl 0x1c(%rsp), %edi
movl 0x4(%rsp), %edx
movl $0x4, %esi
callq 0xb110
movb %al, 0x2(%rsp)
jmp 0xae0e
movb 0x2(%rsp), %al
andb $0x1, %al
movb %al, 0x3(%rsp)
testb $0x1, 0x3(%rsp)
jne 0xae35
callq 0x2030
movl $0xb, (%rax)
movq $-0x1, 0x20(%rsp)
jmp 0xae4d
movl 0x1c(%rsp), %edi
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
callq 0xacf0
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
movq %rax, %rdi
callq 0x2bf0
nop