LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::PumpEvents(bool)
bool CConnectionHandlerInt::PumpEvents(bool block)
{
    assert(IsEventThread());
    if (!m_event_base)
        return false;
    if (m_shutdown)
        return false;
    event_base_loop(m_event_base, block ? EVLOOP_ONCE : EVLOOP_NONBLOCK);
    if (m_shutdown) {
        m_event_base.free();
        m_interface.OnShutdown();
        return false;
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
callq 0x8016
testb %al, %al
je 0x8f3b
cmpq $0x0, 0x190(%rbx)
je 0x8f34
cmpb $0x0, 0xed(%rbx)
jne 0x8f34
leaq 0x190(%rbx), %r14
movq %r14, %rdi
callq 0x9504
movzbl %bpl, %ecx
pushq $0x2
popq %rsi
subl %ecx, %esi
movq %rax, %rdi
callq 0x43e0
movb $0x1, %al
cmpb $0x1, 0xed(%rbx)
jne 0x8f36
movq %r14, %rdi
callq 0x97ba
movq 0xc0(%rbx), %rdi
movq (%rdi), %rax
callq *0x98(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x79d7(%rip), %rdi      # 0x10919
leaq 0x78c2(%rip), %rsi      # 0x1080b
leaq 0x7faf(%rip), %rcx      # 0x10eff
movl $0x1a1, %edx            # imm = 0x1A1
callq 0x4260
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::CloseConnection(long, bool)
void CConnectionHandlerInt::CloseConnection(ConnID id, bool immediately)
{
    if (id >= 0) {
        optional_lock(m_conn_mutex, m_enable_threading);
        auto it = m_connected.find(id);
        if (it != m_connected.end()) {
            if (immediately)
                it->second->Disconnect();
            else
                it->second->DisconnectWhenFinished();
        }
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, 0x10(%rsp)
testq %rsi, %rsi
js 0x8fc1
movl %edx, %ebx
movq %rdi, %r14
addq $0xf0, %rdi
movb 0xec(%r14), %al
movq %rdi, (%rsp)
movb %al, 0x8(%rsp)
cmpb $0x1, %al
jne 0x8f8f
callq 0x994c
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x9e94
addq $0x8, %r14
cmpq %r14, %rax
je 0x8fb9
movq 0x28(%rax), %rdi
testb %bl, %bl
je 0x8fb4
callq 0xc1f8
jmp 0x8fb9
callq 0xc204
movq %rsp, %rdi
callq 0x96b0
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x96b0
movq %rbx, %rdi
callq 0x4660
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::PauseRecv(long)
void CConnectionHandlerInt::PauseRecv(ConnID id)
{
    if (id >= 0) {
        optional_lock(m_conn_mutex, m_enable_threading);
        auto it = m_connected.find(id);
        if (it != m_connected.end())
            it->second->PauseRecv();
    }
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rsi, 0x18(%rsp)
testq %rsi, %rsi
js 0x9036
movq %rdi, %rbx
addq $0xf0, %rdi
movb 0xec(%rbx), %al
movq %rdi, 0x8(%rsp)
movb %al, 0x10(%rsp)
cmpb $0x1, %al
jne 0x900d
callq 0x994c
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x9e94
addq $0x8, %rbx
cmpq %rbx, %rax
je 0x902c
movq 0x28(%rax), %rdi
callq 0xc246
leaq 0x8(%rsp), %rdi
callq 0x96b0
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x96b0
movq %rbx, %rdi
callq 0x4660
nop
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::UnpauseRecv(long)
void CConnectionHandlerInt::UnpauseRecv(ConnID id)
{
    if (id >= 0) {
        optional_lock(m_conn_mutex, m_enable_threading);
        auto it = m_connected.find(id);
        if (it != m_connected.end())
            it->second->UnpauseRecv();
    }
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rsi, 0x18(%rsp)
testq %rsi, %rsi
js 0x90ac
movq %rdi, %rbx
addq $0xf0, %rdi
movb 0xec(%rbx), %al
movq %rdi, 0x8(%rsp)
movb %al, 0x10(%rsp)
cmpb $0x1, %al
jne 0x9083
callq 0x994c
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x9e94
addq $0x8, %rbx
cmpq %rbx, %rax
je 0x90a2
movq 0x28(%rax), %rdi
callq 0xc2ca
leaq 0x8(%rsp), %rdi
callq 0x96b0
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x96b0
movq %rbx, %rdi
callq 0x4660
nop
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::Send(long, unsigned char const*, unsigned long)
bool CConnectionHandlerInt::Send(ConnID id, const unsigned char* data, size_t size)
{
    bool ret = false;
    if (id >= 0) {
        optional_lock(m_conn_mutex, m_enable_threading);
        auto it = m_connected.find(id);
        if (it == m_connected.end())
            ret = false;
        else
            ret = it->second->Write(data, size);
    }
    return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, 0x18(%rsp)
testq %rsi, %rsi
js 0x912d
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
addq $0xf0, %rdi
movb 0xec(%r15), %al
movq %rdi, 0x8(%rsp)
movb %al, 0x10(%rsp)
cmpb $0x1, %al
jne 0x9104
callq 0x994c
leaq 0x18(%rsp), %rsi
movq %r15, %rdi
callq 0x9e94
addq $0x8, %r15
cmpq %r15, %rax
je 0x9131
movq 0x28(%rax), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xcf76
movl %eax, %ebx
jmp 0x9133
xorl %ebx, %ebx
jmp 0x913d
xorl %ebx, %ebx
leaq 0x8(%rsp), %rdi
callq 0x96b0
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x96b0
movq %rbx, %rdi
callq 0x4660
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::SetRateLimit(long, CRateLimit const&)
void CConnectionHandlerInt::SetRateLimit(ConnID id, const CRateLimit& limit)
{
    if (id >= 0) {
        optional_lock(m_conn_mutex, m_enable_threading);
        auto it = m_connected.find(id);
        if (it != m_connected.end())
            it->second->SetRateLimit(limit);
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, 0x10(%rsp)
testq %rsi, %rsi
js 0x91be
movq %rdx, %rbx
movq %rdi, %r14
addq $0xf0, %rdi
movb 0xec(%r14), %al
movq %rdi, (%rsp)
movb %al, 0x8(%rsp)
cmpb $0x1, %al
jne 0x9194
callq 0x994c
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x9e94
addq $0x8, %r14
cmpq %r14, %rax
je 0x91b6
movq 0x28(%rax), %rdi
movq %rbx, %rsi
callq 0xc3e4
movq %rsp, %rdi
callq 0x96b0
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x96b0
movq %rbx, %rdi
callq 0x4660
nop
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::SetIncomingRateLimit(CRateLimit const&)
void CConnectionHandlerInt::SetIncomingRateLimit(const CRateLimit& limit)
{
    event_type<ev_token_bucket_cfg> temp_cfg(ev_token_bucket_cfg_new(limit.nMaxReadRate, limit.nMaxBurstRead, limit.nMaxWriteRate, limit.nMaxBurstWrite, nullptr));
    {
        optional_lock(m_group_rate_mutex, m_enable_threading);
        bufferevent_rate_limit_group_set_cfg(m_incoming_rate_limit, temp_cfg);
        m_incoming_rate_cfg.swap(temp_cfg);
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq (%rsi), %rax
movq 0x8(%rsi), %rdi
movq 0x18(%rsi), %rdx
movq 0x10(%rsi), %rcx
movq %rax, %rsi
xorl %r8d, %r8d
callq 0x45a0
movq %rsp, %rdi
movq %rax, %rsi
callq 0x97d2
leaq 0x140(%rbx), %rdi
movb 0xec(%rbx), %al
movq %rdi, 0x8(%rsp)
movb %al, 0x10(%rsp)
cmpb $0x1, %al
jne 0x9228
callq 0x994c
leaq 0x180(%rbx), %rdi
callq 0x97fa
movq %rax, %r14
movq %rsp, %rdi
callq 0x9638
movq %r14, %rdi
movq %rax, %rsi
callq 0x4340
movq 0x170(%rbx), %rax
movq %rsp, %r14
movq (%r14), %rcx
movq %rcx, 0x170(%rbx)
movq %rax, (%r14)
leaq 0x8(%rsp), %rdi
callq 0x96b0
movq %r14, %rdi
callq 0x944c
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
jmp 0x928d
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x96b0
movq %rsp, %rdi
callq 0x944c
movq %rbx, %rdi
callq 0x4660
nop
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::SetOutgoingRateLimit(CRateLimit const&)
void CConnectionHandlerInt::SetOutgoingRateLimit(const CRateLimit& limit)
{
    event_type<ev_token_bucket_cfg> temp_cfg(ev_token_bucket_cfg_new(limit.nMaxReadRate, limit.nMaxBurstRead, limit.nMaxWriteRate, limit.nMaxBurstWrite, nullptr));
    {
        optional_lock(m_group_rate_mutex, m_enable_threading);
        bufferevent_rate_limit_group_set_cfg(m_outgoing_rate_limit, temp_cfg);
        m_outgoing_rate_cfg.swap(temp_cfg);
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq (%rsi), %rax
movq 0x8(%rsi), %rdi
movq 0x18(%rsi), %rdx
movq 0x10(%rsi), %rcx
movq %rax, %rsi
xorl %r8d, %r8d
callq 0x45a0
movq %rsp, %rdi
movq %rax, %rsi
callq 0x97d2
leaq 0x140(%rbx), %rdi
movb 0xec(%rbx), %al
movq %rdi, 0x8(%rsp)
movb %al, 0x10(%rsp)
cmpb $0x1, %al
jne 0x92ec
callq 0x994c
leaq 0x188(%rbx), %rdi
callq 0x97fa
movq %rax, %r14
movq %rsp, %rdi
callq 0x9638
movq %r14, %rdi
movq %rax, %rsi
callq 0x4340
movq 0x178(%rbx), %rax
movq %rsp, %r14
movq (%r14), %rcx
movq %rcx, 0x178(%rbx)
movq %rax, (%r14)
leaq 0x8(%rsp), %rdi
callq 0x96b0
movq %r14, %rdi
callq 0x944c
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
jmp 0x9351
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x96b0
movq %rsp, %rdi
callq 0x944c
movq %rbx, %rdi
callq 0x4660
nop
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::ResetPingTimeout(long, int)
void CConnectionHandlerInt::ResetPingTimeout(ConnID id, int seconds)
{
    if (id >= 0) {
        optional_lock(m_conn_mutex, m_enable_threading);
        auto it = m_connected.find(id);
        if (it != m_connected.end())
            it->second->ResetPingTimeout(seconds);
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, 0x10(%rsp)
testq %rsi, %rsi
js 0x9400
movl %edx, %ebx
movq %rdi, %r14
addq $0xf0, %rdi
movb 0xec(%r14), %al
movq %rdi, (%rsp)
movb %al, 0x8(%rsp)
cmpb $0x1, %al
jne 0x93d7
callq 0x994c
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x9e94
addq $0x8, %r14
cmpq %r14, %rax
je 0x93f8
movq 0x28(%rax), %rdi
movl %ebx, %esi
callq 0xc210
movq %rsp, %rdi
callq 0x96b0
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x96b0
movq %rbx, %rdi
callq 0x4660
nop
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/eventtypes.h
// Function: event_type<event_base>::operator=(event_base*)
inline event_type& operator=(T* rhs)
    {
        assert(rhs);
        free();
        m_obj = rhs;
        return *this;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x94ce
movq %rsi, %r14
movq %rdi, %rbx
callq 0x97ba
movq %r14, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x7b77(%rip), %rdi      # 0x1104c
leaq 0x7a88(%rip), %rsi      # 0x10f64
leaq 0x7b6d(%rip), %rcx      # 0x11050
pushq $0x67
popq %rdx
callq 0x4260
nop
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/resolve.cpp
// Function: CDNSResponse::iterator::operator++(int)
CDNSResponse::iterator CDNSResponse::iterator::operator++(int)
{
    assert(m_ai != nullptr);
    iterator ret = iterator(m_ai);
    m_ai = m_ai->ai_next;
    return ret;
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0xa884
movq 0x28(%rax), %rcx
movq %rcx, (%rdi)
retq
pushq %rax
leaq 0x6b44(%rip), %rdi      # 0x113d0
leaq 0x6b4d(%rip), %rsi      # 0x113e0
leaq 0x6b93(%rip), %rcx      # 0x1142d
pushq $0x23
popq %rdx
callq 0x4260
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/resolve.cpp
// Function: CDNSResponse::operator=(CDNSResponse&&)
CDNSResponse& CDNSResponse::operator=(CDNSResponse&& rhs) noexcept
{
    clear();
    m_ai = rhs.m_ai;
    rhs.m_ai = nullptr;
    return *this;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0xa8f8
movq (%r14), %rax
movq %rax, (%rbx)
andq $0x0, (%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rdi
callq 0x9821
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/resolve.cpp
// Function: CDNSResolve::Resolve(event_type<evdns_base> const&, char const*, char const*, addrinfo const*)
event_type<evdns_getaddrinfo_request> CDNSResolve::Resolve(const event_type<evdns_base>& dns_base, const char* host, const char* port, const evutil_addrinfo* hints)
{
    assert(host != nullptr);
    assert(port != nullptr);
    // evdns_getaddrinfo may return NULL on success.
    event_type<evdns_getaddrinfo_request> result;
    result.reset(evdns_getaddrinfo(dns_base, host, port, hints, dns_callback, this));
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rcx, %rcx
je 0xa9dd
movq %r8, %r12
testq %r8, %r8
je 0xa9f6
movq %r9, %r14
movq %rcx, %r13
movq %rsi, %r15
movq %rdi, %rbx
andq $0x0, (%rdi)
movq %rdx, %rdi
callq 0x956c
leaq 0x6d(%rip), %r8         # 0xaa26
movq %rax, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
movq %r15, %r9
callq 0x4460
movq %rax, (%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x6abd(%rip), %rdi      # 0x114a1
leaq 0x69f5(%rip), %rsi      # 0x113e0
leaq 0x6abf(%rip), %rcx      # 0x114b1
pushq $0x7c
jmp 0xaa0d
leaq 0x6b3d(%rip), %rdi      # 0x1153a
leaq 0x69dc(%rip), %rsi      # 0x113e0
leaq 0x6aa6(%rip), %rcx      # 0x114b1
pushq $0x7d
popq %rdx
callq 0x4260
movq %rax, %r14
movq %rbx, %rdi
callq 0xa586
movq %r14, %rdi
callq 0x4660
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/resolve.cpp
// Function: CDNSResolve::dns_callback(int, addrinfo*, void*)
void CDNSResolve::dns_callback(int result, evutil_addrinfo* ai, void* ctx)
{
    if (result == EVUTIL_EAI_CANCEL) {
        // Do nothing. Class may no longer exist.
    } else if (result == DNS_ERR_NONE) {
        assert(ctx != nullptr);
        CDNSResolve* resolver = static_cast<CDNSResolve*>(ctx);
        resolver->OnResolveSuccess(CDNSResponse(ai));
    } else {
        assert(ctx != nullptr);
        CDNSResolve* resolver = static_cast<CDNSResolve*>(ctx);
        resolver->OnResolveFailure(result);
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
cmpl $0xfffea06f, %edi       # imm = 0xFFFEA06F
je 0xaa5c
movl %edi, %eax
testl %edi, %edi
jne 0xaa62
testq %rdx, %rdx
je 0xaa7a
leaq 0x8(%rsp), %rax
movq %rsi, (%rax)
movq (%rdx), %rcx
movq %rdx, %rdi
movq %rax, %rsi
callq *0x10(%rcx)
leaq 0x8(%rsp), %rdi
callq 0xa8e8
addq $0x10, %rsp
popq %rbx
retq
testq %rdx, %rdx
je 0xaa99
movq (%rdx), %rcx
movq 0x18(%rcx), %rcx
movq %rdx, %rdi
movl %eax, %esi
addq $0x10, %rsp
popq %rbx
jmpq *%rcx
leaq 0x6ac9(%rip), %rdi      # 0x1154a
leaq 0x6958(%rip), %rsi      # 0x113e0
leaq 0x6aca(%rip), %rcx      # 0x11559
movl $0x89, %edx
callq 0x4260
leaq 0x6aaa(%rip), %rdi      # 0x1154a
leaq 0x6939(%rip), %rsi      # 0x113e0
leaq 0x6aab(%rip), %rcx      # 0x11559
movl $0x8d, %edx
callq 0x4260
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xa8e8
movq %rbx, %rdi
callq 0x4660
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/directconn.cpp
// Function: CDirectConnection::Connect()
void CDirectConnection::Connect()
{
    assert(m_connection.IsSet());

    const CConnectionOptions& opts = m_connection.GetOptions();

    timeval connTimeout;
    connTimeout.tv_sec = opts.nConnTimeout;
    connTimeout.tv_usec = 0;

    sockaddr_storage addr_storage;
    memset(&addr_storage, 0, sizeof(addr_storage));
    int addrlen = sizeof(addr_storage);
    sockaddr* addr = reinterpret_cast<sockaddr*>(&addr_storage);
    m_connection.GetSockAddr(addr, &addrlen);

    if (m_connection.CanConnectDirect())
        BareConnect(m_event_base, m_handler.GetBevOpts(), BAD_SOCKET, addr, addrlen, connTimeout);
    else
        OnConnectionFailure(ConnectionFailureType::CONNECT, 0, m_connection, false);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
movq %rdi, %rbx
leaq 0x18(%rdi), %r14
movq %r14, %rdi
callq 0x5f12
testb %al, %al
je 0xac7b
movq %r14, %rdi
callq 0x63e8
movslq 0xc(%rax), %rax
movq %rax, 0x10(%rsp)
andq $0x0, 0x18(%rsp)
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rsi
movaps %xmm0, 0x70(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
leaq 0xc(%rsp), %rdx
movl $0x80, (%rdx)
movq %r14, %rdi
callq 0x5d0a
movq %r14, %rdi
callq 0x6456
testb %al, %al
je 0xac3b
leaq 0x2b0(%rbx), %r14
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rbx
callq 0x8e8e
movl 0xc(%rsp), %r9d
leaq 0x10(%rsp), %rcx
movq %rcx, (%rsp)
pushq $-0x1
popq %rcx
leaq 0x20(%rsp), %r8
movq %r14, %rdi
movq %rbx, %rsi
movl %eax, %edx
callq 0xb9a4
jmp 0xac6e
leaq 0xa8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x6bee
pushq $0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0xc4d4
leaq 0xa8(%rsp), %rdi
callq 0x4d22
addq $0x220, %rsp            # imm = 0x220
popq %rbx
popq %r14
popq %r15
retq
leaq 0x6924(%rip), %rdi      # 0x115a6
leaq 0x6932(%rip), %rsi      # 0x115bb
leaq 0x693e(%rip), %rcx      # 0x115ce
pushq $0x1e
popq %rdx
callq 0x4260
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x4d22
movq %rbx, %rdi
callq 0x4660
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/dnsconn.cpp
// Function: CDNSConnection::ConnectResolved()
void CDNSConnection::ConnectResolved()
{
    assert(m_iter != m_resolved.end());
    assert(!m_resolved.empty());

    const CConnectionOptions& opts = m_connection.GetOptions();
    timeval connTimeout;
    connTimeout.tv_sec = opts.nConnTimeout;
    connTimeout.tv_usec = 0;
    if (CConnection::CanConnectDirect(m_iter->ai_addr, opts.nFamily))
        BareConnect(m_event_base, m_handler.GetBevOpts(), BAD_SOCKET, m_iter->ai_addr, m_iter->ai_addrlen, connTimeout);
    else
        OnConnectFailure(0, 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r15
leaq 0x2d8(%rdi), %rbx
leaq 0x2d0(%rdi), %r12
movq %r12, %rdi
callq 0xa914
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa8d4
testb %al, %al
je 0xb27f
movq %r12, %rdi
callq 0xa918
testb %al, %al
jne 0xb298
leaq 0x18(%r15), %rdi
callq 0x63e8
movq %rax, %r12
movslq 0xc(%rax), %rax
movq %rax, 0x8(%rsp)
andq $0x0, 0x10(%rsp)
movq %rbx, %rdi
callq 0xa8a2
movq 0x18(%rax), %rdi
movl 0x28(%r12), %esi
callq 0x63f8
testb %al, %al
je 0xb266
leaq 0x2b0(%r15), %r12
movq 0x8(%r15), %rdi
movq 0x10(%r15), %r15
callq 0x8e8e
movl %eax, %ebp
movq %rbx, %rdi
callq 0xa8a2
movq 0x18(%rax), %r13
movq %rbx, %rdi
callq 0xa8a2
movl 0x10(%rax), %r9d
movq %r14, (%rsp)
pushq $-0x1
popq %rcx
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movq %r13, %r8
callq 0xb9a4
jmp 0xb270
movq %r15, %rdi
xorl %esi, %esi
callq 0xb69a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x64d4(%rip), %rdi      # 0x1175a
leaq 0x638a(%rip), %rsi      # 0x11617
leaq 0x651b(%rip), %rcx      # 0x117af
pushq $0x6c
jmp 0xb2af
leaq 0x64a7(%rip), %rdi      # 0x11746
leaq 0x6371(%rip), %rsi      # 0x11617
leaq 0x6502(%rip), %rcx      # 0x117af
pushq $0x6d
popq %rdx
callq 0x4260
nop
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/dnsconn.cpp
// Function: CDNSConnection::OnResolveFailure(int)
void CDNSConnection::OnResolveFailure(int error)
{
    assert(m_resolved.empty());
    assert(m_iter == m_resolved.end());

    m_request.reset(nullptr);
    OnConnectionFailure(ConnectionFailureType::RESOLVE, error, m_connection, m_retries > 0 ? m_retries-- != 0 : m_retries != 0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movl %esi, %ebx
movq %rdi, %r14
leaq 0x2d0(%rdi), %r15
movq %r15, %rdi
callq 0xa918
testb %al, %al
je 0xb363
leaq 0x2d8(%r14), %r12
movq %r15, %rdi
callq 0xa914
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r12, %rdi
callq 0xa8ca
testb %al, %al
je 0xb37c
andq $0x0, 0x2e0(%r14)
leaq 0x18(%r14), %rsi
leaq 0x10(%rsp), %rdi
callq 0x6bee
movl 0x2c8(%r14), %eax
testl %eax, %eax
jle 0xb331
decl %eax
movl %eax, 0x2c8(%r14)
movb $0x1, %al
jmp 0xb334
setne %al
movzbl %al, %r8d
pushq $0x2
popq %rsi
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
movl %ebx, %edx
callq 0xc4d4
leaq 0x10(%rsp), %rdi
callq 0x4d22
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x63dd(%rip), %rdi      # 0x11747
leaq 0x62a6(%rip), %rsi      # 0x11617
leaq 0x6312(%rip), %rcx      # 0x1168a
pushq $0x3f
jmp 0xb393
leaq 0x62ec(%rip), %rdi      # 0x1166f
leaq 0x628d(%rip), %rsi      # 0x11617
leaq 0x62f9(%rip), %rcx      # 0x1168a
pushq $0x40
popq %rdx
callq 0x4260
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x4d22
movq %rbx, %rdi
callq 0x4660
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/dnsconn.cpp
// Function: CDNSConnection::OnResolveSuccess(CDNSResponse&&)
void CDNSConnection::OnResolveSuccess(CDNSResponse&& response)
{
    assert(m_resolved.empty());
    assert(m_iter == m_resolved.end());

    m_request.reset(nullptr);
    m_resolved = std::move(response);
    m_iter = m_resolved.begin();
    ConnectResolved();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x2d0(%rdi), %r14
movq %r14, %rdi
callq 0xa918
testb %al, %al
je 0xb432
leaq 0x2d8(%rbx), %r12
movq %r14, %rdi
callq 0xa914
movq %rsp, %rsi
movq %rax, (%rsi)
movq %r12, %rdi
callq 0xa8ca
testb %al, %al
je 0xb44b
andq $0x0, 0x2e0(%rbx)
movq %r14, %rdi
movq %r15, %rsi
callq 0xa930
movq %r14, %rdi
callq 0xa910
movq %rax, 0x2d8(%rbx)
movq %rbx, %rdi
callq 0xb198
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x630e(%rip), %rdi      # 0x11747
leaq 0x61d7(%rip), %rsi      # 0x11617
leaq 0x6276(%rip), %rcx      # 0x116bd
pushq $0x48
jmp 0xb462
leaq 0x621d(%rip), %rdi      # 0x1166f
leaq 0x61be(%rip), %rsi      # 0x11617
leaq 0x625d(%rip), %rcx      # 0x116bd
pushq $0x49
popq %rdx
callq 0x4260
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/dnsconn.cpp
// Function: CDNSConnection::OnConnectSuccess(event_type<bufferevent>&&)
void CDNSConnection::OnConnectSuccess(event_type<bufferevent>&& bev)
{
    assert(bev);
    assert(!m_resolved.empty());
    assert(m_iter != m_resolved.end());
    assert(!m_request);

    CConnection resolved(m_connection.GetOptions(), m_connection.GetNetConfig(), m_iter->ai_addr, m_iter->ai_addrlen);
    m_resolved.clear();
    m_iter = m_resolved.end();
    m_retries = m_connection.GetOptions().nRetries;
    OnOutgoingConnected(std::move(bev), std::move(resolved));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x388, %rsp            # imm = 0x388
cmpq $0x0, (%rsi)
je 0xb5ea
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x2d0(%rdi), %r15
movq %r15, %rdi
callq 0xa918
testb %al, %al
jne 0xb603
leaq 0x2d8(%r14), %r12
movq %r15, %rdi
callq 0xa914
leaq 0x98(%rsp), %rsi
movq %rax, (%rsi)
movq %r12, %rdi
callq 0xa8d4
testb %al, %al
je 0xb61c
cmpq $0x0, 0x2e0(%r14)
jne 0xb635
leaq 0x18(%r14), %r13
movq %r13, %rdi
callq 0x63e8
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x1c(%rax), %xmm2
movaps %xmm0, 0x30(%rsp)
movaps %xmm1, 0x40(%rsp)
movups %xmm2, 0x4c(%rsp)
movq %r13, %rdi
callq 0x63f0
leaq 0x60(%rsp), %rdi
movq %rax, %rsi
callq 0x4e9a
movq %r12, %rdi
callq 0xa8a2
movq 0x18(%rax), %rbp
movq %r12, %rdi
callq 0xa8a2
movl 0x10(%rax), %ecx
movups 0x4c(%rsp), %xmm0
movups %xmm0, 0x1c(%rsp)
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x98(%rsp), %rdi
leaq 0x60(%rsp), %rsi
movq %rbp, %rdx
callq 0x61d8
leaq 0x70(%rsp), %rdi
callq 0x4fd0
movq %r15, %rdi
callq 0xa8f8
movq %r15, %rdi
callq 0xa914
movq %rax, (%r12)
movq %r13, %rdi
callq 0x63e8
movl 0x8(%rax), %eax
movl %eax, 0x2c8(%r14)
leaq 0x210(%rsp), %r15
leaq 0x98(%rsp), %rsi
movq %r15, %rdi
callq 0x9720
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xcd9a
leaq 0x210(%rsp), %rdi
callq 0x4d22
leaq 0x98(%rsp), %rdi
callq 0x4d22
addq $0x388, %rsp            # imm = 0x388
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6250(%rip), %rdi      # 0x11841
leaq 0x601f(%rip), %rsi      # 0x11617
leaq 0x60fd(%rip), %rcx      # 0x116fc
pushq $0x53
jmp 0xb64c
leaq 0x613c(%rip), %rdi      # 0x11746
leaq 0x6006(%rip), %rsi      # 0x11617
leaq 0x60e4(%rip), %rcx      # 0x116fc
pushq $0x54
jmp 0xb64c
leaq 0x6137(%rip), %rdi      # 0x1175a
leaq 0x5fed(%rip), %rsi      # 0x11617
leaq 0x60cb(%rip), %rcx      # 0x116fc
pushq $0x55
jmp 0xb64c
leaq 0x5fd0(%rip), %rdi      # 0x1160c
leaq 0x5fd4(%rip), %rsi      # 0x11617
leaq 0x60b2(%rip), %rcx      # 0x116fc
pushq $0x56
popq %rdx
callq 0x4260
movq %rax, %rbx
leaq 0x210(%rsp), %rdi
callq 0x4d22
jmp 0xb669
jmp 0xb666
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x4d22
jmp 0xb685
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x4fd0
movq %rbx, %rdi
callq 0x4660
nop
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/eventtypes.h
// Function: event_type<evdns_getaddrinfo_request>::operator=(event_type<evdns_getaddrinfo_request>&&)
inline event_type& operator=(event_type&& rhs) noexcept
    {
        free();
        m_obj = rhs.m_obj;
        rhs.reset(nullptr);
        return *this;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0xa596
movq (%r14), %rax
movq %rax, (%rbx)
andq $0x0, (%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rdi
callq 0x9821
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/bareconn.cpp
// Function: CBareConnection::conn_event(bufferevent*, short, void*)
void CBareConnection::conn_event(bufferevent* bev, short event, void* ctx)
{
    assert(bev != nullptr);
    assert(ctx != nullptr);
    CBareConnection* data = static_cast<CBareConnection*>(ctx);
    if ((event & BEV_EVENT_CONNECTED) != 0)
        data->OnConnectSuccess(std::move(data->m_bev));
    else {
        evutil_socket_t sock = bufferevent_getfd(bev);
        (void)sock;
        // sock may be BAD_SOCKET here if it wasn't successfully created.
        int error = evutil_socket_geterror(sock);
        data->m_bev.free();
        data->OnConnectFailure(event, error);
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0xb96e
movq %rdx, %rbx
testq %rdx, %rdx
je 0xb987
movl %esi, %ebp
testb %bpl, %bpl
js 0xb95a
callq 0x4190
callq 0x4040
movl (%rax), %r14d
leaq 0x8(%rbx), %rdi
callq 0xbb26
movq (%rbx), %rax
movq 0x18(%rax), %rax
movswl %bp, %esi
movq %rbx, %rdi
movl %r14d, %edx
popq %rbx
popq %r14
popq %rbp
jmpq *%rax
leaq 0x8(%rbx), %rsi
movq (%rbx), %rax
movq 0x10(%rax), %rax
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmpq *%rax
leaq 0x607c(%rip), %rdi      # 0x119f1
leaq 0x5e6b(%rip), %rsi      # 0x117e7
leaq 0x5e75(%rip), %rcx      # 0x117f8
pushq $0x12
jmp 0xb99e
leaq 0x5bbc(%rip), %rdi      # 0x1154a
leaq 0x5e52(%rip), %rsi      # 0x117e7
leaq 0x5e5c(%rip), %rcx      # 0x117f8
pushq $0x13
popq %rdx
callq 0x4260
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/connectionbase.cpp
// Function: ConnectionBase::DisconnectInt(int)
void ConnectionBase::DisconnectInt(int /*reason*/)
{
    DEBUG_PRINT(LOGINFO, "id:", m_id, "disconnecting");
    m_disconnect_func.del();
    m_reconnect_func.del();
    m_disconnect_wait_func.del();
    m_check_write_buffer_func.del();
    m_ping_timeout_func.del();
    m_first_data_func.del();
    {
        BufferEventLocker lock(m_bev);
        bufferevent_disable(m_bev, EV_READ | EV_WRITE);
        bufferevent_setcb(m_bev, nullptr, nullptr, nullptr, nullptr);
    }
    bool reconnect = m_connection.GetOptions().fPersistent && this->IsOutgoing();
    m_handler.OnDisconnected(m_id, reconnect);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x1e0, %rdi            # imm = 0x1E0
callq 0xf8b4
leaq 0x1b8(%rbx), %rdi
callq 0xf8b4
leaq 0x208(%rbx), %rdi
callq 0xf8b4
leaq 0x230(%rbx), %rdi
callq 0xf8b4
leaq 0x258(%rbx), %rdi
callq 0xf8b4
leaq 0x280(%rbx), %rdi
callq 0xf8b4
leaq 0x1a8(%rbx), %r14
movq %r14, %rdi
callq 0xbb92
movq %rax, (%rsp)
movq %rax, %rdi
callq 0x4500
movq %r14, %rdi
callq 0xbb92
pushq $0x6
popq %rsi
movq %rax, %rdi
callq 0x4530
movq %r14, %rdi
callq 0xbb92
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x4370
movq %rsp, %rdi
callq 0xd0c8
leaq 0x18(%rbx), %rdi
callq 0x63e8
cmpb $0x1, 0x2(%rax)
jne 0xbf2e
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
jmp 0xbf30
xorl %eax, %eax
movq 0x8(%rbx), %rdi
movq 0x190(%rbx), %rsi
movzbl %al, %edx
callq 0x8226
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0xd0c8
movq %rbx, %rdi
callq 0x4660
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/connectionbase.cpp
// Function: ConnectionBase::InitConnection()
void ConnectionBase::Retry(ConnID newId)
{
    m_bev.free();
    m_rate_cfg.free();
    m_bytes_read = 0;
    m_bytes_written = 0;

    m_id = newId;
    DEBUG_PRINT(LOGVERBOSE, "id:", m_id, "queuing reconnect");
    timeval timeout{m_connection.GetOptions().nRetryInterval, 0};
    m_reconnect_func.add(&timeout);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
cmpq $0x0, 0x1a8(%rdi)
je 0xc833
movq %rdi, %rbx
leaq 0x1a8(%rdi), %r14
leaq 0x18(%rdi), %r12
movq %r12, %rdi
callq 0x63e8
movq %rax, %r15
movq %r12, %rdi
callq 0x63f0
movq %rax, (%rsp)
movq %r14, %rdi
callq 0xbb92
movq %rax, %rdi
callq 0x4190
movl %eax, %ebp
movl %eax, %edi
callq 0xc5e2
movq %r14, %rdi
callq 0xbb92
pushq $0x6
popq %rsi
movq %rax, %rdi
callq 0x4530
movq %r15, 0x8(%rsp)
movslq 0x18(%r15), %rax
leaq 0x30(%rsp), %r15
movq %rax, (%r15)
andq $0x0, 0x8(%r15)
movq %r14, %rdi
callq 0xbb92
movq %rax, %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0x4520
leaq 0x280(%rbx), %r15
movq 0x10(%rbx), %r13
leaq 0x175(%rip), %rax       # 0xc868
leaq 0x40(%rsp), %rsi
movq %rax, (%rsi)
andq $0x0, 0x8(%rsi)
movq %rbx, 0x10(%rsi)
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0xd038
movq %r15, %rdi
movq %r13, %rsi
movl %ebp, %edx
pushq $0x6
popq %rcx
movq %r12, %r8
callq 0xf798
leaq 0x10(%rsp), %rdi
callq 0x95dc
movq (%rsp), %rcx
movslq 0x28(%rcx), %r13
testq %r13, %r13
jle 0xc74e
leaq 0x18e(%rip), %rax       # 0xc8d0
movq %rax, 0x2a8(%rbx)
xorl %r12d, %r12d
jmp 0xc780
cmpl $0x0, 0x8(%rcx)
jle 0xc772
leaq 0x2f9(%rip), %rax       # 0xca54
movq %rax, 0x2a8(%rbx)
movslq (%rcx), %rax
movslq 0x4(%rcx), %r13
addq %rax, %r13
movl 0xc(%rcx), %r12d
jmp 0xc780
andq $0x0, 0x2a8(%rbx)
xorl %r12d, %r12d
xorl %r13d, %r13d
movq %r14, %rdi
callq 0xbb92
pushq $0x2
popq %rsi
movq %rax, %rdi
movq %r13, %rdx
movq %r12, %rcx
callq 0x40c0
movq %r14, %rdi
callq 0xbb92
movq 0x8(%rsp), %rcx
movslq 0x1c(%rcx), %rdx
pushq $0x4
popq %rsi
movq %rax, %rdi
xorl %ecx, %ecx
callq 0x40c0
movq %r14, %rdi
callq 0xbb92
movq 0x2a8(%rbx), %rsi
leaq -0x24f(%rip), %rcx      # 0xc57e
movq %rax, %rdi
xorl %edx, %edx
movq %rbx, %r8
callq 0x4370
movq %r14, %rdi
callq 0xbb92
movq %rax, %rdi
callq 0x4270
movq %rax, %r15
movq %r14, %rdi
callq 0xbb92
movq %rax, %rdi
callq 0x4110
movq %rax, %r14
leaq 0x4cf(%rip), %rsi       # 0xccd6
movq %r15, %rdi
movq %rbx, %rdx
callq 0x4210
leaq 0x51f(%rip), %rsi       # 0xcd38
movq %r14, %rdi
movq %rbx, %rdx
callq 0x4210
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5005(%rip), %rdi      # 0x1183f
leaq 0x5153(%rip), %rsi      # 0x11994
leaq 0x521f(%rip), %rcx      # 0x11a67
movl $0xb7, %edx
callq 0x4260
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x95dc
movq %rbx, %rdi
callq 0x4660
nop
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/connectionbase.cpp
// Function: ConnectionBase::ResetPingTimeout(int)
void ConnectionBase::ResetPingTimeout(int seconds)
{
    if (seconds != 0) {
        timeval timeout = {seconds, 0};
        m_ping_timeout_func.add(&timeout);
    } else
        m_ping_timeout_func.del();
}

// Assembly:
testl %esi, %esi
je 0xc239
subq $0x18, %rsp
movslq %esi, %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
andq $0x0, 0x8(%rsi)
addq $0x258, %rdi            # imm = 0x258
callq 0xf8f0
addq $0x18, %rsp
retq
addq $0x258, %rdi            # imm = 0x258
jmp 0xf8b4
nop
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/connectionbase.cpp
// Function: ConnectionBase::event_cb(bufferevent*, short, void*)
void ConnectionBase::event_cb(bufferevent* /*unused*/, short type, void* ctx)
{
    assert(ctx);
    ConnectionBase* base = static_cast<ConnectionBase*>(ctx);
    if (((type & BEV_EVENT_TIMEOUT) != 0) ||
        ((type & BEV_EVENT_EOF) != 0) ||
        ((type & BEV_EVENT_ERROR) != 0))
        base->DisconnectInt(0);
}

// Assembly:
testq %rdx, %rdx
je 0xc592
testb $0x70, %sil
je 0xc591
movq %rdx, %rdi
jmp 0xbe76
retq
pushq %rax
leaq 0x551e(%rip), %rdi      # 0x11ab8
leaq 0x53f3(%rip), %rsi      # 0x11994
leaq 0x55d9(%rip), %rcx      # 0x11b81
movl $0x142, %edx            # imm = 0x142
callq 0x4260
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/connectionbase.cpp
// Function: ConnectionBase::SetSocketOpts(int)
bool ConnectionBase::SetSocketOpts(evutil_socket_t sock)
{
    if (evutil_make_socket_nonblocking(sock) != 0)
        return false;

#ifdef _WIN32
    typedef char sockoptptr;
#else
    typedef void sockoptptr;
#endif
    int type;
    ev_socklen_t length = sizeof(type);
    if (getsockopt(sock, SOL_SOCKET, SO_TYPE, reinterpret_cast<sockoptptr*>(&type), &length) == 0) {
        int set = 1;
        if (type == SOCK_STREAM)
            setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, reinterpret_cast<sockoptptr*>(&set), sizeof(int));
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movl %edi, %ebp
callq 0x44d0
movl %eax, %ebx
testl %eax, %eax
jne 0xc63c
leaq 0x14(%rsp), %r8
movl $0x4, (%r8)
pushq $0x1
popq %rsi
pushq $0x3
popq %rdx
leaq 0x10(%rsp), %rcx
movl %ebp, %edi
callq 0x42b0
testl %eax, %eax
jne 0xc63c
movl $0x1, 0xc(%rsp)
cmpl $0x1, 0x10(%rsp)
jne 0xc63c
pushq $0x6
popq %rsi
pushq $0x1
popq %rdx
leaq 0xc(%rsp), %rcx
pushq $0x4
popq %r8
movl %ebp, %edi
callq 0x4670
testl %ebx, %ebx
sete %al
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/connectionbase.cpp
// Function: ConnectionBase::read_cb_chunk(bufferevent*, void*)
void ConnectionBase::read_cb_chunk(bufferevent* bev, void* ctx)
{
    assert(ctx);
    assert(bev);

    ConnectionBase* base = static_cast<ConnectionBase*>(ctx);
    const CNetworkConfig& netconfig = base->m_connection.GetNetConfig();
    assert(netconfig.chunk_size > 0);
    size_t chunk_size = netconfig.chunk_size;

    std::list<std::vector<unsigned char> > msgs;
    size_t remaining;
    evbuffer* input;
    {
        BufferEventLocker lock(bev);
        input = bufferevent_get_input(bev);
        remaining = evbuffer_get_length(input);
        while (remaining >= chunk_size) {
            msgs.emplace_back(chunk_size);
            evbuffer_remove(input, msgs.back().data(), chunk_size);
            remaining -= chunk_size;
        }
    }
    evbuffer_expand(input, chunk_size);
    if (!msgs.empty())
        base->m_handler.OnReceiveMessages(base->m_id, std::move(msgs), msgs.size() * chunk_size);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %rsi, %rsi
je 0xc9ce
movq %rdi, %r14
testq %rdi, %rdi
je 0xc9ed
movq %rsi, %rbx
leaq 0x18(%rsi), %rdi
callq 0x63f0
movslq 0x28(%rax), %rbp
testq %rbp, %rbp
jle 0xca0c
movq %rbp, (%rsp)
leaq 0x10(%rsp), %rax
movq %rax, 0x8(%rax)
movq %rax, (%rax)
andq $0x0, 0x10(%rax)
movq %r14, 0x8(%rsp)
movq %r14, %rdi
callq 0x4500
movq %r14, %rdi
callq 0x4270
movq %rax, %r14
movq %rax, %rdi
callq 0x43b0
movq %rax, %r12
leaq 0x10(%rsp), %r15
movq %rsp, %r13
cmpq %rbp, %r12
jb 0xc97a
movq %r15, %rdi
movq %r13, %rsi
callq 0xd0dc
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rsi
movq (%rsp), %rdx
movq %r14, %rdi
callq 0x4440
movq (%rsp), %rbp
subq %rbp, %r12
jmp 0xc94c
leaq 0x8(%rsp), %rdi
callq 0xd0c8
movq (%rsp), %rsi
movq %r14, %rdi
callq 0x41c0
cmpq %r15, 0x10(%rsp)
je 0xc9b5
movq 0x8(%rbx), %rdi
movq 0x190(%rbx), %rsi
movq (%rsp), %rcx
leaq 0x10(%rsp), %rdx
imulq 0x10(%rdx), %rcx
callq 0x8a54
leaq 0x10(%rsp), %rdi
callq 0x999a
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x50e3(%rip), %rdi      # 0x11ab8
leaq 0x4fb8(%rip), %rsi      # 0x11994
leaq 0x51e1(%rip), %rcx      # 0x11bc4
movl $0x14c, %edx            # imm = 0x14C
callq 0x4260
leaq 0x4e4d(%rip), %rdi      # 0x11841
leaq 0x4f99(%rip), %rsi      # 0x11994
leaq 0x51c2(%rip), %rcx      # 0x11bc4
movl $0x14d, %edx            # imm = 0x14D
callq 0x4260
leaq 0x51f2(%rip), %rdi      # 0x11c05
leaq 0x4f7a(%rip), %rsi      # 0x11994
leaq 0x51a3(%rip), %rcx      # 0x11bc4
movl $0x151, %edx            # imm = 0x151
callq 0x4260
jmp 0xca2d
movq %rax, %rbx
jmp 0xca41
jmp 0xca34
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xd0c8
leaq 0x10(%rsp), %rdi
callq 0x999a
movq %rbx, %rdi
callq 0x4660
nop
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/connectionbase.cpp
// Function: ConnectionBase::read_data(evbuffer*, evbuffer_cb_info const*, void*)
void ConnectionBase::read_data(struct evbuffer* /*unused*/, const struct evbuffer_cb_info* info, void* ctx)
{
    assert(ctx);
    if (info->n_added != 0u) {
        ConnectionBase* base = static_cast<ConnectionBase*>(ctx);
        base->m_bytes_read += info->n_added;
        base->m_handler.m_interface.OnBytesRead(base->m_id, info->n_added, base->m_bytes_read);
        DEBUG_PRINT(LOGALL, "id:", base->m_id, "Read:", info->n_added, "bytes. Total:", base->m_bytes_read);
    }
}

// Assembly:
testq %rdx, %rdx
je 0xcd17
movq %rdx, %rax
movq 0x8(%rsi), %rdx
testq %rdx, %rdx
je 0xcd16
movq 0x198(%rax), %rcx
addq %rdx, %rcx
movq %rcx, 0x198(%rax)
movq 0x8(%rax), %rdi
movq 0x190(%rax), %rsi
movq 0xc0(%rdi), %rdi
movq (%rdi), %rax
movq 0x80(%rax), %rax
jmpq *%rax
retq
pushq %rax
leaq 0x4d99(%rip), %rdi      # 0x11ab8
leaq 0x4c6e(%rip), %rsi      # 0x11994
leaq 0x4d8f(%rip), %rcx      # 0x11abc
movl $0x12c, %edx            # imm = 0x12C
callq 0x4260
nop
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/connectionbase.cpp
// Function: ConnectionBase::wrote_data(evbuffer*, evbuffer_cb_info const*, void*)
void ConnectionBase::wrote_data(struct evbuffer* /*unused*/, const struct evbuffer_cb_info* info, void* ctx)
{
    assert(ctx);
    if (info->n_deleted != 0u) {
        ConnectionBase* base = static_cast<ConnectionBase*>(ctx);
        base->m_bytes_written += info->n_deleted;
        base->m_handler.m_interface.OnBytesWritten(base->m_id, info->n_deleted, base->m_bytes_written);
        DEBUG_PRINT(LOGALL, "id:", base->m_id, "Wrote:", info->n_deleted, "bytes. Total:", base->m_bytes_written);
    }
}

// Assembly:
testq %rdx, %rdx
je 0xcd79
movq %rdx, %rax
movq 0x10(%rsi), %rdx
testq %rdx, %rdx
je 0xcd78
movq 0x1a0(%rax), %rcx
addq %rdx, %rcx
movq %rcx, 0x1a0(%rax)
movq 0x8(%rax), %rdi
movq 0x190(%rax), %rsi
movq 0xc0(%rdi), %rdi
movq (%rdi), %rax
movq 0x88(%rax), %rax
jmpq *%rax
retq
pushq %rax
leaq 0x4d37(%rip), %rdi      # 0x11ab8
leaq 0x4c0c(%rip), %rsi      # 0x11994
leaq 0x4d8f(%rip), %rcx      # 0x11b1e
movl $0x137, %edx            # imm = 0x137
callq 0x4260
nop
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/connectionbase.cpp
// Function: ConnectionBase::OnOutgoingConnected(event_type<bufferevent>&&, CConnection)
void ConnectionBase::OnOutgoingConnected(event_type<bufferevent>&& bev, CConnection resolved)
{
    m_bev = std::move(bev);
    DEBUG_PRINT(LOGINFO, "id:", m_id, "outgoing connection: initial:", m_connection.GetHost(), "resolved:", resolved.GetHost());
    InitConnection();

    m_handler.OnOutgoingConnected(m_id, m_connection, std::move(resolved));
    // Don't do anything after OnOutgoingConnected. It may delete *this.
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdx, %rbx
movq %rdi, %r14
addq $0x1a8, %rdi            # imm = 0x1A8
callq 0xbb66
leaq 0x18(%r14), %r15
movq %rsp, %rdi
movq %r15, %rsi
callq 0x5d62
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x5d62
leaq 0x20(%rsp), %rdi
callq 0x41a0
movq %rsp, %rdi
callq 0x41a0
movq %r14, %rdi
callq 0xc648
movq 0x8(%r14), %rdi
movq 0x190(%r14), %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x88e6
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x41a0
movq %rbx, %rdi
callq 0x4660
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/connectionbase.cpp
// Function: ConnectionBase::OnIncomingConnected(event_type<bufferevent>&&, sockaddr*, int)
void ConnectionBase::OnIncomingConnected(event_type<bufferevent>&& bev, sockaddr* addr, int addrsize)
{
    m_bev = std::move(bev);
    CConnection resolved(m_connection.GetOptions(), m_connection.GetNetConfig(), addr, addrsize);
    DEBUG_PRINT(LOGINFO, "id:", m_id, "incoming connection. bound to:", m_connection.GetHost(), "incoming:", resolved.GetHost());
    InitConnection();

    m_handler.OnIncomingConnected(m_id, m_connection, std::move(resolved));
    // Don't do anything after OnIncomingConnected. It may delete *this.
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x250, %rsp            # imm = 0x250
movl %ecx, %ebp
movq %rdx, %r15
movq %rdi, %rbx
addq $0x1a8, %rdi            # imm = 0x1A8
callq 0xbb66
leaq 0x18(%rbx), %r14
movq %r14, %rdi
callq 0x63e8
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x1c(%rax), %xmm2
movaps %xmm0, 0x30(%rsp)
movaps %xmm1, 0x40(%rsp)
movups %xmm2, 0x4c(%rsp)
movq %r14, %rdi
callq 0x63f0
leaq 0xa0(%rsp), %r12
movq %r12, %rdi
movq %rax, %rsi
callq 0x4e9a
movups 0x4c(%rsp), %xmm0
movups %xmm0, 0x1c(%rsp)
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0xd8(%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
movl %ebp, %ecx
callq 0x61d8
leaq 0xb0(%rsp), %rdi
callq 0x4fd0
leaq 0x60(%rsp), %rdi
movq %r14, %rsi
callq 0x5d62
leaq 0x80(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x5d62
leaq 0x80(%rsp), %rdi
callq 0x41a0
leaq 0x60(%rsp), %rdi
callq 0x41a0
movq %rbx, %rdi
callq 0xc648
movq 0x8(%rbx), %rdi
movq 0x190(%rbx), %rsi
leaq 0xd8(%rsp), %rcx
movq %r14, %rdx
callq 0x8786
leaq 0xd8(%rsp), %rdi
callq 0x4d22
addq $0x250, %rsp            # imm = 0x250
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x41a0
jmp 0xcf60
jmp 0xcf5d
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x4fd0
jmp 0xcf6d
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x4d22
movq %rbx, %rdi
callq 0x4660
nop
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/connectionbase.cpp
// Function: ConnectionBase::Write(unsigned char const*, unsigned long)
bool ConnectionBase::Write(const unsigned char* data, size_t size)
{
    bool ret = bufferevent_write(m_bev, data, size) == 0;
    if (ret)
        m_check_write_buffer_func.active();
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
addq $0x1a8, %rdi            # imm = 0x1A8
callq 0xbb92
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x41f0
movl %eax, %ebp
testl %eax, %eax
jne 0xcfb5
addq $0x230, %rbx            # imm = 0x230
movq %rbx, %rdi
callq 0xf8d0
testl %ebp, %ebp
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/connectionbase.cpp
// Function: ConnectionBase::write_cb(bufferevent*, void*)
void ConnectionBase::write_cb(bufferevent* bev, void* ctx)
{
    assert(ctx);
    ConnectionBase* base = static_cast<ConnectionBase*>(ctx);
    evbuffer* output = bufferevent_get_output(bev);
    size_t buflen = evbuffer_get_length(output);
    bufferevent_setcb(bev, base->read_cb_ptr, nullptr, event_cb, ctx);
    base->m_handler.OnWriteBufferReady(base->m_id, buflen);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0xd019
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4110
movq %rax, %rdi
callq 0x43b0
movq %rax, %r15
movq 0x2a8(%rbx), %rsi
leaq -0xa76(%rip), %rcx      # 0xc57e
movq %r14, %rdi
xorl %edx, %edx
movq %rbx, %r8
callq 0x4370
movq 0x8(%rbx), %rdi
movq 0x190(%rbx), %rsi
movq %r15, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x81d4
leaq 0x4a98(%rip), %rdi      # 0x11ab8
leaq 0x496d(%rip), %rsi      # 0x11994
leaq 0x4c33(%rip), %rcx      # 0x11c61
movl $0x1a4, %edx            # imm = 0x1A4
callq 0x4260
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/proxyconn.cpp
// Function: CProxyConn::Connect()
void CProxyConn::Connect()
{
    assert(m_connection.IsSet());

    const CConnectionOptions& opts = m_connection.GetOptions();

    timeval connTimeout;
    connTimeout.tv_sec = opts.nConnTimeout;
    connTimeout.tv_usec = 0;

    const CConnectionBase& proxy = m_connection.GetProxy();
    assert(proxy.IsSet());

    sockaddr_storage addr_storage;
    int addrlen = sizeof(addr_storage);
    memset(&addr_storage, 0, sizeof(addr_storage));
    sockaddr* addr = reinterpret_cast<sockaddr*>(&addr_storage);
    proxy.GetSockAddr(addr, &addrlen);

    if (m_connection.CanConnectProxy())
        BareConnect(m_event_base, m_handler.GetBevOpts(), BAD_SOCKET, addr, addrlen, connTimeout);
    else
        OnConnectionFailure(ConnectionFailureType::PROXY, 0, m_connection, false);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
movq %rdi, %rbx
leaq 0x18(%rdi), %r14
movq %r14, %rdi
callq 0x5f12
testb %al, %al
je 0xd93e
movq %r14, %rdi
callq 0x63e8
movslq 0xc(%rax), %rax
movq %rax, 0x10(%rsp)
andq $0x0, 0x18(%rsp)
movq %r14, %rdi
callq 0x63e2
movq %rax, %r15
movq %rax, %rdi
callq 0x5f12
testb %al, %al
je 0xd957
leaq 0xc(%rsp), %rdx
movl $0x80, (%rdx)
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rsi
movaps %xmm0, (%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x70(%rsi)
movq %r15, %rdi
callq 0x5d0a
movq %r14, %rdi
callq 0x64d2
testb %al, %al
je 0xd8fe
leaq 0x2b0(%rbx), %r14
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rbx
callq 0x8e8e
movl 0xc(%rsp), %r9d
leaq 0x10(%rsp), %rcx
movq %rcx, (%rsp)
pushq $-0x1
popq %rcx
leaq 0x20(%rsp), %r8
movq %r14, %rdi
movq %rbx, %rsi
movl %eax, %edx
callq 0xb9a4
jmp 0xd931
leaq 0xa8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x6bee
pushq $0x4
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0xc4d4
leaq 0xa8(%rsp), %rdi
callq 0x4d22
addq $0x220, %rsp            # imm = 0x220
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3c61(%rip), %rdi      # 0x115a6
leaq 0x4563(%rip), %rsi      # 0x11eaf
leaq 0x456e(%rip), %rcx      # 0x11ec1
pushq $0x1b
jmp 0xd96e
leaq 0x4586(%rip), %rdi      # 0x11ee4
leaq 0x454a(%rip), %rsi      # 0x11eaf
leaq 0x4555(%rip), %rcx      # 0x11ec1
pushq $0x24
popq %rdx
callq 0x4260
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x4d22
movq %rbx, %rdi
callq 0x4660
// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/bareproxy.cpp
// Function: CBareProxy::receive_init(bufferevent*, void*)
void CBareProxy::receive_init(bufferevent* bev, void* ctx)
{
    CBareProxy* data = static_cast<CBareProxy*>(ctx);
    const CConnection& conn(data->m_proxy_connection);
    const CProxyAuth& auth(conn.GetProxy().GetAuth());
    char pchRet1[2];
    if (bufferevent_read(bev, pchRet1, sizeof(pchRet1)) != sizeof(pchRet1)) {
        data->ProxyFailure(0);
        return;
    }
    if (pchRet1[0] != 0x05) {
        data->ProxyFailure(0);
        return;
    }

    bool useAuth = pchRet1[1] == 0x02;
    if (useAuth) {
        bufferevent_setcb(bev, check_auth_response, nullptr, event_cb, ctx);
        if (!write_auth(bev, auth)) {
            data->ProxyFailure(0);
            return;
        }
    } else {
        bufferevent_setcb(bev, read_final, nullptr, event_cb, ctx);
        if (!writeproto(bev, conn))
            data->ProxyFailure(0);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %r15
movq %r15, %rdi
callq 0x63e2
movq %rax, %rdi
callq 0x5cf4
movq %rax, %r12
leaq 0x6(%rsp), %rsi
pushq $0x2
popq %rdx
movq %r14, %rdi
callq 0x4720
cmpq $0x2, %rax
jne 0xdd47
cmpb $0x5, 0x6(%rsp)
jne 0xdd47
cmpb $0x2, 0x7(%rsp)
jne 0xdd1d
leaq 0x97e(%rip), %rsi       # 0xe67a
leaq 0x5b(%rip), %rcx        # 0xdd5e
movq %r14, %rdi
xorl %edx, %edx
movq %rbx, %r8
callq 0x4370
movq %r14, %rdi
movq %r12, %rsi
callq 0xe13c
jmp 0xdd43
leaq 0x52a(%rip), %rsi       # 0xe24e
leaq 0x33(%rip), %rcx        # 0xdd5e
movq %r14, %rdi
xorl %edx, %edx
movq %rbx, %r8
callq 0x4370
movq %r14, %rdi
movq %r15, %rsi
callq 0xdd98
testb %al, %al
jne 0xdd51
movq %rbx, %rdi
xorl %esi, %esi
callq 0xdd70
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop