LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/Lartu[P]polaris/src/polaris.cpp
// Function: num_to_str[abi:cxx11](double)
string num_to_str(pnumber value)
{
    stringstream s;
    s << fixed << value;
    string str = s.str();
    trim(str);
    str.erase(str.find_last_not_of('0') + 1, string::npos);
    str.erase(str.find_last_not_of('.') + 1, string::npos);
    return str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movsd %xmm0, -0x18(%rbp)
movq %rdi, %rbx
leaq -0x1a0(%rbp), %rdi
callq 0x21d0
leaq -0x190(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
movl $0xfffffefb, %ecx       # imm = 0xFFFFFEFB
andl -0x178(%rbp,%rax), %ecx
orl $0x4, %ecx
movl %ecx, -0x178(%rbp,%rax)
movsd -0x18(%rbp), %xmm0
callq 0x23a0
leaq -0x188(%rbp), %rsi
movq %rbx, %rdi
callq 0x2390
movq %rbx, %rdi
callq 0x261c
pushq $0x30
popq %rsi
pushq $-0x1
popq %rdx
movq %rbx, %rdi
callq 0x21b0
incq %rax
pushq $-0x1
popq %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2090
pushq $0x2e
popq %rsi
pushq $-0x1
popq %rdx
movq %rbx, %rdi
callq 0x21b0
incq %rax
pushq $-0x1
popq %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2090
leaq -0x1a0(%rbp), %rdi
callq 0x21e0
movq %rbx, %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
jmp 0x37df
movq %rax, %r14
movq %rbx, %rdi
callq 0x22f0
leaq -0x1a0(%rbp), %rdi
callq 0x21e0
movq %r14, %rdi
callq 0x23e0
movq %rax, %rdi
callq 0x60ad
// File: /workspace/github_cpp_makefile_star2_O2/Lartu[P]polaris/src/polaris.cpp
// Function: str_is_num(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool str_is_num(string & source){
    if (source == "inf") return true;
    if (source == "-inf") return true;
    bool already_found_sign = false;
    bool already_found_point = false;
    size_t numbers_before_point = 0;
    size_t numbers_after_point = 0;
    for(size_t i = 0; i < source.length(); ++i)
        if(!already_found_sign && source[i] == '-')
            already_found_sign = true;
        else if(!already_found_point && source[i] == '.')
            already_found_point = true;
        else if(
        source[i] == '0' || source[i] == '1' 
        || source[i] == '2' || source[i] == '3'
        || source[i] == '4' || source[i] == '5'
        || source[i] == '6' || source[i] == '7'
        || source[i] == '8' || source[i] == '9'
        )
        {
            already_found_sign = true;
            if(already_found_point)
                numbers_after_point++;
            else
                numbers_before_point++;
        }
        else
            return false;
    if(numbers_before_point == 0)
        return false;
    if(already_found_point && numbers_after_point == 0)
        return false;
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0x4bbd(%rip), %rsi      # 0x83c9
callq 0x61d8
movb $0x1, %bl
testb %al, %al
jne 0x38a5
leaq 0x4ba6(%rip), %rsi      # 0x83c8
movq %r14, %rdi
callq 0x61d8
testb %al, %al
jne 0x38a5
movq (%r14), %rax
movq 0x8(%r14), %rcx
xorl %r8d, %r8d
xorl %ebx, %ebx
xorl %esi, %esi
xorl %edx, %edx
xorl %edi, %edi
cmpq %rdi, %rcx
je 0x3891
testb $0x1, %r8b
jne 0x3854
movb $0x1, %r9b
cmpb $0x2d, (%rax,%rdi)
je 0x3889
movb (%rax,%rdi), %r9b
testb $0x1, %bl
je 0x386c
addb $-0x30, %r9b
cmpb $0xa, %r9b
jae 0x38a3
incq %rdx
jmp 0x3886
cmpb $0x2e, %r9b
jne 0x3879
movl %r8d, %r9d
movb $0x1, %bl
jmp 0x3889
addb $-0x30, %r9b
cmpb $0xa, %r9b
jae 0x38a3
incq %rsi
movb $0x1, %r9b
incq %rdi
movl %r9d, %r8d
jmp 0x3840
testq %rsi, %rsi
je 0x38a3
testq %rdx, %rdx
setne %al
xorb $0x1, %bl
orb %al, %bl
jmp 0x38a5
xorl %ebx, %ebx
andb $0x1, %bl
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lartu[P]polaris/src/polaris.cpp
// Function: get_var_value(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void get_var_value(string & var)
{
    if (variables.find(var) == variables.end())
        stack_push("", false, true);
    else
        stack_push(variables[var], false, true);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0x89ad(%rip), %rdi      # 0xc298
movq %rbx, %rsi
callq 0x742e
leaq 0x89a6(%rip), %rcx      # 0xc2a0
cmpq %rcx, %rax
je 0x3935
leaq 0x8992(%rip), %rdi      # 0xc298
movq %rbx, %rsi
callq 0x62e0
leaq -0x50(%rbp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2310
pushq $0x1
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3546
leaq -0x50(%rbp), %rdi
callq 0x22f0
jmp 0x3960
leaq 0x4a5c(%rip), %rsi      # 0x8398
leaq -0x30(%rbp), %rdi
leaq -0x9(%rbp), %rdx
callq 0x2120
leaq -0x30(%rbp), %rdi
pushq $0x1
popq %rdx
xorl %esi, %esi
callq 0x3546
leaq -0x30(%rbp), %rdi
callq 0x22f0
addq $0x48, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x22f0
jmp 0x398e
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x22f0
jmp 0x398e
movq %rax, %rdi
callq 0x60ad
movq %rax, %rbx
movq %rbx, %rdi
callq 0x23e0
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/examples/echo/server.cpp
// Function: handle_read(int, int, std::shared_ptr<socket>)
void handle_read(int ec, int t, std::shared_ptr<socket> sock){
	if(ec == 0){
		sock->sync_write(buff, t);
		sock->async_read(buff, 2048, std::bind(handle_read, std::placeholders::_1,
					std::placeholders::_2, sock));
	}
	else{
		std::cerr << "async read error, errno = " << ec << std::endl;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
testl %edi, %edi
je 0x356a
movl %edi, %ebx
movq 0xcaac(%rip), %rdi      # 0xfff0
leaq 0x5ac9(%rip), %rsi      # 0x9014
callq 0x31e0
movq %rax, %rdi
movl %ebx, %esi
callq 0x32f0
movq %rax, %rdi
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x3130
movq %rdx, %r14
movq (%rdx), %rdi
movslq %esi, %rdx
leaq 0xcc66(%rip), %rsi      # 0x101e0
callq 0x5840
movq (%r14), %rbx
leaq -0x5d(%rip), %rax       # 0x352c
leaq -0x20(%rbp), %rdi
movq %rax, -0x8(%rdi)
movq %r14, %rsi
callq 0x3920
leaq -0x48(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x381a
leaq 0xcc33(%rip), %rsi      # 0x101e0
leaq -0x48(%rbp), %rcx
movl $0x800, %edx            # imm = 0x800
movq %rbx, %rdi
callq 0x5d28
leaq -0x48(%rbp), %rdi
callq 0x3862
leaq -0x18(%rbp), %rdi
callq 0x3890
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x3862
jmp 0x35ea
movq %rax, %rbx
leaq -0x18(%rbp), %rdi
callq 0x3890
movq %rbx, %rdi
callq 0x3310
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/examples/echo/server.cpp
// Function: main
int main(){
	acceptor a;

	if(!a.bind("localhost", 1234)){
		std::cout << "bind port failed!" << std::endl;
		return -1;
	}

	if(!a.listen()){
		std::cout << "listen failed!" << std::endl;
		return -2;
	}

	a.accept([](int ec, std::shared_ptr<socket> sock){
		std::cout << "accept a connection" << std::endl;
		sock->async_read(buff, 2048, std::bind(handle_read, std::placeholders::_1,
		std::placeholders::_2, sock));
	});

	char c;
	std::cin >> c;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x88, %rsp
leaq -0x68(%rbp), %rdi
callq 0x3b38
leaq 0x5a18(%rip), %rsi      # 0x902f
leaq -0x30(%rbp), %rdi
leaq -0x9(%rbp), %rdx
callq 0x30e0
leaq -0x68(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x4d2, %edx            # imm = 0x4D2
callq 0x3bfa
movl %eax, %ebx
leaq -0x30(%rbp), %rdi
callq 0x3100
testb %bl, %bl
je 0x369e
leaq -0x68(%rbp), %rdi
callq 0x3c74
testb %al, %al
je 0x36bd
xorps %xmm0, %xmm0
leaq -0x90(%rbp), %rsi
movaps %xmm0, (%rsi)
leaq 0xc2(%rip), %rax        # 0x3728
movq %rax, 0x18(%rsi)
leaq 0x18b(%rip), %rax       # 0x37fc
movq %rax, 0x10(%rsi)
leaq -0x68(%rbp), %rdi
callq 0x3bdc
leaq -0x90(%rbp), %rdi
callq 0x3862
movq 0xc947(%rip), %rdi      # 0xffd8
leaq -0x30(%rbp), %rsi
callq 0x3220
xorl %ebx, %ebx
jmp 0x36db
movq 0xc923(%rip), %rdi      # 0xffc8
leaq 0x598d(%rip), %rsi      # 0x9039
callq 0x31e0
movq %rax, %rdi
callq 0x3130
pushq $-0x1
jmp 0x36da
movq 0xc904(%rip), %rdi      # 0xffc8
leaq 0x5980(%rip), %rsi      # 0x904b
callq 0x31e0
movq %rax, %rdi
callq 0x3130
pushq $-0x2
popq %rbx
leaq -0x68(%rbp), %rdi
callq 0x3b96
movl %ebx, %eax
addq $0x88, %rsp
popq %rbx
popq %rbp
retq
jmp 0x3713
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x3862
jmp 0x3716
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x3100
jmp 0x3716
jmp 0x3713
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x3b96
movq %rbx, %rdi
callq 0x3310
nop
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/acceptor.cpp
// Function: acceptor::bind(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned short)
bool acceptor::bind(const std::string &ip, unsigned short port){
	struct hostent *hostent = gethostbyname(ip.c_str());
	if(nullptr == hostent){
		return false;
	}
	struct sockaddr_in local;
	bzero(&local, sizeof(struct sockaddr_in));
	local.sin_family = AF_INET;
	local.sin_port = htons(port);
	local.sin_addr = *(reinterpret_cast<struct in_addr*>(hostent->h_addr));
	return -1 != ::bind(sock, reinterpret_cast<struct sockaddr *>(&local), sizeof(local));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %r14d
movq %rdi, %rbx
movq (%rsi), %rdi
callq 0x3210
testq %rax, %rax
je 0x3c64
movq %rax, %r15
leaq -0x30(%rbp), %r12
pushq $0x10
popq %rsi
movq %r12, %rdi
callq 0x3300
movw $0x2, (%r12)
rolw $0x8, %r14w
movw %r14w, 0x2(%r12)
movq 0x18(%r15), %rax
movq (%rax), %rax
movl (%rax), %eax
movl %eax, 0x4(%r12)
movl 0x8(%rbx), %edi
pushq $0x10
popq %rdx
movq %r12, %rsi
callq 0x3050
cmpl $-0x1, %eax
setne %al
jmp 0x3c66
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/./include/net/singleton.h
// Function: singleton<scheduler>::instance()
static singleton &instance(){
			if(nullptr == _instance){
				static std::mutex mutex;
				std::lock_guard<std::mutex> locker(mutex);
				if(nullptr == _instance){
					_instance = std::shared_ptr<singleton>(new singleton);
				}
			}
			return *_instance;
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq 0xca8e(%rip), %rax      # 0x109e8
testq %rax, %rax
jne 0x3fc0
leaq 0xca9a(%rip), %rdi      # 0x10a00
callq 0x41ca
cmpq $0x0, 0xca75(%rip)      # 0x109e8
jne 0x3fad
pushq $0x18
popq %rdi
callq 0x31f0
movq %rax, %rbx
movq %rax, %rdi
callq 0x485c
leaq -0x20(%rbp), %rdi
movq %rbx, %rsi
callq 0x41e0
leaq 0xca4d(%rip), %rdi      # 0x109e8
leaq -0x20(%rbp), %rsi
callq 0x42ac
leaq -0x18(%rbp), %rdi
callq 0x3890
leaq 0xca4c(%rip), %rdi      # 0x10a00
callq 0x3180
movq 0xca28(%rip), %rax      # 0x109e8
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x31d0
jmp 0x3fd9
movq %rax, %r14
leaq 0xca20(%rip), %rdi      # 0x10a00
callq 0x3180
movq %r14, %rdi
callq 0x3310
nop
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/scheduler.cpp
// Function: scheduler::arrange(std::function<void ()>)
bool scheduler::arrange(std::function<void()> proc){
	for(auto i = 0; i != workers.size(); ++i){
		if(workers[i]->task_once(proc)){
			workers[i]->active();
			return true;
		}
	}

	if(workers.size() < 60000){
		std::shared_ptr<worker> w(new worker());
		w->task_once(proc);
		w->active();
		workers.push_back(w);
		return true;
	}
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, -0x30(%rbp)
movq %rdi, %rbx
pushq $-0x1
popq %r14
xorl %r13d, %r13d
leaq -0x80(%rbp), %r15
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
movq %rcx, %rdx
sarq $0x4, %rdx
incq %r14
cmpq %rdx, %r14
je 0x48f2
movq (%rax,%r13), %r12
movq %r15, %rdi
movq -0x30(%rbp), %rsi
callq 0x49e2
movq %r12, %rdi
movq %r15, %rsi
callq 0x7f0a
movl %eax, %r12d
addq $0x10, %r13
movq %r15, %rdi
callq 0x3862
testb %r12b, %r12b
je 0x489b
movq (%rbx), %rax
movq -0x10(%rax,%r13), %rdi
callq 0x7f4e
jmp 0x4963
cmpq $0xea5ff, %rcx          # imm = 0xEA5FF
ja 0x4967
movl $0x88, %edi
callq 0x31f0
movq %rax, %r15
movq %rax, %rdi
callq 0x7ce0
leaq -0x40(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x4aa6
movq (%r12), %r15
leaq -0x60(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x49e2
leaq -0x60(%rbp), %rsi
movq %r15, %rdi
callq 0x7f0a
leaq -0x60(%rbp), %rdi
callq 0x3862
movq -0x40(%rbp), %rdi
callq 0x7f4e
leaq -0x40(%rbp), %rsi
movq %rbx, %rdi
callq 0x4a30
leaq -0x38(%rbp), %rdi
callq 0x3890
movb $0x1, %al
jmp 0x4969
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x3862
jmp 0x4996
movq %rax, %rbx
movq %r15, %rdi
callq 0x31d0
jmp 0x49ad
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x3890
jmp 0x49ad
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x3862
movq %rbx, %rdi
callq 0x3310
nop
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/socket.cpp
// Function: socket::job(bool)
void socket::job(bool is_read){
	std::mutex *mutex = nullptr;
	std::list<std::function<void()>> *requests = nullptr;

	switch(connect_status){
		case CONNECTING:
			mutex = &conn_mutex;
			requests = &conn_request;
			break;
		case CONNECTED:
			if(is_read){
				mutex = &rd_mutex;
				requests = &rd_request;
			}
			else{
				mutex = &wr_mutex;
				requests = &wr_request;
			}
			break;
		default:
			return;
	}

	std::function<void()> callback;
	{
		std::lock_guard<std::mutex> locker(*mutex);
		if(requests->empty()){
			return;
		}
		callback = requests->front();
		requests->pop_front();
		if(nullptr == callback)
			return;
	}
	callback();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl 0x1f4(%rdi), %eax
cmpl $0x1, %eax
je 0x4f73
cmpl $0x2, %eax
jne 0x4fe2
testb %sil, %sil
movl $0x120, %eax            # imm = 0x120
movl $0x148, %r14d           # imm = 0x148
cmovneq %rax, %r14
movl $0x198, %eax            # imm = 0x198
movl $0x1b0, %r15d           # imm = 0x1B0
cmovneq %rax, %r15
jmp 0x4f7f
movl $0x1c8, %r15d           # imm = 0x1C8
movl $0x170, %r14d           # imm = 0x170
addq %rbx, %r14
xorps %xmm0, %xmm0
movaps %xmm0, -0x30(%rbp)
movaps %xmm0, -0x40(%rbp)
movq %r14, %rdi
callq 0x41ca
addq %r15, %rbx
movq (%rbx), %rsi
cmpq %rbx, %rsi
je 0x4fd1
addq $0x10, %rsi
leaq -0x40(%rbp), %rdi
callq 0x63b6
movq %rbx, %rdi
callq 0x6416
movq -0x30(%rbp), %rbx
movq %r14, %rdi
callq 0x3180
testq %rbx, %rbx
je 0x4fd9
leaq -0x40(%rbp), %rdi
callq 0x6424
jmp 0x4fd9
movq %r14, %rdi
callq 0x3180
leaq -0x40(%rbp), %rdi
callq 0x3862
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4ffc
movq %rax, %rbx
movq %r14, %rdi
callq 0x3180
jmp 0x4fff
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x3862
movq %rbx, %rdi
callq 0x3310
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/socket.cpp
// Function: socket::update_addr(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned short)
bool socket::update_addr(const std::string &host, unsigned short port){
	struct hostent *hostent = gethostbyname(host.c_str());
	if(nullptr == hostent){
		return false;
	}
	if(nullptr == addr){
		addr = std::shared_ptr<struct sockaddr_in>(new struct sockaddr_in());
	}
	bzero(addr.get(), sizeof(struct sockaddr_in));

	addr->sin_family = AF_INET;
	addr->sin_port = htons(port);
	addr->sin_addr = *(reinterpret_cast<struct in_addr*>(hostent->h_addr));

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebx
movq %rdi, %r15
movq (%rsi), %rdi
callq 0x3210
movq %rax, %r14
testq %rax, %rax
je 0x5335
movq 0x1e0(%r15), %rdi
addq $0x1e0, %r15            # imm = 0x1E0
testq %rdi, %rdi
jne 0x5311
pushq $0x10
popq %rdi
callq 0x31f0
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
leaq -0x30(%rbp), %r12
movq %r12, %rdi
movq %rax, %rsi
callq 0x4124
movq %r15, %rdi
movq %r12, %rsi
callq 0x65a2
leaq -0x28(%rbp), %rdi
callq 0x3890
movq (%r15), %rdi
pushq $0x10
popq %rsi
callq 0x3300
movq (%r15), %rax
movw $0x2, (%rax)
rolw $0x8, %bx
movw %bx, 0x2(%rax)
movq 0x18(%r14), %rcx
movq (%rcx), %rcx
movl (%rcx), %ecx
movl %ecx, 0x4(%rax)
testq %r14, %r14
setne %al
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/socket.cpp
// Function: socket::sync_conn_action(std::condition_variable&, bool&)
void socket::sync_conn_action(std::condition_variable &cv, bool &processed){
	int error;
	socklen_t len = sizeof(error);
	if(::getsockopt(sock, SOL_SOCKET, SO_ERROR, &error, &len) < 0){
		return;
	}
	connect_status = (0 == error)?CONNECTED:CONNECTERR;
	processed = true;
	wrable = true;
	connect_notify.notify_all();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rdi, %rbx
leaq -0x18(%rbp), %r8
movl $0x4, (%r8)
movl 0x8(%rdi), %edi
pushq $0x1
popq %rsi
pushq $0x4
popq %rdx
leaq -0x14(%rbp), %rcx
callq 0x3170
testl %eax, %eax
js 0x5554
cmpl $0x1, -0x14(%rbp)
pushq $0x3
popq %rax
sbbl $0x0, %eax
movl %eax, 0x1f4(%rbx)
movb $0x1, %al
movb %al, (%r14)
movb %al, 0x1f1(%rbx)
addq $0x1f8, %rbx            # imm = 0x1F8
movq %rbx, %rdi
callq 0x32d0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/socket.cpp
// Function: socket::async_conn_action(std::function<void (int)>)
void socket::async_conn_action(ccallback ccb){
	int error;
	socklen_t len = sizeof(error);
	if(::getsockopt(sock, SOL_SOCKET, SO_ERROR, &error, &len) < 0){
		return;
	}
	connect_status = (0 == error)?CONNECTED:CONNECTERR;
	wrable = true;
	singleton<scheduler>::instance()->arrange(std::bind(ccb, error));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x20(%rbp), %r8
movl $0x4, (%r8)
movl 0x8(%rdi), %edi
pushq $0x1
popq %rsi
pushq $0x4
popq %rdx
leaq -0x1c(%rbp), %rcx
callq 0x3170
testl %eax, %eax
js 0x5813
cmpl $0x1, -0x1c(%rbp)
pushq $0x3
popq %rax
sbbl $0x0, %eax
movl %eax, 0x1f4(%r14)
movb $0x1, 0x1f1(%r14)
callq 0x3f48
movq %rax, %r14
leaq -0x68(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6900
movl -0x1c(%rbp), %eax
movl %eax, 0x20(%r15)
leaq -0x40(%rbp), %rdi
movq %r15, %rsi
callq 0x6126
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x4878
leaq -0x40(%rbp), %rdi
callq 0x3862
leaq -0x68(%rbp), %rdi
callq 0x3862
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x3862
jmp 0x582f
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x3862
movq %rbx, %rdi
callq 0x3310
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/socket.cpp
// Function: socket::sync_write(void const*, unsigned long)
int socket::sync_write(const void *buff, size_t length){
	int transfered = 0;
	std::mutex sync_mutex;
	std::unique_lock<std::mutex> locker(sync_mutex);
	bool processed = false;
	std::condition_variable cv;
	{
		std::lock_guard<std::mutex> scope_locker(wr_mutex);
		wr_request.push_back(std::bind(&socket::sync_wr_action, this, 
					reinterpret_cast<const char*>(buff), length, std::ref(transfered),
					std::ref(cv), std::ref(processed)));
		if(wrable)
			wr_worker.active();
	}
	cv.wait(locker, [&processed]()->bool{return processed;});
	
	return transfered;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdx, %r12
movq %rsi, %r15
andl $0x0, -0x30(%rbp)
movq %rdi, %r14
xorps %xmm0, %xmm0
leaq -0xc0(%rbp), %rsi
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
andq $0x0, 0x20(%rsi)
leaq -0x40(%rbp), %rdi
callq 0x604c
movb $0x0, -0x29(%rbp)
leaq -0x90(%rbp), %r13
movq %r13, %rdi
callq 0x3250
leaq 0x148(%r14), %rbx
movq %rbx, %rdi
callq 0x41ca
leaq 0xf9(%rip), %rax        # 0x59a2
leaq -0x100(%rbp), %rsi
movq %rax, (%rsi)
andq $0x0, 0x8(%rsi)
leaq -0x29(%rbp), %rax
movq %rax, 0x10(%rsi)
movq %r13, 0x18(%rsi)
leaq -0x30(%rbp), %rax
movq %rax, 0x20(%rsi)
movq %r12, 0x28(%rsi)
movq %r15, 0x30(%rsi)
movq %r14, 0x38(%rsi)
leaq -0x60(%rbp), %rdi
callq 0x616e
leaq 0x1b0(%r14), %rdi
leaq -0x60(%rbp), %rsi
callq 0x606c
leaq -0x60(%rbp), %rdi
callq 0x3862
cmpb $0x1, 0x1f1(%r14)
jne 0x5913
addq $0x98, %r14
movq %r14, %rdi
callq 0x7f4e
movq %rbx, %rdi
callq 0x3180
leaq -0x90(%rbp), %rbx
leaq -0x40(%rbp), %r14
cmpb $0x0, -0x29(%rbp)
jne 0x5939
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3090
jmp 0x5926
movl -0x30(%rbp), %ebx
leaq -0x90(%rbp), %rdi
callq 0x3320
leaq -0x40(%rbp), %rdi
callq 0x60c4
movl %ebx, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5975
movq %rax, %r14
leaq -0x60(%rbp), %rdi
callq 0x3862
jmp 0x5978
movq %rax, %r14
movq %rbx, %rdi
callq 0x3180
jmp 0x5985
movq %rax, %r14
leaq -0x90(%rbp), %rdi
callq 0x3320
leaq -0x40(%rbp), %rdi
callq 0x60c4
movq %r14, %rdi
callq 0x3310
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/socket.cpp
// Function: socket::sync_read(void*, unsigned long)
int socket::sync_read(void *buff, size_t length){
	int transfered = 0;
	std::mutex sync_mutex;
	std::unique_lock<std::mutex> locker(sync_mutex);
	bool processed = false;
	std::condition_variable sync_cv;
	{
		std::lock_guard<std::mutex> scope_locker(rd_mutex);
		rd_request.push_back(std::bind(&socket::sync_rd_action, this, 
					reinterpret_cast<char*>(buff), length, std::ref(transfered),
					std::ref(sync_cv), std::ref(processed)));
		if(rdable)
			rd_worker.active();
	}
	sync_cv.wait(locker, [&processed]()->bool{return processed;});

	return transfered;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdx, %r12
movq %rsi, %r15
andl $0x0, -0x30(%rbp)
movq %rdi, %r14
xorps %xmm0, %xmm0
leaq -0xc0(%rbp), %rsi
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
andq $0x0, 0x20(%rsi)
leaq -0x40(%rbp), %rdi
callq 0x604c
movb $0x0, -0x29(%rbp)
leaq -0x90(%rbp), %r13
movq %r13, %rdi
callq 0x3250
leaq 0x120(%r14), %rbx
movq %rbx, %rdi
callq 0x41ca
leaq 0xf7(%rip), %rax        # 0x5b32
leaq -0x100(%rbp), %rsi
movq %rax, (%rsi)
andq $0x0, 0x8(%rsi)
leaq -0x29(%rbp), %rax
movq %rax, 0x10(%rsi)
movq %r13, 0x18(%rsi)
leaq -0x30(%rbp), %rax
movq %rax, 0x20(%rsi)
movq %r12, 0x28(%rsi)
movq %r15, 0x30(%rsi)
movq %r14, 0x38(%rsi)
leaq -0x60(%rbp), %rdi
callq 0x61b6
leaq 0x198(%r14), %rdi
leaq -0x60(%rbp), %rsi
callq 0x606c
leaq -0x60(%rbp), %rdi
callq 0x3862
cmpb $0x1, 0x1f0(%r14)
jne 0x5aa2
addq $0x10, %r14
movq %r14, %rdi
callq 0x7f4e
movq %rbx, %rdi
callq 0x3180
leaq -0x90(%rbp), %rbx
leaq -0x40(%rbp), %r14
cmpb $0x0, -0x29(%rbp)
jne 0x5ac8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3090
jmp 0x5ab5
movl -0x30(%rbp), %ebx
leaq -0x90(%rbp), %rdi
callq 0x3320
leaq -0x40(%rbp), %rdi
callq 0x60c4
movl %ebx, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5b04
movq %rax, %r14
leaq -0x60(%rbp), %rdi
callq 0x3862
jmp 0x5b07
movq %rax, %r14
movq %rbx, %rdi
callq 0x3180
jmp 0x5b14
movq %rax, %r14
leaq -0x90(%rbp), %rdi
callq 0x3320
leaq -0x40(%rbp), %rdi
callq 0x60c4
movq %r14, %rdi
callq 0x3310
nop
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/socket.cpp
// Function: socket::async_write(void const*, unsigned long, std::function<void (int, int)>)
void socket::async_write(const void *buff, size_t length, ocallback ocb){
	std::lock_guard<std::mutex> locker(rd_mutex);
	wr_request.push_back(
			std::bind(&socket::async_wr_action, this, reinterpret_cast<const char *>(buff), length, ocb));

	if(wrable)
		wr_worker.active();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rcx, %r15
movq %rsi, %r12
movq %rdi, %r14
leaq -0x60(%rbp), %r13
movq %rdx, (%r13)
leaq 0x120(%rdi), %rbx
movq %rbx, %rdi
callq 0x41ca
leaq 0xc9(%rip), %rax        # 0x5c66
leaq -0x70(%rbp), %rsi
movq %rax, (%rsi)
andq $0x0, 0x8(%rsi)
leaq -0x38(%rbp), %rdx
movq %r14, (%rdx)
leaq -0x30(%rbp), %rcx
movq %r12, (%rcx)
leaq -0xb8(%rbp), %rdi
movq %r13, %r8
movq %r15, %r9
callq 0x70f6
leaq -0x58(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x61fe
leaq 0x1b0(%r14), %rdi
leaq -0x58(%rbp), %rsi
callq 0x606c
leaq -0x58(%rbp), %rdi
callq 0x3862
leaq -0xa8(%rbp), %rdi
callq 0x3862
cmpb $0x1, 0x1f1(%r14)
jne 0x5c17
addq $0x98, %r14
movq %r14, %rdi
callq 0x7f4e
movq %rbx, %rdi
callq 0x3180
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5c52
movq %rax, %r14
leaq -0x58(%rbp), %rdi
callq 0x3862
jmp 0x5c44
movq %rax, %r14
leaq -0xa8(%rbp), %rdi
callq 0x3862
jmp 0x5c55
movq %rax, %r14
movq %rbx, %rdi
callq 0x3180
movq %r14, %rdi
callq 0x3310
nop
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/socket.cpp
// Function: socket::async_wr_action(char const*, unsigned long, std::function<void (int, int)>)
void socket::async_wr_action(const char *buff, size_t length, ocallback ocb){
	int transfered = write_some(buff, length);
	int ec = 0;
	if(transfered == -1){
		socklen_t len = sizeof(ec);
		if(::getsockopt(sock, SOL_SOCKET, SO_ERROR, &ec, &len) < 0){
			//
		}
	}

	singleton<scheduler>::instance()->arrange(std::bind(ocb, ec, transfered));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rcx, %rbx
movq %rdi, %r15
callq 0x62fe
movl %eax, %r14d
andl $0x0, -0x24(%rbp)
cmpl $-0x1, %eax
jne 0x5caa
leaq -0x70(%rbp), %r8
movl $0x4, (%r8)
movl 0x8(%r15), %edi
pushq $0x1
popq %rsi
pushq $0x4
popq %rdx
leaq -0x24(%rbp), %rcx
callq 0x3170
callq 0x3f48
movq %rax, %r15
leaq -0x70(%rbp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x7184
movl %r14d, 0x20(%r12)
movl -0x24(%rbp), %eax
movl %eax, 0x24(%r12)
leaq -0x48(%rbp), %rdi
movq %r12, %rsi
callq 0x636e
leaq -0x48(%rbp), %rsi
movq %r15, %rdi
callq 0x4878
leaq -0x48(%rbp), %rdi
callq 0x3862
leaq -0x70(%rbp), %rdi
callq 0x3862
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x3862
jmp 0x5d16
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x3862
movq %rbx, %rdi
callq 0x3310
nop
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/socket.cpp
// Function: socket::async_read(void*, unsigned long, std::function<void (int, int)>)
void socket::async_read(void *buff, size_t length, icallback icb){
	std::lock_guard<std::mutex> locker(wr_mutex);
	rd_request.push_back(
			std::bind(&socket::async_rd_action, this, reinterpret_cast<char*>(buff), length, icb));

	if(rdable)
		rd_worker.active();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rcx, %r15
movq %rsi, %r12
movq %rdi, %r14
leaq -0x60(%rbp), %r13
movq %rdx, (%r13)
leaq 0x148(%rdi), %rbx
movq %rbx, %rdi
callq 0x41ca
leaq 0xc5(%rip), %rax        # 0x5e28
leaq -0x70(%rbp), %rsi
movq %rax, (%rsi)
andq $0x0, 0x8(%rsi)
leaq -0x38(%rbp), %rdx
movq %r14, (%rdx)
leaq -0x30(%rbp), %rcx
movq %r12, (%rcx)
leaq -0xb8(%rbp), %rdi
movq %r13, %r8
movq %r15, %r9
callq 0x74bc
leaq -0x58(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x6246
leaq 0x198(%r14), %rdi
leaq -0x58(%rbp), %rsi
callq 0x606c
leaq -0x58(%rbp), %rdi
callq 0x3862
leaq -0xa8(%rbp), %rdi
callq 0x3862
cmpb $0x1, 0x1f0(%r14)
jne 0x5dda
addq $0x10, %r14
movq %r14, %rdi
callq 0x7f4e
movq %rbx, %rdi
callq 0x3180
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5e15
movq %rax, %r14
leaq -0x58(%rbp), %rdi
callq 0x3862
jmp 0x5e07
movq %rax, %r14
leaq -0xa8(%rbp), %rdi
callq 0x3862
jmp 0x5e18
movq %rax, %r14
movq %rbx, %rdi
callq 0x3180
movq %r14, %rdi
callq 0x3310
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/socket.cpp
// Function: socket::async_rd_action(char*, unsigned long, std::function<void (int, int)>)
void socket::async_rd_action(char *buff, size_t length, icallback icb){
	int transfered = read_some(buff, length);
	int ec = 0;
	if(transfered == -1){
		socklen_t len = sizeof(ec);
		if(::getsockopt(sock, SOL_SOCKET, SO_ERROR, &ec, &len) < 0){
			//
		}
	}
	singleton<scheduler>::instance()->arrange(std::bind(icb, ec, transfered));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rcx, %rbx
movq %rdi, %r15
callq 0x628e
movl %eax, %r14d
andl $0x0, -0x24(%rbp)
cmpl $-0x1, %eax
jne 0x5e6c
leaq -0x70(%rbp), %r8
movl $0x4, (%r8)
movl 0x8(%r15), %edi
pushq $0x1
popq %rsi
pushq $0x4
popq %rdx
leaq -0x24(%rbp), %rcx
callq 0x3170
callq 0x3f48
movq %rax, %r15
leaq -0x70(%rbp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x7184
movl %r14d, 0x20(%r12)
movl -0x24(%rbp), %eax
movl %eax, 0x24(%r12)
leaq -0x48(%rbp), %rdi
movq %r12, %rsi
callq 0x636e
leaq -0x48(%rbp), %rsi
movq %r15, %rdi
callq 0x4878
leaq -0x48(%rbp), %rdi
callq 0x3862
leaq -0x70(%rbp), %rdi
callq 0x3862
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x3862
jmp 0x5ed8
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x3862
movq %rbx, %rdi
callq 0x3310
nop
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/socket.cpp
// Function: socket::rdhupevent()
void socket::rdhupevent(){
	unregister_epoll_req();
	connect_status = PRECONNECT;
	rdable = false;
	wrable = false;
	close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x7a5c
andl $0x0, 0x1f4(%rbx)
andw $0x0, 0x1f0(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x7a8c
nop
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/socket.cpp
// Function: socket::eevent()
void socket::eevent(){
	if(CONNECTING == connect_status){
		std::function<void()> callback;
		{
			std::lock_guard<std::mutex> locker(conn_mutex);
			if(conn_request.empty()){
				return;
			}
			callback = conn_request.front();
			conn_request.pop_front();
			if(nullptr == callback)
				return;
		}
		callback();
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
cmpl $0x1, 0x1f4(%rdi)
jne 0x5fd8
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, -0x20(%rbp)
movaps %xmm0, -0x30(%rbp)
leaq 0x170(%rdi), %rbx
movq %rbx, %rdi
callq 0x41ca
movq 0x1c8(%r14), %rsi
addq $0x1c8, %r14            # imm = 0x1C8
cmpq %r14, %rsi
je 0x5fc7
addq $0x10, %rsi
leaq -0x30(%rbp), %rdi
callq 0x63b6
movq %r14, %rdi
callq 0x6416
movq -0x20(%rbp), %r14
movq %rbx, %rdi
callq 0x3180
testq %r14, %r14
je 0x5fcf
leaq -0x30(%rbp), %rdi
callq 0x6424
jmp 0x5fcf
movq %rbx, %rdi
callq 0x3180
leaq -0x30(%rbp), %rdi
callq 0x3862
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x5ff0
movq %rax, %r14
movq %rbx, %rdi
callq 0x3180
jmp 0x5ff3
movq %rax, %r14
leaq -0x30(%rbp), %rdi
callq 0x3862
movq %r14, %rdi
callq 0x3310
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/socket.cpp
// Function: socket::read_some(char*, unsigned long)
inline int socket::read_some(char *buff, size_t length){
	int cnt = 0;
	int nread = 0;

	while(cnt < length && (nread = ::read(sock, buff, length)) > 0){
		cnt += nread;
	}

	if(nread > 0){
		return cnt;
	}
	else if(-1 == nread && EAGAIN == errno){
		rdable = false;
		return cnt;
	}
	else{
		return -1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
pushq $-0x1
popq %r12
xorl %r13d, %r13d
movl %r13d, %eax
cmpq %r14, %rax
jae 0x62eb
movl 0x8(%rbx), %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3260
testl %eax, %eax
jle 0x62ce
addl %eax, %r13d
movl %r13d, %r12d
jmp 0x62ac
pushq $-0x1
popq %r12
cmpl $-0x1, %eax
jne 0x62eb
callq 0x3030
cmpl $0xb, (%rax)
jne 0x62eb
movb $0x0, 0x1f0(%rbx)
movl %r13d, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/socket.cpp
// Function: socket::write_some(char const*, unsigned long)
inline int socket::write_some(const char *buff, size_t length){
	int cnt = 0;
	int nwrite = 0;
	while(cnt < length && (nwrite = ::write(sock, buff, length)) > 0){
		cnt += nwrite;
	}

	if(nwrite > 0){
		return cnt;
	}
	else if(-1 == nwrite && EAGAIN == errno){
		wrable = false;
		return cnt;
	}
	else{
		return -1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
pushq $-0x1
popq %r12
xorl %r13d, %r13d
movl %r13d, %eax
cmpq %r14, %rax
jae 0x635b
movl 0x8(%rbx), %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x30b0
testl %eax, %eax
jle 0x633e
addl %eax, %r13d
movl %r13d, %r12d
jmp 0x631c
pushq $-0x1
popq %r12
cmpl $-0x1, %eax
jne 0x635b
callq 0x3030
cmpl $0xb, (%rax)
jne 0x635b
movb $0x0, 0x1f1(%rbx)
movl %r13d, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/socket_base.cpp
// Function: socket_base::register_epoll_req()
void socket_base::register_epoll_req(){
	if(-1 == sock){
		return;
	}
	if(!epolled){
		singleton<epoll>::instance()->add_request(
				this, EPOLLHUP|EPOLLRDHUP|EPOLLPRI|EPOLLOUT|EPOLLIN|EPOLLET);
		epolled = true;
	}
}

// Assembly:
cmpl $-0x1, 0x8(%rdi)
je 0x7a02
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x0, 0xc(%rdi)
jne 0x79fc
callq 0x7b24
movq %rax, %rdi
movq %rbx, %rsi
movl $0x80002017, %edx       # imm = 0x80002017
callq 0x82c6
movb $0x1, 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/socket_base.cpp
// Function: socket_base::unregister_epoll_req()
void socket_base::unregister_epoll_req(){
	if(-1 == sock){
		return;
	}
	if(epolled){
		singleton<epoll>::instance()->del_request(this);
		epolled = false;
	}
}

// Assembly:
cmpl $-0x1, 0x8(%rdi)
je 0x7a8b
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x1, 0xc(%rdi)
jne 0x7a85
callq 0x7b24
movq %rax, %rdi
movq %rbx, %rsi
callq 0x833a
movb $0x0, 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/socket_base.cpp
// Function: socket_base::set_noblock()
bool socket_base::set_noblock(){
	if(-1 == sock){
		return false;
	}
	int flags = fcntl(sock, F_GETFL, 0);
	if(flags < 0){
		return false;
	}

	if(fcntl(sock, F_SETFL, flags | O_NONBLOCK) < 0) {
		return false;
	}

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movl 0x8(%rdi), %edi
xorl %ebx, %ebx
cmpl $-0x1, %edi
je 0x7afc
pushq $0x3
popq %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x3150
testl %eax, %eax
js 0x7afc
movl 0x8(%r14), %edi
orl $0x800, %eax            # imm = 0x800
pushq $0x4
popq %rsi
movl %eax, %edx
xorl %eax, %eax
callq 0x3150
testl %eax, %eax
setns %bl
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/worker.cpp
// Function: worker::worker()
worker::worker():stop(false), onced(true){
	mutex.lock();
	stop = false;
	thread = std::shared_ptr<std::thread>(
			new std::thread(std::bind(&worker::work, this)));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x19(%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
movb $0x1, 0x2a(%rdi)
addq $0x30, %rdi
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x40(%rbx)
movups %xmm0, 0x50(%rbx)
movups %xmm0, 0x60(%rbx)
movups %xmm0, 0x70(%rbx)
andq $0x0, 0x80(%rbx)
callq 0x7f5c
movb $0x0, 0x28(%rbx)
pushq $0x8
popq %rdi
callq 0x31f0
movq %rax, %r15
leaq 0x7d(%rip), %rax        # 0x7dba
leaq -0x40(%rbp), %rsi
movq %rax, (%rsi)
andq $0x0, 0x8(%rsi)
movq %rbx, 0x10(%rsi)
movq %r15, %rdi
callq 0x7f72
leaq -0x28(%rbp), %rdi
movq %r15, %rsi
callq 0x8090
addq $0x78, %rbx
leaq -0x28(%rbp), %rsi
movq %rbx, %rdi
callq 0x816c
leaq -0x20(%rbp), %rdi
callq 0x3890
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7d96
movq %rax, %r14
movq %r15, %rdi
callq 0x31d0
jmp 0x7d99
jmp 0x7d96
movq %rax, %r14
leaq 0x58(%rbx), %r15
subq $-0x80, %rbx
movq %rbx, %rdi
callq 0x3890
movq %r15, %rdi
callq 0x3862
movq %r14, %rdi
callq 0x3310
nop
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/worker.cpp
// Function: worker::work()
void worker::work(){
	while(true){
		while(!mutex.try_lock_for(std::chrono::milliseconds(30))){
			if(stop)
				return;
		}
		std::lock_guard<std::mutex> locker(task_safe);
		if(proc != nullptr)
			proc();
		if(once){
			proc = nullptr;
			onced = true;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x30(%rdi), %r14
leaq 0x58(%rdi), %r15
leaq -0x28(%rbp), %r12
movq $0x1e, -0x28(%rbp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x81a6
testb %al, %al
je 0x7e24
movq %rbx, %rdi
callq 0x41ca
cmpq $0x0, 0x68(%rbx)
je 0x7e06
movq %r15, %rdi
callq 0x6424
cmpb $0x1, 0x29(%rbx)
jne 0x7e1a
movq %r15, %rdi
xorl %esi, %esi
callq 0x7fec
movb $0x1, 0x2a(%rbx)
movq %rbx, %rdi
callq 0x3180
jmp 0x7dd8
cmpb $0x1, 0x28(%rbx)
jne 0x7dd8
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x3180
movq %r14, %rdi
callq 0x3310
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/worker.cpp
// Function: worker::interrupt()
void worker::interrupt(){
	if(nullptr != thread){
		stop = true;
		if(thread->joinable()){
			thread->join();
		}
		thread = nullptr;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x78(%rdi), %rdi
testq %rdi, %rdi
je 0x7ec1
movb $0x1, 0x28(%rbx)
addq $0x78, %rbx
cmpq $0x0, (%rdi)
je 0x7ea6
callq 0x32e0
xorps %xmm0, %xmm0
leaq -0x20(%rbp), %rsi
movaps %xmm0, (%rsi)
movq %rbx, %rdi
callq 0x816c
leaq -0x18(%rbp), %rdi
callq 0x3890
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/worker.cpp
// Function: worker::task(std::function<void ()>)
bool worker::task(std::function<void()> job){
	if(task_safe.try_lock()){
		once = false;
		proc = job;
		task_safe.unlock();
		return true;
	}
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
callq 0x8026
movl %eax, %r14d
testb %al, %al
je 0x7efc
movb $0x0, 0x29(%rbx)
leaq 0x58(%rbx), %rdi
movq %r15, %rsi
callq 0x63b6
movq %rbx, %rdi
callq 0x3180
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/worker.cpp
// Function: worker::task_once(std::function<void ()>)
bool worker::task_once(std::function<void()> job){
	if(onced && task_safe.try_lock()){
		once = true;
		onced = false;
		proc = job;
		task_safe.unlock();
		return true;
	}
	return false;
}

// Assembly:
cmpb $0x1, 0x2a(%rdi)
jne 0x7f44
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
callq 0x8026
testb %al, %al
je 0x7f47
movw $0x1, 0x29(%rbx)
leaq 0x58(%rbx), %rdi
movq %r14, %rsi
callq 0x63b6
movq %rbx, %rdi
callq 0x3180
movb $0x1, %al
jmp 0x7f49
xorl %eax, %eax
retq
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/epoll.cpp
// Function: epoll::interrupt()
void epoll::interrupt(){
	if(nullptr != service){
		polling = false;
		if(service->joinable()){
			service->join();
		}
		service = nullptr;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x82be
movb $0x0, (%rbx)
addq $0x8, %rbx
cmpq $0x0, (%rdi)
je 0x82a3
callq 0x32e0
xorps %xmm0, %xmm0
leaq -0x20(%rbp), %rsi
movaps %xmm0, (%rsi)
movq %rbx, %rdi
callq 0x816c
leaq -0x18(%rbp), %rdi
callq 0x3890
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/epoll.cpp
// Function: epoll::add_request(socket_base*, int)
void epoll::add_request(socket_base *sock, int events){
	struct epoll_event ev;
	ev.events = events;
	ev.data.ptr = sock;

	epoll_ctl(fd, EPOLL_CTL_ADD, sock->fd(), &ev);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq -0x1c(%rbp), %rbx
movl %edx, (%rbx)
movq %rsi, 0x4(%rbx)
movl 0x4(%rdi), %r14d
movq %rsi, %rdi
callq 0x7ab4
pushq $0x1
popq %rsi
movl %r14d, %edi
movl %eax, %edx
movq %rbx, %rcx
callq 0x3240
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/epoll.cpp
// Function: epoll::update_request(socket_base*, int)
void epoll::update_request(socket_base *sock, int events){
	struct epoll_event ev;
	ev.events = events;
	ev.data.ptr = sock;

	epoll_ctl(fd, EPOLL_CTL_MOD, sock->fd(), &ev);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq -0x1c(%rbp), %rbx
movl %edx, (%rbx)
movq %rsi, 0x4(%rbx)
movl 0x4(%rdi), %r14d
movq %rsi, %rdi
callq 0x7ab4
pushq $0x3
popq %rsi
movl %r14d, %edi
movl %eax, %edx
movq %rbx, %rcx
callq 0x3240
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/nightmeng[P]net/src/epoll.cpp
// Function: epoll::poll_service()
void epoll::poll_service(){
	struct epoll_event evs[20000];
	polling = true;
	while(polling){
		int cnt = ::epoll_wait(fd, evs, 20000, 30);

		for(int i = 0; i != cnt; ++i){
			struct epoll_event &ev = evs[i];

			socket_base *sock = reinterpret_cast<socket_base*>(ev.data.ptr);
			if(nullptr == sock){
				continue;
			}

			if(ev.events & EPOLLRDHUP){
				sock->rdhupevent();
			}
			else{
				if(ev.events & EPOLLERR){
					sock->eevent();
				}
				if(ev.events & EPOLLIN){
					sock->ievent();
				}
				if(ev.events & EPOLLOUT){
					sock->oevent();
				}
				if(ev.events & EPOLLHUP){
					sock->hupevent();
				}
				if(ev.events & EPOLLPRI){
					sock->prievent();
				}
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3a988, %rsp          # imm = 0x3A988
movb $0x1, (%rdi)
movb $0x1, %al
pushq $0x38
popq %r13
pushq $0x28
popq %r14
movq %rdi, -0x30(%rbp)
testb $0x1, %al
je 0x84db
movl 0x4(%rdi), %edi
leaq -0x3a9b0(%rbp), %rsi
movl $0x4e20, %edx           # imm = 0x4E20
pushq $0x1e
popq %rcx
callq 0x3120
movl %eax, %eax
imulq $0xc, %rax, %r15
xorl %ebx, %ebx
cmpq %rbx, %r15
je 0x84d0
movq -0x3a9ac(%rbp,%rbx), %r12
testq %r12, %r12
je 0x84c7
movl -0x3a9b0(%rbp,%rbx), %eax
btl $0xd, %eax
movq %r13, %rcx
jb 0x84bd
testb $0x8, %al
je 0x8477
movq (%r12), %rax
movq %r12, %rdi
callq *0x20(%rax)
movl -0x3a9b0(%rbp,%rbx), %eax
testb $0x1, %al
je 0x848c
movq (%r12), %rax
movq %r12, %rdi
callq *0x10(%rax)
movl -0x3a9b0(%rbp,%rbx), %eax
testb $0x4, %al
je 0x84a1
movq (%r12), %rax
movq %r12, %rdi
callq *0x18(%rax)
movl -0x3a9b0(%rbp,%rbx), %eax
testb $0x10, %al
je 0x84b6
movq (%r12), %rax
movq %r12, %rdi
callq *0x30(%rax)
movl -0x3a9b0(%rbp,%rbx), %eax
movq %r14, %rcx
testb $0x2, %al
je 0x84c7
movq (%r12), %rax
movq %r12, %rdi
callq *(%rax,%rcx)
addq $0xc, %rbx
jmp 0x843c
movq -0x30(%rbp), %rdi
movb (%rdi), %al
jmp 0x8415
addq $0x3a988, %rsp          # imm = 0x3A988
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/stemmer/stemmer.cpp
// Function: main
int main(int argc, char** argv) {
	int inputFD = -1;
	int outputFD = -1;

	const char* inputPath = "STDIN";
	if(argc < 2) {
		inputFD = 0;
	} else {
		inputPath = argv[1];
		inputFD = open(inputPath, O_RDONLY);
		if(inputFD < 0) {
			printf("Cannot open file %s\n", inputPath);
			return 1;
		}
	}

	if(argc < 3) {
		outputFD = 1;
	} else {
		char* outputPath = argv[2];
		outputFD = open(outputPath, O_WRONLY | O_CREAT, 0664);
		if(outputFD < 0) {
			printf("Cannot open file %s\n", outputPath);
			return 1;
		}
	}

	struct stat fileStat;
	if(fstat(inputFD, &fileStat) != 0) {
		printf("Cannot stat file %s\n", inputPath);
		return 1;
	}

	processFile(inputFD, outputFD, &fileStat);

	if(outputFD == 1) {
		printf("\n");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x90, %rsp
pushq $0x1
popq %rbp
cmpl $0x2, %edi
jge 0x120f
xorl %r14d, %r14d
leaq 0xdf7(%rip), %rbx       # 0x2004
jmp 0x124e
movq %rsi, %r15
movl %edi, %r12d
movq 0x8(%rsi), %rbx
movq %rbx, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x1070
testl %eax, %eax
js 0x1281
movl %eax, %r14d
cmpl $0x2, %r12d
je 0x124e
movq 0x10(%r15), %r15
pushq $0x41
popq %rsi
movq %r15, %rdi
movl $0x1b4, %edx            # imm = 0x1B4
xorl %eax, %eax
callq 0x1070
movl %eax, %ebp
testl %eax, %eax
js 0x12a7
movq %rsp, %rsi
movl %r14d, %edi
callq 0x10e0
testl %eax, %eax
je 0x1266
leaq 0xdbb(%rip), %rdi       # 0x201f
jmp 0x1288
movl %r14d, %edi
movl %ebp, %esi
callq 0x12b3
xorl %ebx, %ebx
cmpl $0x1, %ebp
jne 0x1295
pushq $0xa
popq %rdi
callq 0x10a0
jmp 0x1295
leaq 0xd82(%rip), %rdi       # 0x200a
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1040
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd5c(%rip), %rdi       # 0x200a
movq %r15, %rsi
jmp 0x128b
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/stemmer/stemmer.cpp
// Function: processFile(int, int, stat*)
void processFile(int inputFD, int outputFD, struct stat* const fileStat) {
	char* fullData = 0;
	readFullData(inputFD, &fullData);

	char* buffer = new char[4096];
	int offset = 0;
	readToken(fullData, offset, buffer, 4096);
	stemToken(buffer);
	writeToken(buffer, outputFD);
	while(readToken(fullData, offset, buffer, 4096)) {
		writeToken(" ", outputFD);
		stemToken(buffer);
		writeToken(buffer, outputFD);
	}
	delete fullData;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
leaq 0x8(%rsp), %r12
andq $0x0, (%r12)
movq %r12, %rsi
callq 0x1d55
movl $0x1000, %edi           # imm = 0x1000
callq 0x1030
movq %rax, %r14
leaq 0x14(%rsp), %r15
andl $0x0, (%r15)
movq (%r12), %rdi
movq %r15, %rsi
movq %rax, %rdx
movl $0x1000, %ecx           # imm = 0x1000
callq 0x1cb9
leaq 0xd31(%rip), %r12       # 0x2034
movq %r14, %rdi
callq 0x1350
movq %r14, %rdi
movl %ebx, %esi
callq 0x1c34
movq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
movl $0x1000, %ecx           # imm = 0x1000
callq 0x1cb9
testb %al, %al
je 0x133a
movq %r12, %rdi
movl %ebx, %esi
callq 0x1c34
jmp 0x1303
movq 0x8(%rsp), %rdi
callq 0x1080
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/common/stem.cpp
// Function: ends(char const*)
static int ends(const char * s)
{  int length = s[0];
   if (s[length] != b[k]) return FALSE; /* tiny speed-up */
   if (length > k-k0+1) return FALSE;
   if (memcmp(b+k-length+1,s+1,length) != 0) return FALSE;
   j = k-length;
   return TRUE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rsi
movsbq (%rdi), %r14
movb (%rdi,%r14), %al
movq 0x263c(%rip), %rdi      # 0x4090
movslq 0x263d(%rip), %r15      # 0x4098
xorl %ebx, %ebx
cmpb (%rdi,%r15), %al
jne 0x1a98
movl %r15d, %eax
subl 0x2630(%rip), %eax      # 0x409c
incl %eax
cmpl %r14d, %eax
jl 0x1a98
addq %r15, %rdi
subq %r14, %rdi
incq %rdi
incq %rsi
movq %r14, %rdx
callq 0x1090
testl %eax, %eax
jne 0x1a98
subl %r14d, %r15d
movl %r15d, 0x260b(%rip)     # 0x40a0
pushq $0x1
popq %rbx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/ivanzamanov[P]kmeans/src/common/stem.cpp
// Function: m()
static int m()
{  int n = 0;
   int i = k0;
   while(TRUE)
   {  if (i > j) return n;
      if (! cons(i)) break; i++;
   }
   i++;
   while(TRUE)
   {  while(TRUE)
      {  if (i > j) return n;
            if (cons(i)) break;
            i++;
      }
      i++;
      n++;
      while(TRUE)
      {  if (i > j) return n;
         if (! cons(i)) break;
         i++;
      }
      i++;
   }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x25f2(%rip), %ebx      # 0x409c
movl 0x25ef(%rip), %r14d     # 0x40a0
cmpl %r14d, %ebx
jg 0x1ac5
movl %ebx, %edi
callq 0x1ba2
testl %eax, %eax
je 0x1ace
incl %ebx
jmp 0x1ab1
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
xorl %ebp, %ebp
cmpl %r14d, %ebx
jge 0x1ac7
incl %ebx
movl %ebx, %edi
callq 0x1ba2
testl %eax, %eax
je 0x1ad0
incl %ebx
incl %ebp
cmpl %r14d, %ebx
jg 0x1ac7
movl %ebx, %edi
callq 0x1ba2
testl %eax, %eax
je 0x1ad0
incl %ebx
jmp 0x1ae6