// File: /workspace/github_cpp_makefile_star2_O2/tenup-coin[P]seeder/netbase.cpp
// Function: LookupIntern(char const*, std::vector<CNetAddr, std::allocator<CNetAddr>>&, unsigned int, bool)
bool static LookupIntern(const char *pszName, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions, bool fAllowLookup)
{
    vIP.clear();

    {
        CNetAddr addr;
        if (addr.SetSpecial(std::string(pszName))) {
            vIP.push_back(addr);
            return true;
        }
    }

    struct addrinfo aiHint;
    memset(&aiHint, 0, sizeof(struct addrinfo));

    aiHint.ai_socktype = SOCK_STREAM;
    aiHint.ai_protocol = IPPROTO_TCP;
#ifdef WIN32
    aiHint.ai_family = AF_UNSPEC;
    aiHint.ai_flags = fAllowLookup ? 0 : AI_NUMERICHOST;
#else
    aiHint.ai_family = AF_UNSPEC;
    aiHint.ai_flags = fAllowLookup ? AI_ADDRCONFIG : AI_NUMERICHOST;
#endif
    struct addrinfo *aiRes = NULL;
    int nErr = getaddrinfo(pszName, NULL, &aiHint, &aiRes);
    if (nErr)
        return false;

    struct addrinfo *aiTrav = aiRes;
    while (aiTrav != NULL && (nMaxSolutions == 0 || vIP.size() < nMaxSolutions))
    {
        if (aiTrav->ai_family == AF_INET)
        {
            assert(aiTrav->ai_addrlen >= sizeof(sockaddr_in));
            vIP.push_back(CNetAddr(((struct sockaddr_in*)(aiTrav->ai_addr))->sin_addr));
        }

        if (aiTrav->ai_family == AF_INET6)
        {
            assert(aiTrav->ai_addrlen >= sizeof(sockaddr_in6));
            vIP.push_back(CNetAddr(((struct sockaddr_in6*)(aiTrav->ai_addr))->sin6_addr));
        }

        aiTrav = aiTrav->ai_next;
    }

    freeaddrinfo(aiRes);

    return (vIP.size() > 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, %r14d
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r15
movq (%rsi), %rax
cmpq %rax, 0x8(%rsi)
je 0x6bc7
movq %rax, 0x8(%rbx)
xorps %xmm0, %xmm0
movq %rsp, %r12
movaps %xmm0, (%r12)
leaq 0x18(%rsp), %r13
leaq 0x10(%rsp), %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x3180
movq %r12, %rdi
movq %r13, %rsi
callq 0x811a
movl %eax, %r12d
leaq 0x18(%rsp), %rdi
callq 0x31d0
testb %r12b, %r12b
je 0x6c17
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x9268
movb $0x1, %r12b
jmp 0x6d02
xorps %xmm0, %xmm0
leaq 0x18(%rsp), %rdx
movups %xmm0, 0x20(%rdx)
movups %xmm0, 0x10(%rdx)
movl $0x6, 0xc(%rdx)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x4(%rdx)
testb %r14b, %r14b
pushq $0x20
popq %rax
pushq $0x4
popq %rcx
cmovnel %eax, %ecx
movl %ecx, (%rdx)
leaq 0x10(%rsp), %r14
andq $0x0, (%r14)
xorl %r12d, %r12d
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rcx
callq 0x34c0
testl %eax, %eax
jne 0x6d02
movl %ebp, %r12d
movq %rsp, %r15
movq (%r14), %r14
testq %r14, %r14
je 0x6ced
testl %ebp, %ebp
je 0x6c8d
movq 0x8(%rbx), %rax
subq (%rbx), %rax
sarq $0x4, %rax
cmpq %r12, %rax
jae 0x6ced
movl 0x4(%r14), %eax
cmpl $0x2, %eax
jne 0x6cc4
cmpl $0xf, 0x10(%r14)
jbe 0x6d14
movq 0x18(%r14), %rax
andq $0x0, (%rsp)
movl $0xffff0000, 0x8(%rsp)  # imm = 0xFFFF0000
movl 0x4(%rax), %eax
movl %eax, 0xc(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x93c4
movl 0x4(%r14), %eax
cmpl $0xa, %eax
jne 0x6ce7
cmpl $0x1b, 0x10(%r14)
jbe 0x6d2d
movq 0x18(%r14), %rax
movups 0x8(%rax), %xmm0
movaps %xmm0, (%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x93c4
addq $0x28, %r14
jmp 0x6c71
movq 0x10(%rsp), %rdi
callq 0x3500
movq 0x8(%rbx), %rax
cmpq (%rbx), %rax
setne %r12b
movl %r12d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb78b(%rip), %rdi      # 0x124a6
leaq 0xb62c(%rip), %rsi      # 0x1234e
leaq 0xb7a7(%rip), %rcx      # 0x124d0
pushq $0x5d
jmp 0x6d44
leaq 0xb7e9(%rip), %rdi      # 0x1251d
leaq 0xb613(%rip), %rsi      # 0x1234e
leaq 0xb78e(%rip), %rcx      # 0x124d0
pushq $0x63
popq %rdx
callq 0x32c0
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x31d0
movq %rbx, %rdi
callq 0x3690