LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::Bind(CConnection)
bool CConnectionHandlerInt::Bind(CConnection conn)
{
    assert(IsEventThread());
    ConnID id = GetNextConnectionIndex();
    std::unique_ptr<CConnListener> listener(new CConnListener(*this, m_event_base, id, std::move(conn)));
    bool ret = listener->Bind();
    if (ret) {
        optional_lock(m_bind_mutex, m_enable_threading);
        auto it = m_binds.emplace_hint(m_binds.end(), id, std::move(listener));
        it->second->Enable();
    }
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rsi, %r15
movq %rdi, %rbx
cmpb $0x1, 0xec(%rdi)
jne 0x9b7b
movq 0x168(%rbx), %r14
callq 0x4310
cmpq %rax, %r14
jne 0x9c5a
movq %rbx, %rdi
callq 0x925e
movq %rax, %r12
movq %rax, 0x8(%rsp)
movl $0x198, %edi            # imm = 0x198
callq 0x4350
movq %rax, %r14
leaq 0x190(%rbx), %r13
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
movq %r15, %rsi
callq 0xa6f6
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq %rbp, %r8
callq 0x10d70
movq %r14, (%rsp)
leaq 0x10(%rsp), %rdi
callq 0x4e48
movq %r14, %rdi
callq 0x10e02
movl %eax, %ebp
testb %al, %al
je 0x9c2d
leaq 0x118(%rbx), %r14
movb 0xec(%rbx), %r15b
cmpb $0x1, %r15b
jne 0x9bff
movq %r14, %rdi
callq 0x44f0
testl %eax, %eax
jne 0x9c79
leaq 0x60(%rbx), %rdi
addq $0x68, %rbx
leaq 0x8(%rsp), %rdx
movq %rsp, %rcx
movq %rbx, %rsi
callq 0xb2ea
movq 0x28(%rax), %rdi
callq 0x10f6e
testb %r15b, %r15b
je 0x9c2d
movq %r14, %rdi
callq 0x42c0
movq (%rsp), %rbx
testq %rbx, %rbx
je 0x9c46
movq %rbx, %rdi
callq 0x10d98
movq %rbx, %rdi
callq 0x4340
movl %ebp, %eax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8cb4(%rip), %rdi      # 0x12915
leaq 0x8b9f(%rip), %rsi      # 0x12807
leaq 0x9164(%rip), %rcx      # 0x12dd3
movl $0x15c, %edx            # imm = 0x15C
callq 0x4260
movl %eax, %edi
callq 0x4280
jmp 0x9c96
jmp 0x9c84
movq %rax, %rbx
testb %r15b, %r15b
je 0x9c99
movq %r14, %rdi
callq 0x42c0
jmp 0x9c99
movq %rax, %rbx
movq %rsp, %rdi
callq 0xa9c2
jmp 0x9cb8
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x4e48
movq %r14, %rdi
callq 0x4340
movq %rbx, %rdi
callq 0x4640
// File: /workspace/github_cpp_makefile_star2_O3/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
cmpb $0x1, 0xec(%rdi)
jne 0x9f35
movq 0x168(%rbx), %r14
callq 0x4310
cmpq %rax, %r14
jne 0x9f98
movq 0x190(%rbx), %rdi
testq %rdi, %rdi
je 0x9f91
cmpb $0x0, 0xed(%rbx)
jne 0x9f91
movzbl %bpl, %eax
movl $0x2, %esi
subl %eax, %esi
callq 0x43d0
movb $0x1, %al
cmpb $0x1, 0xed(%rbx)
jne 0x9f93
movq 0x190(%rbx), %rdi
testq %rdi, %rdi
je 0x9f76
callq 0x10d38
movq $0x0, 0x190(%rbx)
movq 0xc0(%rbx), %rdi
movq (%rdi), %rax
callq *0x98(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x8976(%rip), %rdi      # 0x12915
leaq 0x8861(%rip), %rsi      # 0x12807
leaq 0x8f4e(%rip), %rcx      # 0x12efb
movl $0x1a1, %edx            # imm = 0x1A1
callq 0x4260
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rsi, %rsi
js 0xa04d
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
leaq 0xf0(%rdi), %rbx
movb 0xec(%rdi), %r12b
cmpb $0x1, %r12b
jne 0x9ff1
movq %rbx, %rdi
callq 0x44f0
testl %eax, %eax
jne 0xa056
movq 0x10(%r15), %rcx
testq %rcx, %rcx
je 0xa038
addq $0x8, %r15
movq %r15, %rax
xorl %edx, %edx
cmpq %r14, 0x20(%rcx)
setl %dl
cmovgeq %rcx, %rax
movq 0x10(%rcx,%rdx,8), %rcx
testq %rcx, %rcx
jne 0xa001
cmpq %r15, %rax
je 0xa038
cmpq %r14, 0x20(%rax)
jg 0xa038
movq 0x28(%rax), %rdi
testb %bpl, %bpl
je 0xa033
callq 0xdba0
jmp 0xa038
callq 0xdbac
testb %r12b, %r12b
je 0xa04d
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x42c0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x4280
movq %rax, %r14
testb %r12b, %r12b
je 0xa06d
movq %rbx, %rdi
callq 0x42c0
movq %r14, %rdi
callq 0x4640
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
js 0xa0fa
movq %rsi, %r14
movq %rdi, %r15
leaq 0xf0(%rdi), %rbx
movb 0xec(%rdi), %bpl
cmpb $0x1, %bpl
jne 0xa0a8
movq %rbx, %rdi
callq 0x44f0
testl %eax, %eax
jne 0xa105
movq 0x10(%r15), %rcx
testq %rcx, %rcx
je 0xa0e3
addq $0x8, %r15
movq %r15, %rax
xorl %edx, %edx
cmpq %r14, 0x20(%rcx)
setl %dl
cmovgeq %rcx, %rax
movq 0x10(%rcx,%rdx,8), %rcx
testq %rcx, %rcx
jne 0xa0b8
cmpq %r15, %rax
je 0xa0e3
cmpq %r14, 0x20(%rax)
jg 0xa0e3
movq 0x28(%rax), %rdi
callq 0xdbf0
testb %bpl, %bpl
je 0xa0fa
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x42c0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x4280
movq %rax, %r14
testb %bpl, %bpl
je 0xa11c
movq %rbx, %rdi
callq 0x42c0
movq %r14, %rdi
callq 0x4640
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
js 0xa1a8
movq %rsi, %r14
movq %rdi, %r15
leaq 0xf0(%rdi), %rbx
movb 0xec(%rdi), %bpl
cmpb $0x1, %bpl
jne 0xa156
movq %rbx, %rdi
callq 0x44f0
testl %eax, %eax
jne 0xa1b3
movq 0x10(%r15), %rcx
testq %rcx, %rcx
je 0xa191
addq $0x8, %r15
movq %r15, %rax
xorl %edx, %edx
cmpq %r14, 0x20(%rcx)
setl %dl
cmovgeq %rcx, %rax
movq 0x10(%rcx,%rdx,8), %rcx
testq %rcx, %rcx
jne 0xa166
cmpq %r15, %rax
je 0xa191
cmpq %r14, 0x20(%rax)
jg 0xa191
movq 0x28(%rax), %rdi
callq 0xdc8c
testb %bpl, %bpl
je 0xa1a8
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x42c0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x4280
movq %rax, %r14
testb %bpl, %bpl
je 0xa1ca
movq %rbx, %rdi
callq 0x42c0
movq %r14, %rdi
callq 0x4640
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
js 0xa24f
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
addq $0xf0, %rdi
movb 0xec(%r13), %bl
cmpb $0x1, %bl
jne 0xa210
movq %rdi, %rbp
callq 0x44f0
movq %rbp, %rdi
testl %eax, %eax
jne 0xa27b
movq 0x10(%r13), %rcx
testq %rcx, %rcx
je 0xa242
addq $0x8, %r13
movq %r13, %rax
xorl %edx, %edx
cmpq %r12, 0x20(%rcx)
setl %dl
cmovgeq %rcx, %rax
movq 0x10(%rcx,%rdx,8), %rcx
testq %rcx, %rcx
jne 0xa220
cmpq %r13, %rax
je 0xa242
cmpq %r12, 0x20(%rax)
jle 0xa262
xorl %ebp, %ebp
testb %bl, %bl
je 0xa251
callq 0x42c0
jmp 0xa251
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %r12
movq 0x28(%rax), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xebaa
movl %eax, %ebp
movq %r12, %rdi
jmp 0xa244
movl %eax, %edi
callq 0x4280
movq %rax, %r14
testb %bl, %bl
je 0xa291
movq %r12, %rdi
callq 0x42c0
movq %r14, %rdi
callq 0x4640
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rsi, %rsi
js 0xa324
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0xf0(%rdi), %rbx
movb 0xec(%rdi), %bpl
cmpb $0x1, %bpl
jne 0xa2d0
movq %rbx, %rdi
callq 0x44f0
testl %eax, %eax
jne 0xa32d
movq 0x10(%r12), %rcx
testq %rcx, %rcx
je 0xa30f
addq $0x8, %r12
movq %r12, %rax
xorl %edx, %edx
cmpq %r15, 0x20(%rcx)
setl %dl
cmovgeq %rcx, %rax
movq 0x10(%rcx,%rdx,8), %rcx
testq %rcx, %rcx
jne 0xa2e1
cmpq %r12, %rax
je 0xa30f
cmpq %r15, 0x20(%rax)
jg 0xa30f
movq 0x28(%rax), %rdi
movq %r14, %rsi
callq 0xddf8
testb %bpl, %bpl
je 0xa324
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x42c0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x4280
movq %rax, %r14
testb %bpl, %bpl
je 0xa344
movq %rbx, %rdi
callq 0x42c0
movq %r14, %rdi
callq 0x4640
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
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 0x4590
movq %rax, (%rsp)
testq %rax, %rax
je 0xa3ea
movq %rax, %r15
leaq 0x140(%rbx), %r14
movb 0xec(%rbx), %bpl
cmpb $0x1, %bpl
jne 0xa3a0
movq %r14, %rdi
callq 0x44f0
testl %eax, %eax
jne 0xa428
movq 0x180(%rbx), %rdi
testq %rdi, %rdi
je 0xa409
movq %r15, %rsi
callq 0x4330
movq 0x170(%rbx), %rax
movq (%rsp), %rcx
movq %rcx, 0x170(%rbx)
movq %rax, (%rsp)
testb %bpl, %bpl
je 0xa3d7
movq %r14, %rdi
callq 0x42c0
movq %rsp, %rdi
callq 0xa6b2
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8b5e(%rip), %rdi      # 0x12f4f
leaq 0x8b68(%rip), %rsi      # 0x12f60
leaq 0x8e04(%rip), %rcx      # 0x13203
movl $0x21, %edx
callq 0x4260
leaq 0x8b3f(%rip), %rdi      # 0x12f4f
leaq 0x8b49(%rip), %rsi      # 0x12f60
leaq 0x8e30(%rip), %rcx      # 0x1324e
movl $0x4b, %edx
callq 0x4260
movl %eax, %edi
callq 0x4280
movq %rax, %rbx
jmp 0xa444
movq %rax, %rbx
testb %bpl, %bpl
je 0xa444
movq %r14, %rdi
callq 0x42c0
movq %rsp, %rdi
callq 0xa6b2
movq %rbx, %rdi
callq 0x4640
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
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 0x4590
movq %rax, (%rsp)
testq %rax, %rax
je 0xa4f2
movq %rax, %r15
leaq 0x140(%rbx), %r14
movb 0xec(%rbx), %bpl
cmpb $0x1, %bpl
jne 0xa4a8
movq %r14, %rdi
callq 0x44f0
testl %eax, %eax
jne 0xa530
movq 0x188(%rbx), %rdi
testq %rdi, %rdi
je 0xa511
movq %r15, %rsi
callq 0x4330
movq 0x178(%rbx), %rax
movq (%rsp), %rcx
movq %rcx, 0x178(%rbx)
movq %rax, (%rsp)
testb %bpl, %bpl
je 0xa4df
movq %r14, %rdi
callq 0x42c0
movq %rsp, %rdi
callq 0xa6b2
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8a56(%rip), %rdi      # 0x12f4f
leaq 0x8a60(%rip), %rsi      # 0x12f60
leaq 0x8cfc(%rip), %rcx      # 0x13203
movl $0x21, %edx
callq 0x4260
leaq 0x8a37(%rip), %rdi      # 0x12f4f
leaq 0x8a41(%rip), %rsi      # 0x12f60
leaq 0x8d28(%rip), %rcx      # 0x1324e
movl $0x4b, %edx
callq 0x4260
movl %eax, %edi
callq 0x4280
movq %rax, %rbx
jmp 0xa54c
movq %rax, %rbx
testb %bpl, %bpl
je 0xa54c
movq %r14, %rdi
callq 0x42c0
movq %rsp, %rdi
callq 0xa6b2
movq %rbx, %rdi
callq 0x4640
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rsi, %rsi
js 0xa623
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
leaq 0xf0(%rdi), %rbx
movb 0xec(%rdi), %r12b
cmpb $0x1, %r12b
jne 0xa5d1
movq %rbx, %rdi
callq 0x44f0
testl %eax, %eax
jne 0xa62c
movq 0x10(%r15), %rcx
testq %rcx, %rcx
je 0xa60e
addq $0x8, %r15
movq %r15, %rax
xorl %edx, %edx
cmpq %r14, 0x20(%rcx)
setl %dl
cmovgeq %rcx, %rax
movq 0x10(%rcx,%rdx,8), %rcx
testq %rcx, %rcx
jne 0xa5e1
cmpq %r15, %rax
je 0xa60e
cmpq %r14, 0x20(%rax)
jg 0xa60e
movq 0x28(%rax), %rdi
movl %ebp, %esi
callq 0xdbb8
testb %r12b, %r12b
je 0xa623
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x42c0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x4280
movq %rax, %r14
testb %r12b, %r12b
je 0xa643
movq %rbx, %rdi
callq 0x42c0
movq %r14, %rdi
callq 0x4640
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xb7dc
movq 0x28(%rax), %rcx
movq %rcx, (%rdi)
retq
pushq %rax
leaq 0x7b9c(%rip), %rdi      # 0x13380
leaq 0x7ba5(%rip), %rsi      # 0x13390
leaq 0x7beb(%rip), %rcx      # 0x133dd
movl $0x23, %edx
callq 0x4260
// File: /workspace/github_cpp_makefile_star2_O3/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 %r14
pushq %rbx
pushq %rax
testq %rcx, %rcx
je 0xb952
testq %r8, %r8
je 0xb971
movq %rdi, %rbx
movq $0x0, (%rdi)
movq (%rdx), %rdi
testq %rdi, %rdi
je 0xb990
movq %rsi, %rax
leaq 0x92(%rip), %r10        # 0xb9c2
movq %rcx, %rsi
movq %r8, %rdx
movq %r9, %rcx
movq %r10, %r8
movq %rax, %r9
callq 0x4460
movq %rax, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x7af8(%rip), %rdi      # 0x13451
leaq 0x7a30(%rip), %rsi      # 0x13390
leaq 0x7afa(%rip), %rcx      # 0x13461
movl $0x7c, %edx
callq 0x4260
leaq 0x7b72(%rip), %rdi      # 0x134ea
leaq 0x7a11(%rip), %rsi      # 0x13390
leaq 0x7adb(%rip), %rcx      # 0x13461
movl $0x7d, %edx
callq 0x4260
leaq 0x75b8(%rip), %rdi      # 0x12f4f
leaq 0x75c2(%rip), %rsi      # 0x12f60
leaq 0x7ba3(%rip), %rcx      # 0x13548
movl $0x4b, %edx
callq 0x4260
movq %rax, %r14
movq %rbx, %rdi
callq 0xb540
movq %r14, %rdi
callq 0x4640
// File: /workspace/github_cpp_makefile_star2_O3/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 0xb9f8
movl %edi, %eax
testl %edi, %edi
jne 0xb9fe
testq %rdx, %rdx
je 0xba16
leaq 0x8(%rsp), %rax
movq %rsi, (%rax)
movq (%rdx), %rcx
movq %rdx, %rdi
movq %rax, %rsi
callq *0x10(%rcx)
leaq 0x8(%rsp), %rdi
callq 0xb846
addq $0x10, %rsp
popq %rbx
retq
testq %rdx, %rdx
je 0xba35
movq (%rdx), %rcx
movq 0x18(%rcx), %rcx
movq %rdx, %rdi
movl %eax, %esi
addq $0x10, %rsp
popq %rbx
jmpq *%rcx
leaq 0x7add(%rip), %rdi      # 0x134fa
leaq 0x796c(%rip), %rsi      # 0x13390
leaq 0x7ade(%rip), %rcx      # 0x13509
movl $0x89, %edx
callq 0x4260
leaq 0x7abe(%rip), %rdi      # 0x134fa
leaq 0x794d(%rip), %rsi      # 0x13390
leaq 0x7abf(%rip), %rcx      # 0x13509
movl $0x8d, %edx
callq 0x4260
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xb846
movq %rbx, %rdi
callq 0x4640
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/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 0x639e
testb %al, %al
je 0xbc4c
movq %r14, %rdi
callq 0x6fa8
movslq 0xc(%rax), %rax
movq %rax, 0x10(%rsp)
movq $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 0x615e
movq %r14, %rdi
callq 0x7016
testb %al, %al
je 0xbc0a
leaq 0x2b0(%rbx), %r14
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rbx
callq 0x9ec8
movl 0xc(%rsp), %r9d
leaq 0x10(%rsp), %rcx
movq %rcx, (%rsp)
leaq 0x20(%rsp), %r8
movq %r14, %rdi
movq %rbx, %rsi
movl %eax, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0xd186
jmp 0xbc3f
leaq 0xa8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x756a
movq %rbx, %rdi
movl $0x1, %esi
xorl %edx, %edx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0xdf22
leaq 0xa8(%rsp), %rdi
callq 0x4e48
addq $0x220, %rsp            # imm = 0x220
popq %rbx
popq %r14
popq %r15
retq
leaq 0x794d(%rip), %rdi      # 0x135a0
leaq 0x795b(%rip), %rsi      # 0x135b5
leaq 0x7967(%rip), %rcx      # 0x135c8
movl $0x1e, %edx
callq 0x4260
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x4e48
movq %rbx, %rdi
callq 0x4640
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xb886
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb830
testb %al, %al
je 0xc33a
movq %r12, %rdi
callq 0xb88a
testb %al, %al
jne 0xc359
leaq 0x18(%r15), %rdi
callq 0x6fa8
movq %rax, %r12
movslq 0xc(%rax), %rax
movq %rax, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq %rbx, %rdi
callq 0xb7fc
movq 0x18(%rax), %rdi
movl 0x28(%r12), %esi
callq 0x6fb8
testb %al, %al
je 0xc321
leaq 0x2b0(%r15), %r12
movq 0x8(%r15), %rdi
movq 0x10(%r15), %r15
callq 0x9ec8
movl %eax, %ebp
movq %rbx, %rdi
callq 0xb7fc
movq 0x18(%rax), %r13
movq %rbx, %rdi
callq 0xb7fc
movl 0x10(%rax), %r9d
movq %r14, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %r13, %r8
callq 0xd186
jmp 0xc32b
movq %r15, %rdi
xorl %esi, %esi
callq 0xcb06
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7413(%rip), %rdi      # 0x13754
leaq 0x72c9(%rip), %rsi      # 0x13611
leaq 0x745a(%rip), %rcx      # 0x137a9
movl $0x6c, %edx
callq 0x4260
leaq 0x73e0(%rip), %rdi      # 0x13740
leaq 0x72aa(%rip), %rsi      # 0x13611
leaq 0x743b(%rip), %rcx      # 0x137a9
movl $0x6d, %edx
callq 0x4260
// File: /workspace/github_cpp_makefile_star2_O3/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 0xb88a
testb %al, %al
je 0xc42e
leaq 0x2d8(%r14), %r12
movq %r15, %rdi
callq 0xb886
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r12, %rdi
callq 0xb826
testb %al, %al
je 0xc44d
movq $0x0, 0x2e0(%r14)
leaq 0x18(%r14), %rsi
leaq 0x10(%rsp), %rdi
callq 0x756a
movl 0x2c8(%r14), %eax
testl %eax, %eax
jle 0xc3fa
decl %eax
movl %eax, 0x2c8(%r14)
movb $0x1, %al
jmp 0xc3fd
setne %al
movzbl %al, %r8d
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
movl $0x2, %esi
movl %ebx, %edx
callq 0xdf22
leaq 0x10(%rsp), %rdi
callq 0x4e48
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x730c(%rip), %rdi      # 0x13741
leaq 0x71d5(%rip), %rsi      # 0x13611
leaq 0x7241(%rip), %rcx      # 0x13684
movl $0x3f, %edx
callq 0x4260
leaq 0x7215(%rip), %rdi      # 0x13669
leaq 0x71b6(%rip), %rsi      # 0x13611
leaq 0x7222(%rip), %rcx      # 0x13684
movl $0x40, %edx
callq 0x4260
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x4e48
movq %rbx, %rdi
callq 0x4640
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xb88a
testb %al, %al
je 0xc509
leaq 0x2d8(%rbx), %r12
movq %r14, %rdi
callq 0xb886
movq %rsp, %rsi
movq %rax, (%rsi)
movq %r12, %rdi
callq 0xb826
testb %al, %al
je 0xc528
movq $0x0, 0x2e0(%rbx)
movq %r14, %rdi
movq %r15, %rsi
callq 0xb8a4
movq %r14, %rdi
callq 0xb882
movq %rax, 0x2d8(%rbx)
movq %rbx, %rdi
callq 0xc24e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x7231(%rip), %rdi      # 0x13741
leaq 0x70fa(%rip), %rsi      # 0x13611
leaq 0x7199(%rip), %rcx      # 0x136b7
movl $0x48, %edx
callq 0x4260
leaq 0x713a(%rip), %rdi      # 0x13669
leaq 0x70db(%rip), %rsi      # 0x13611
leaq 0x717a(%rip), %rcx      # 0x136b7
movl $0x49, %edx
callq 0x4260
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xd147
movq %rdx, %rbx
testq %rdx, %rdx
je 0xd166
movl %esi, %ebp
testb %bpl, %bpl
js 0xd133
callq 0x41a0
callq 0x4040
movl (%rax), %r14d
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0xd115
callq 0x10d46
movq $0x0, 0x8(%rbx)
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 0x689b(%rip), %rdi      # 0x139e9
leaq 0x668c(%rip), %rsi      # 0x137e1
leaq 0x6696(%rip), %rcx      # 0x137f2
movl $0x12, %edx
callq 0x4260
leaq 0x638d(%rip), %rdi      # 0x134fa
leaq 0x666d(%rip), %rsi      # 0x137e1
leaq 0x6677(%rip), %rcx      # 0x137f2
movl $0x13, %edx
callq 0x4260
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x11b80
leaq 0x1b8(%rbx), %rdi
callq 0x11b80
leaq 0x208(%rbx), %rdi
callq 0x11b80
leaq 0x230(%rbx), %rdi
callq 0x11b80
leaq 0x258(%rbx), %rdi
callq 0x11b80
leaq 0x280(%rbx), %rdi
callq 0x11b80
movq 0x1a8(%rbx), %r14
testq %r14, %r14
je 0xd871
movq %r14, %rdi
callq 0x44e0
movq 0x1a8(%rbx), %rdi
testq %rdi, %rdi
je 0xd871
movl $0x6, %esi
callq 0x4510
movq 0x1a8(%rbx), %rdi
testq %rdi, %rdi
je 0xd871
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x4360
movq %r14, %rdi
callq 0x45e0
leaq 0x18(%rbx), %rdi
callq 0x6fa8
cmpb $0x1, 0x2(%rax)
jne 0xd855
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
jmp 0xd857
xorl %eax, %eax
movq 0x8(%rbx), %rdi
movq 0x190(%rbx), %rsi
movzbl %al, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x9072
leaq 0x56d7(%rip), %rdi      # 0x12f4f
leaq 0x56e1(%rip), %rsi      # 0x12f60
leaq 0x6087(%rip), %rcx      # 0x1390d
movl $0x4b, %edx
callq 0x4260
jmp 0xd8a5
movq %rax, %rbx
movq %r14, %rdi
callq 0x45e0
movq %rbx, %rdi
callq 0x4640
movq %rax, %rdi
callq 0xaa1e
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xdbe4
subq $0x18, %rsp
movslq %esi, %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq $0x0, 0x8(%rsi)
addq $0x258, %rdi            # imm = 0x258
callq 0x11ba4
addq $0x18, %rsp
retq
addq $0x258, %rdi            # imm = 0x258
jmp 0x11b80
// File: /workspace/github_cpp_makefile_star2_O3/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 0xdfe0
testb $0x70, %sil
je 0xdfdf
movq %rdx, %rdi
jmp 0xd7a0
retq
pushq %rax
leaq 0x5ac8(%rip), %rdi      # 0x13ab0
leaq 0x599d(%rip), %rsi      # 0x1398c
leaq 0x5b83(%rip), %rcx      # 0x13b79
movl $0x142, %edx            # imm = 0x142
callq 0x4260
// File: /workspace/github_cpp_makefile_star2_O3/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 0x44b0
movl %eax, %ebx
testl %eax, %eax
jne 0xe0b6
leaq 0x14(%rsp), %r8
movl $0x4, (%r8)
leaq 0x10(%rsp), %rcx
movl %ebp, %edi
movl $0x1, %esi
movl $0x3, %edx
callq 0x42b0
testl %eax, %eax
jne 0xe0b6
movl $0x1, 0xc(%rsp)
cmpl $0x1, 0x10(%rsp)
jne 0xe0b6
leaq 0xc(%rsp), %rcx
movl %ebp, %edi
movl $0x6, %esi
movl $0x1, %edx
movl $0x4, %r8d
callq 0x4650
testl %ebx, %ebx
sete %al
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0xe4fd
movq %rdi, %r14
testq %rdi, %rdi
je 0xe51c
movq %rsi, %rbx
leaq 0x18(%rsi), %rdi
callq 0x6fb0
movslq 0x28(%rax), %r13
testq %r13, %r13
jle 0xe53b
movq %r13, 0x8(%rsp)
leaq 0x10(%rsp), %rax
movq %rax, 0x8(%rax)
movq %rax, (%rax)
movq $0x0, 0x10(%rax)
movq %r14, %rdi
callq 0x44e0
movq %r14, %rdi
callq 0x4270
movq %rax, %r15
movq %rax, %rdi
callq 0x43a0
movq %rax, %r12
cmpq %r13, %rax
jb 0xe4a4
leaq 0x10(%rsp), %r13
leaq 0x8(%rsp), %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0xedc0
movq %rax, %rdi
movq %r13, %rsi
callq 0x4070
incq 0x20(%rsp)
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x8(%rsp), %rdx
movq %r15, %rdi
callq 0x4440
movq 0x8(%rsp), %rax
subq %rax, %r12
cmpq %rax, %r12
jae 0xe466
movq %r14, %rdi
callq 0x45e0
movq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x41c0
leaq 0x10(%rsp), %rax
cmpq %rax, 0x10(%rsp)
je 0xe4e4
movq 0x8(%rbx), %rdi
movq 0x190(%rbx), %rsi
movq 0x8(%rsp), %rcx
leaq 0x10(%rsp), %rdx
imulq 0x10(%rdx), %rcx
callq 0x99d0
leaq 0x10(%rsp), %rdi
callq 0xab34
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x55ac(%rip), %rdi      # 0x13ab0
leaq 0x5481(%rip), %rsi      # 0x1398c
leaq 0x56aa(%rip), %rcx      # 0x13bbc
movl $0x14c, %edx            # imm = 0x14C
callq 0x4260
leaq 0x5318(%rip), %rdi      # 0x1383b
leaq 0x5462(%rip), %rsi      # 0x1398c
leaq 0x568b(%rip), %rcx      # 0x13bbc
movl $0x14d, %edx            # imm = 0x14D
callq 0x4260
leaq 0x56bb(%rip), %rdi      # 0x13bfd
leaq 0x5443(%rip), %rsi      # 0x1398c
leaq 0x566c(%rip), %rcx      # 0x13bbc
movl $0x151, %edx            # imm = 0x151
callq 0x4260
jmp 0xe582
jmp 0xe55e
movq %rax, %rbx
jmp 0xe570
jmp 0xe565
movq %rax, %rbx
movq %r14, %rdi
callq 0x45e0
leaq 0x10(%rsp), %rdi
callq 0xab34
movq %rbx, %rdi
callq 0x4640
movq %rax, %rdi
callq 0xaa1e
// File: /workspace/github_cpp_makefile_star2_O3/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 0xe89b
movq %rdx, %rax
movq 0x8(%rsi), %rdx
testq %rdx, %rdx
je 0xe89a
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 0x520d(%rip), %rdi      # 0x13ab0
leaq 0x50e2(%rip), %rsi      # 0x1398c
leaq 0x5203(%rip), %rcx      # 0x13ab4
movl $0x12c, %edx            # imm = 0x12C
callq 0x4260
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xe8fd
movq %rdx, %rax
movq 0x10(%rsi), %rdx
testq %rdx, %rdx
je 0xe8fc
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 0x51ab(%rip), %rdi      # 0x13ab0
leaq 0x5080(%rip), %rsi      # 0x1398c
leaq 0x5203(%rip), %rcx      # 0x13b16
movl $0x137, %edx            # imm = 0x137
callq 0x4260
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %rsi, %r15
movq %rdi, %r14
movq 0x1a8(%rdi), %rdi
testq %rdi, %rdi
je 0xe941
callq 0x10d46
xorl %eax, %eax
movq %rax, 0x1a8(%r14)
movq (%r15), %rcx
movq %rcx, 0x1a8(%r14)
movq %rax, (%r15)
leaq 0x18(%r14), %r15
movq %rsp, %rdi
movq %r15, %rsi
callq 0x61b6
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x61b6
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xe986
callq 0x4340
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xe999
callq 0x4340
movq %r14, %rdi
callq 0xe0c2
movq 0x8(%r14), %rdi
movq 0x190(%r14), %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x9814
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rdi
callq 0xaa1e
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xe9df
callq 0x4340
movq %rbx, %rdi
callq 0x4640
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq 0x1a8(%rdi), %rdi
testq %rdi, %rdi
je 0xea15
callq 0x10d46
xorl %eax, %eax
movq %rax, 0x1a8(%rbx)
movq (%r14), %rcx
movq %rcx, 0x1a8(%rbx)
movq %rax, (%r14)
leaq 0x18(%rbx), %r14
movq %r14, %rdi
callq 0x6fa8
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 0x6fb0
movq %rax, %r12
movups (%rax), %xmm0
leaq 0x90(%rsp), %r13
movaps %xmm0, -0x10(%r13)
leaq 0x10(%rax), %rsi
movq %r13, %rdi
callq 0x4ffe
movups 0x28(%r12), %xmm0
movups %xmm0, 0x18(%r13)
movups 0x4c(%rsp), %xmm0
movups %xmm0, 0x1c(%rsp)
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0xe0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
movq %r15, %rdx
movl %ebp, %ecx
callq 0x6872
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0xeacc
callq 0x4340
leaq 0x60(%rsp), %rdi
movq %r14, %rsi
callq 0x61b6
leaq 0xc0(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x61b6
leaq 0xd0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xeb04
callq 0x4340
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xeb17
callq 0x4340
movq %rbx, %rdi
callq 0xe0c2
movq 0x8(%rbx), %rdi
movq 0x190(%rbx), %rsi
leaq 0xe0(%rsp), %rcx
movq %r14, %rdx
callq 0x966a
leaq 0xe0(%rsp), %rdi
callq 0x4e48
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0xaa1e
movq %rax, %rbx
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xeb95
callq 0x4340
jmp 0xeb95
jmp 0xeb92
movq %rax, %rbx
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0xeba2
callq 0x4340
jmp 0xeba2
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x4e48
movq %rbx, %rdi
callq 0x4640
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
pushq %rax
movq %rdi, %rbx
movq 0x1a8(%rdi), %rdi
testq %rdi, %rdi
je 0xebe2
callq 0x41f0
movl %eax, %ebp
testl %eax, %eax
jne 0xebd6
addq $0x230, %rbx            # imm = 0x230
movq %rbx, %rdi
callq 0x11b8e
testl %ebp, %ebp
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x4366(%rip), %rdi      # 0x12f4f
leaq 0x4370(%rip), %rsi      # 0x12f60
leaq 0x4d16(%rip), %rcx      # 0x1390d
movl $0x4b, %edx
callq 0x4260
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xec55
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4130
movq %rax, %rdi
callq 0x43a0
movq %rax, %r15
movq 0x2a8(%rbx), %rsi
leaq -0xc64(%rip), %rcx      # 0xdfcc
movq %r14, %rdi
xorl %edx, %edx
movq %rbx, %r8
callq 0x4360
movq 0x8(%rbx), %rdi
movq 0x190(%rbx), %rsi
movq %r15, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x9006
leaq 0x4e54(%rip), %rdi      # 0x13ab0
leaq 0x4d29(%rip), %rsi      # 0x1398c
leaq 0x4fef(%rip), %rcx      # 0x13c59
movl $0x1a4, %edx            # imm = 0x1A4
callq 0x4260
// File: /workspace/github_cpp_makefile_star2_O3/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 0x639e
testb %al, %al
je 0xf35d
movq %r14, %rdi
callq 0x6fa8
movslq 0xc(%rax), %rax
movq %rax, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq %r14, %rdi
callq 0x6fa2
movq %rax, %r15
movq %rax, %rdi
callq 0x639e
testb %al, %al
je 0xf37c
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 0x615e
movq %r14, %rdi
callq 0x70d4
testb %al, %al
je 0xf31b
leaq 0x2b0(%rbx), %r14
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rbx
callq 0x9ec8
movl 0xc(%rsp), %r9d
leaq 0x10(%rsp), %rcx
movq %rcx, (%rsp)
leaq 0x20(%rsp), %r8
movq %r14, %rdi
movq %rbx, %rsi
movl %eax, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0xd186
jmp 0xf350
leaq 0xa8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x756a
movq %rbx, %rdi
movl $0x4, %esi
xorl %edx, %edx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0xdf22
leaq 0xa8(%rsp), %rdi
callq 0x4e48
addq $0x220, %rsp            # imm = 0x220
popq %rbx
popq %r14
popq %r15
retq
leaq 0x423c(%rip), %rdi      # 0x135a0
leaq 0x4b3c(%rip), %rsi      # 0x13ea7
leaq 0x4b47(%rip), %rcx      # 0x13eb9
movl $0x1b, %edx
callq 0x4260
leaq 0x4b59(%rip), %rdi      # 0x13edc
leaq 0x4b1d(%rip), %rsi      # 0x13ea7
leaq 0x4b28(%rip), %rcx      # 0x13eb9
movl $0x24, %edx
callq 0x4260
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x4e48
movq %rbx, %rdi
callq 0x4640
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x6fa2
movq %rax, %rdi
callq 0x6148
movq %rax, %r12
leaq 0x6(%rsp), %rsi
movl $0x2, %edx
movq %r14, %rdi
callq 0x46f0
cmpq $0x2, %rax
jne 0xf7ab
cmpb $0x5, 0x6(%rsp)
jne 0xf7ab
cmpb $0x2, 0x7(%rsp)
jne 0xf781
leaq 0xf46(%rip), %rsi       # 0x106a6
leaq 0x71(%rip), %rcx        # 0xf7d8
movq %r14, %rdi
xorl %edx, %edx
movq %rbx, %r8
callq 0x4360
movq %r14, %rdi
movq %r12, %rsi
callq 0xfd2c
jmp 0xf7a7
leaq 0x70c(%rip), %rsi       # 0xfe94
leaq 0x49(%rip), %rcx        # 0xf7d8
movq %r14, %rdi
xorl %edx, %edx
movq %rbx, %r8
callq 0x4360
movq %r14, %rdi
movq %r15, %rsi
callq 0xf83c
testb %al, %al
jne 0xf7cc
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0xf7b9
callq 0x10d46
movq $0x0, 0x10(%rbx)
movq (%rbx), %rax
movq %rbx, %rdi
xorl %esi, %esi
callq *0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq