// File: theuni[P]libbtcnet/src/dnsconn.cpp
// Function: CDNSConnection::DoResolve()
void CDNSConnection::DoResolve()
{
    assert(!m_request);
    assert(m_resolved.empty());
    assert(m_iter == m_resolved.end());

    const CConnectionOptions& opts = m_connection.GetOptions();
    evutil_addrinfo hint;
    memset(&hint, 0, sizeof(hint));
    hint.ai_socktype = SOCK_STREAM;
    hint.ai_protocol = IPPROTO_TCP;
    hint.ai_flags = EVUTIL_AI_NUMERICSERV;
    hint.ai_flags |= opts.doResolve == CConnectionOptions::NO_RESOLVE ? EVUTIL_AI_NUMERICHOST : EVUTIL_AI_ADDRCONFIG;

    if (m_connection.CanResolve() && SetResolveFamily(opts.nFamily, &hint))
        m_request = Resolve(m_dns_base, m_connection.GetHost().c_str(), std::to_string(m_connection.GetPort()).c_str(), &hint);
    else
        OnResolveFailure(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
addq $0x2e0, %rdi            # imm = 0x2E0
callq 0x19d10
testb $0x1, %al
jne 0x18e5c
jmp 0x18e5e
jmp 0x18e7d
leaq 0xd78b(%rip), %rdi      # 0x265f0
leaq 0xd78f(%rip), %rsi      # 0x265fb
movl $0x2b, %edx
leaq 0xd7ba(%rip), %rcx      # 0x26632
callq 0x52e0
movq -0xa8(%rbp), %rdi
addq $0x2d0, %rdi            # imm = 0x2D0
callq 0x180f0
testb $0x1, %al
jne 0x18e96
jmp 0x18e98
jmp 0x18eb7
leaq 0xd88c(%rip), %rdi      # 0x2672b
leaq 0xd755(%rip), %rsi      # 0x265fb
movl $0x2c, %edx
leaq 0xd780(%rip), %rcx      # 0x26632
callq 0x52e0
movq -0xa8(%rbp), %rdi
movq %rdi, %rax
addq $0x2d8, %rax            # imm = 0x2D8
movq %rax, -0xb0(%rbp)
addq $0x2d0, %rdi            # imm = 0x2D0
callq 0x180c0
movq -0xb0(%rbp), %rdi
movq %rax, -0x10(%rbp)
leaq -0x10(%rbp), %rsi
callq 0x17f80
testb $0x1, %al
jne 0x18ef4
jmp 0x18ef6
jmp 0x18f15
leaq 0xd756(%rip), %rdi      # 0x26653
leaq 0xd6f7(%rip), %rsi      # 0x265fb
movl $0x2d, %edx
leaq 0xd722(%rip), %rcx      # 0x26632
callq 0x52e0
movq -0xa8(%rbp), %rdi
addq $0x18, %rdi
callq 0xa9c0
movq %rax, -0x18(%rbp)
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x5220
movq -0xa8(%rbp), %rdi
movl $0x1, -0x40(%rbp)
movl $0x6, -0x3c(%rbp)
movl $0x400, -0x48(%rbp)     # imm = 0x400
movq -0x18(%rbp), %rax
movl 0x4(%rax), %edx
movl $0x20, %eax
movl $0x4, %ecx
cmpl $0x1, %edx
cmovel %ecx, %eax
orl -0x48(%rbp), %eax
movl %eax, -0x48(%rbp)
addq $0x18, %rdi
callq 0xacc0
testb $0x1, %al
jne 0x18f84
jmp 0x190c4
movq -0x18(%rbp), %rax
movl 0x28(%rax), %edi
leaq -0x48(%rbp), %rsi
callq 0x181b0
testb $0x1, %al
jne 0x18f9d
jmp 0x190c4
movq -0xa8(%rbp), %rsi
movq %rsi, %rax
addq $0x2c0, %rax            # imm = 0x2C0
movq %rax, -0xe0(%rbp)
movq 0x2e8(%rsi), %rax
movq %rax, -0xd8(%rbp)
addq $0x18, %rsi
movq %rsi, -0xc8(%rbp)
leaq -0x70(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x9d90
movq -0xd0(%rbp), %rdi
callq 0x5190
movq -0xc8(%rbp), %rdi
movq %rax, -0xc0(%rbp)
callq 0x9fb0
movw %ax, -0xb2(%rbp)
jmp 0x19005
movw -0xb2(%rbp), %ax
movzwl %ax, %esi
leaq -0x90(%rbp), %rdi
callq 0xb160
jmp 0x1901d
leaq -0x90(%rbp), %rdi
callq 0x5190
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
movq -0xc0(%rbp), %rcx
movq %rax, %r8
leaq -0x50(%rbp), %rdi
leaq -0x48(%rbp), %r9
callq 0x18220
jmp 0x19050
movq -0xa8(%rbp), %rdi
addq $0x2e0, %rdi            # imm = 0x2E0
leaq -0x50(%rbp), %rsi
callq 0x19d30
leaq -0x50(%rbp), %rdi
callq 0x17270
leaq -0x90(%rbp), %rdi
callq 0x52a0
leaq -0x70(%rbp), %rdi
callq 0x52a0
jmp 0x190d2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x190b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x52a0
leaq -0x70(%rbp), %rdi
callq 0x52a0
jmp 0x190db
movq -0xa8(%rbp), %rdi
xorl %esi, %esi
callq 0x19270
addq $0xe0, %rsp
popq %rbp
retq
movq -0x98(%rbp), %rdi
callq 0x5710
nopw (%rax,%rax)