// File: theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::OnOutgoingConnected(long, CConnection const&, CConnection const&)
void CConnectionHandlerInt::OnOutgoingConnected(ConnID id, const CConnection& conn, const CConnection& resolved_conn)
{
    assert(IsEventThread());
    DEBUG_PRINT(LOGVERBOSE, "id:", id);
    auto it = m_connecting.find(id);
    assert(it != m_connecting.end());
    std::unique_ptr<ConnectionBase> moved(nullptr);
    it->second.swap(moved);
    m_connecting.erase(it);

    if (!m_interface.OnOutgoingConnection(id, conn, resolved_conn))
        return;
    moved->SetRateLimitGroup(m_outgoing_rate_limit);
    moved->Enable();
    {
        optional_lock(m_conn_mutex, m_enable_threading);
        m_connected.emplace_hint(m_connected.end(), id, std::move(moved));
    }
    m_outgoing_conn_count++;
    m_interface.OnReadyForFirstSend(id);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0xe790
testb $0x1, %al
jne 0xf781
jmp 0xf783
jmp 0xf7a2
leaq 0x16113(%rip), %rdi     # 0x2589d
leaq 0x15ffe(%rip), %rsi     # 0x2578f
movl $0x130, %edx            # imm = 0x130
leaq 0x164fd(%rip), %rcx     # 0x25c9a
callq 0x52e0
leaq 0x16553(%rip), %rdi     # 0x25cfc
leaq 0x164e6(%rip), %rsi     # 0x25c96
leaq -0x10(%rbp), %rdx
callq 0x119c0
movq -0x90(%rbp), %rdi
addq $0x30, %rdi
leaq -0x10(%rbp), %rsi
callq 0x11800
movq -0x90(%rbp), %rdi
movq %rax, -0x28(%rbp)
addq $0x30, %rdi
callq 0x113e0
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x113b0
testb $0x1, %al
jne 0xf7f8
jmp 0xf7fa
jmp 0xf819
leaq 0x16406(%rip), %rdi     # 0x25c07
leaq 0x15f87(%rip), %rsi     # 0x2578f
movl $0x133, %edx            # imm = 0x133
leaq 0x16486(%rip), %rcx     # 0x25c9a
callq 0x52e0
xorl %eax, %eax
movl %eax, %esi
leaq -0x38(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x119e0
leaq -0x28(%rbp), %rdi
callq 0x11410
movq -0xa0(%rbp), %rsi
movq %rax, %rdi
addq $0x8, %rdi
callq 0x11830
movq -0x90(%rbp), %rdi
addq $0x30, %rdi
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rsi
callq 0x11450
movq %rax, -0x98(%rbp)
jmp 0xf86e
movq -0x90(%rbp), %rax
movq -0x98(%rbp), %rcx
movq %rcx, -0x58(%rbp)
movq 0xc0(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq (%rdi), %rax
movq 0x40(%rax), %rax
callq *%rax
movb %al, -0xa1(%rbp)
jmp 0xf8a4
movb -0xa1(%rbp), %al
testb $0x1, %al
jne 0xf8cd
jmp 0xf8b0
movl $0x1, -0x5c(%rbp)
jmp 0xf9ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xf9d5
leaq -0x38(%rbp), %rdi
callq 0x11430
movq -0x90(%rbp), %rsi
movq %rax, %rdi
addq $0x188, %rsi            # imm = 0x188
callq 0x1b410
jmp 0xf8ee
leaq -0x38(%rbp), %rdi
callq 0x11430
movq %rax, %rdi
callq 0x1afb0
jmp 0xf901
movq -0x90(%rbp), %rax
movq %rax, %rsi
addq $0xf0, %rsi
movzbl 0xec(%rax), %edx
andl $0x1, %edx
leaq -0x70(%rbp), %rdi
callq 0x11290
jmp 0xf927
movq -0x90(%rbp), %rdi
callq 0x113e0
movq %rax, -0x80(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x118b0
movq -0x90(%rbp), %rdi
movq -0x78(%rbp), %rsi
leaq -0x10(%rbp), %rdx
leaq -0x38(%rbp), %rcx
callq 0x11860
movq %rax, -0xb0(%rbp)
jmp 0xf965
movq -0xb0(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x11310
movq -0x90(%rbp), %rax
movl 0xe0(%rax), %ecx
incl %ecx
movl %ecx, 0xe0(%rax)
movq 0xc0(%rax), %rdi
movq -0x10(%rbp), %rsi
movq (%rdi), %rax
movq 0x58(%rax), %rax
callq *%rax
jmp 0xf9a7
movl $0x0, -0x5c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x118d0
addq $0xb0, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x11310
leaq -0x38(%rbp), %rdi
callq 0x118d0
movq -0x48(%rbp), %rdi
callq 0x5710
nopw (%rax,%rax)