// File: theuni[P]libbtcnet/src/handler.cpp
// Function: CConnectionHandlerInt::OnIncomingConnected(long, CConnection const&, CConnection const&)
void CConnectionHandlerInt::OnIncomingConnected(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.OnIncomingConnection(id, conn, resolved_conn))
        return;
    moved->SetRateLimitGroup(m_incoming_rate_limit);
    moved->Enable();
    {
        optional_lock(m_conn_mutex, m_enable_threading);
        m_connected.emplace_hint(m_connected.end(), id, std::move(moved));
    }
    m_incoming_conn_count++;
}

// 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 0xf4f1
jmp 0xf4f3
jmp 0xf512
leaq 0x163a3(%rip), %rdi     # 0x2589d
leaq 0x1628e(%rip), %rsi     # 0x2578f
movl $0x11b, %edx            # imm = 0x11B
leaq 0x16713(%rip), %rcx     # 0x25c20
callq 0x52e0
leaq 0x16769(%rip), %rdi     # 0x25c82
leaq 0x16776(%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 0xf568
jmp 0xf56a
jmp 0xf589
leaq 0x16696(%rip), %rdi     # 0x25c07
leaq 0x16217(%rip), %rsi     # 0x2578f
movl $0x11e, %edx            # imm = 0x11E
leaq 0x1669c(%rip), %rcx     # 0x25c20
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 0xf5de
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 0x48(%rax), %rax
callq *%rax
movb %al, -0xa1(%rbp)
jmp 0xf614
movb -0xa1(%rbp), %al
testb $0x1, %al
jne 0xf63d
jmp 0xf620
movl $0x1, -0x5c(%rbp)
jmp 0xf709
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xf730
leaq -0x38(%rbp), %rdi
callq 0x11430
movq -0x90(%rbp), %rsi
movq %rax, %rdi
addq $0x180, %rsi            # imm = 0x180
callq 0x1b410
jmp 0xf65e
leaq -0x38(%rbp), %rdi
callq 0x11430
movq %rax, %rdi
callq 0x1afb0
jmp 0xf671
movq -0x90(%rbp), %rax
movq %rax, %rsi
addq $0xf0, %rsi
movzbl 0xec(%rax), %edx
andl $0x1, %edx
leaq -0x70(%rbp), %rdi
callq 0x11290
jmp 0xf697
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 0xf6d5
movq -0xb0(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x11310
movq -0x90(%rbp), %rax
movl 0xe4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xe4(%rax)
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 %cs:(%rax,%rax)