// File: /workspace/github_cpp_makefile_star2_O3/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
cmpb $0x1, 0xec(%rdi)
jne 0x9cef
movq 0x168(%rbx), %r15
callq 0x4310
cmpq %rax, %r15
jne 0x9e6a
movq %rbx, %rdi
callq 0x925e
movq %rax, %r15
movq %rax, 0x10(%rsp)
movq %r14, %rdi
callq 0x6156
testb %al, %al
je 0x9da6
movq %r14, %rdi
callq 0x6fa8
cmpl $0x2, 0x4(%rax)
jne 0x9da6
movq %r14, %rdi
callq 0x6fa2
movq %rax, %rdi
callq 0x639e
testb %al, %al
jne 0x9e5e
movl $0x1d8, %edi            # imm = 0x1D8
callq 0x4350
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x11058
leaq 0x8(%rsp), %rcx
movq %r12, (%rcx)
leaq 0x90(%rbx), %rdi
addq $0x98, %rbx
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
callq 0xb562
movq 0x28(%rax), %rdi
callq 0x111ba
movq 0x8(%rsp), %rbx
testq %rbx, %rbx
je 0x9e5e
movq %rbx, %rdi
callq 0xb512
movq %rbx, %rdi
callq 0x4340
jmp 0x9e5e
movq %r14, %rdi
callq 0x6fa2
movq %rax, %rdi
callq 0x639e
testb %al, %al
je 0x9dda
movl $0x2e0, %edi            # imm = 0x2E0
callq 0x4350
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0xf0bc
jmp 0x9e24
movq %r14, %rdi
callq 0x6156
testb %al, %al
je 0x9e06
movl $0x2f0, %edi            # imm = 0x2F0
callq 0x4350
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0xbd80
jmp 0x9e24
movl $0x2c8, %edi            # imm = 0x2C8
callq 0x4350
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0xba6c
leaq 0x30(%rbx), %rdi
addq $0x38, %rbx
leaq 0x8(%rsp), %rcx
movq %r12, (%rcx)
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
callq 0xaf8e
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x9e54
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 0x8aa4(%rip), %rdi      # 0x12915
leaq 0x898f(%rip), %rsi      # 0x12807
leaq 0x8fd1(%rip), %rcx      # 0x12e50
movl $0x173, %edx            # imm = 0x173
callq 0x4260
jmp 0x9e8b
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xa9f0
jmp 0x9ec0
jmp 0x9ea0
jmp 0x9ea0
jmp 0x9ea0
movq %rax, %rbx
movq %r12, %rdi
callq 0x4340
jmp 0x9ec0
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x9ec0
movq (%rdi), %rax
callq *0x8(%rax)
movq %rbx, %rdi
callq 0x4640