// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::StartConnection(CConnection&&)
void CConnectionHandlerInt::StartConnection(CConnection&& conn)
{
    assert(IsEventThread());
    ConnID id = GetNextConnectionIndex();
    if (conn.IsDNS() && conn.GetOptions().doResolve == CConnectionOptions::RESOLVE_ONLY) {
        if (conn.GetProxy().IsSet()) {
            /* TODO */
        } else {
            std::unique_ptr<CResolveOnly> ptr(new CResolveOnly(*this, std::move(conn), id));
            auto it = m_dns_resolves.emplace_hint(m_dns_resolves.end(), id, std::move(ptr));
            it->second->Resolve();
        }
    } else {
        ConnectionBase* ptr;
        if (conn.GetProxy().IsSet())
            ptr = new CProxyConn(*this, std::move(conn), id);
        else if (conn.IsDNS())
            ptr = new CDNSConnection(*this, std::move(conn), id);
        else
            ptr = new CDirectConnection(*this, std::move(conn), id);
        auto it = m_connecting.emplace_hint(m_connecting.end(), id, std::unique_ptr<ConnectionBase>(ptr));
        it->second->Connect();
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x8016
testb %al, %al
je 0x8e2f
movq %rbx, %rdi
callq 0x83e0
movq %rax, %r15
movq %rax, 0x10(%rsp)
movq %r14, %rdi
callq 0x5d02
testb %al, %al
je 0x8d6b
movq %r14, %rdi
callq 0x63e8
cmpl $0x2, 0x4(%rax)
jne 0x8d6b
movq %r14, %rdi
callq 0x63e2
movq %rax, %rdi
callq 0x5f12
testb %al, %al
jne 0x8e23
movl $0x1d8, %edi            # imm = 0x1D8
callq 0x4360
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0xee88
leaq 0x8(%rsp), %rcx
movq %r12, (%rcx)
leaq 0x90(%rbx), %rdi
addq $0x98, %rbx
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
callq 0xa5ae
movq 0x28(%rax), %rdi
callq 0xef92
leaq 0x8(%rsp), %rdi
callq 0x97a0
jmp 0x8e23
movq %r14, %rdi
callq 0x63e2
movq %rax, %rdi
callq 0x5f12
testb %al, %al
je 0x8d9f
movl $0x2e0, %edi            # imm = 0x2E0
callq 0x4360
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0xd708
jmp 0x8de9
movq %r14, %rdi
callq 0x5d02
testb %al, %al
je 0x8dcb
movl $0x2f0, %edi            # imm = 0x2F0
callq 0x4360
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0xada8
jmp 0x8de9
movl $0x2c8, %edi            # imm = 0x2C8
callq 0x4360
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0xaad0
leaq 0x30(%rbx), %rdi
addq $0x38, %rbx
leaq 0x8(%rsp), %rcx
movq %r12, (%rcx)
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
callq 0x9eea
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x8e19
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x28(%rbx), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x7ae3(%rip), %rdi      # 0x10919
leaq 0x79ce(%rip), %rsi      # 0x1080b
leaq 0x8010(%rip), %rcx      # 0x10e54
movl $0x173, %edx            # imm = 0x173
callq 0x4260
jmp 0x8e50
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x97a0
jmp 0x8e85
jmp 0x8e65
jmp 0x8e65
jmp 0x8e65
movq %rax, %rbx
movq %r12, %rdi
callq 0x4350
jmp 0x8e85
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x8e85
movq (%rdi), %rax
callq *0x8(%rax)
movq %rbx, %rdi
callq 0x4660
nop