// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x1, 0xec(%rdi)
jne 0x9d83
movq 0x168(%rbx), %r15
callq 0x4310
cmpq %rax, %r15
jne 0x9ef8
movq %rbx, %rdi
callq 0x92ca
movq %rax, (%rsp)
movq %r14, %rdi
callq 0x6186
testb %al, %al
je 0x9e35
movq %r14, %rdi
callq 0x701a
cmpl $0x2, 0x4(%rax)
jne 0x9e35
movq %r14, %rdi
callq 0x7014
movq %rax, %rdi
callq 0x63d2
testb %al, %al
jne 0x9eee
movl $0x1d8, %edi            # imm = 0x1D8
callq 0x4350
movq %rax, %r15
movq (%rsp), %rcx
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x11200
leaq 0x8(%rsp), %rcx
movq %r15, (%rcx)
leaq 0x90(%rbx), %rdi
addq $0x98, %rbx
movq %rsp, %rdx
movq %rbx, %rsi
callq 0xb6e8
movq 0x28(%rax), %rdi
callq 0x11360
movq 0x8(%rsp), %rbx
testq %rbx, %rbx
je 0x9eee
movq %rbx, %rdi
callq 0xb698
movq %rbx, %rdi
callq 0x4340
jmp 0x9eee
movq %r14, %rdi
callq 0x7014
movq %rax, %rdi
callq 0x63d2
testb %al, %al
je 0x9e6a
movl $0x2e0, %edi            # imm = 0x2E0
callq 0x4350
movq %rax, %r15
movq (%rsp), %rcx
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xf278
jmp 0x9eb6
movq %r14, %rdi
callq 0x6186
testb %al, %al
je 0x9e97
movl $0x2f0, %edi            # imm = 0x2F0
callq 0x4350
movq %rax, %r15
movq (%rsp), %rcx
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xbf04
jmp 0x9eb6
movl $0x2c8, %edi            # imm = 0x2C8
callq 0x4350
movq %rax, %r15
movq (%rsp), %rcx
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xbbf0
leaq 0x30(%rbx), %rdi
addq $0x38, %rbx
leaq 0x8(%rsp), %rcx
movq %r15, (%rcx)
movq %rsp, %rdx
movq %rbx, %rsi
callq 0xb11a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x9ee4
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x28(%rbx), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x8a1a(%rip), %rdi      # 0x12919
leaq 0x8905(%rip), %rsi      # 0x1280b
leaq 0x8f47(%rip), %rcx      # 0x12e54
movl $0x173, %edx            # imm = 0x173
callq 0x4260
jmp 0x9f19
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xab56
jmp 0x9f4e
jmp 0x9f2e
jmp 0x9f2e
jmp 0x9f2e
movq %rax, %rbx
movq %r15, %rdi
callq 0x4340
jmp 0x9f4e
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x9f4e
movq (%rdi), %rax
callq *0x8(%rax)
movq %rbx, %rdi
callq 0x4640