// File: /workspace/github_cpp_makefile_star2_O3/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, %r15d
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rax
cmpq %rax, 0x8(%rsi)
je 0x73b8
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 %r14, %rsi
callq 0x3190
movq %r12, %rdi
movq %r13, %rsi
callq 0x8f98
movl %eax, %r12d
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x73f9
callq 0x33d0
testb %r12b, %r12b
je 0x741d
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x754d
movaps (%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x8(%rbx)
jmp 0x7558
xorps %xmm0, %xmm0
leaq 0x18(%rsp), %rdx
movups %xmm0, 0x20(%rdx)
movups %xmm0, 0x10(%rdx)
movl $0x6, 0xc(%rdx)
testb %r15b, %r15b
movl $0x20, %eax
movl $0x4, %ecx
cmovnel %eax, %ecx
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x4(%rdx)
movl %ecx, (%rdx)
leaq 0x10(%rsp), %rcx
movq $0x0, (%rcx)
xorl %r15d, %r15d
movq %r14, %rdi
xorl %esi, %esi
callq 0x34b0
testl %eax, %eax
jne 0x756f
movq 0x10(%rsp), %r15
testq %r15, %r15
je 0x755d
movl %ebp, %r12d
movq %rsp, %r14
testl %ebp, %ebp
je 0x74a1
movq 0x8(%rbx), %rax
subq (%rbx), %rax
sarq $0x4, %rax
cmpq %r12, %rax
jae 0x7546
movl 0x4(%r15), %eax
cmpl $0x2, %eax
jne 0x74f7
cmpl $0xf, 0x10(%r15)
jbe 0x7581
movq 0x18(%r15), %rax
movl $0xffff0000, 0x8(%rsp)  # imm = 0xFFFF0000
movq $0x0, (%rsp)
movl 0x4(%rax), %eax
movl %eax, 0xc(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x74e8
movups (%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x8(%rbx)
jmp 0x74f3
movq %rbx, %rdi
movq %r14, %rdx
callq 0xa556
movl 0x4(%r15), %eax
cmpl $0xa, %eax
jne 0x7539
cmpl $0x1b, 0x10(%r15)
jbe 0x75a0
movq 0x18(%r15), %rax
movups 0x8(%rax), %xmm0
movaps %xmm0, (%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x752e
addq $0x8, %rax
movups (%rax), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x8(%rbx)
jmp 0x7539
movq %rbx, %rdi
movq %r14, %rdx
callq 0xa556
movq 0x28(%r15), %r15
testq %r15, %r15
jne 0x7489
movq 0x10(%rsp), %rdi
jmp 0x755f
movq %rsp, %rdx
movq %rbx, %rdi
callq 0xa41e
movb $0x1, %r15b
jmp 0x756f
xorl %edi, %edi
callq 0x34e0
movq 0x8(%rbx), %rax
cmpq (%rbx), %rax
setne %r15b
movl %r15d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xbf4e(%rip), %rdi      # 0x134d6
leaq 0xbdef(%rip), %rsi      # 0x1337e
leaq 0xbf6a(%rip), %rcx      # 0x13500
movl $0x5d, %edx
callq 0x32b0
leaq 0xbfa6(%rip), %rdi      # 0x1354d
leaq 0xbdd0(%rip), %rsi      # 0x1337e
leaq 0xbf4b(%rip), %rcx      # 0x13500
movl $0x63, %edx
callq 0x32b0
movq %rax, %rbx
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x75d5
callq 0x33d0
movq %rbx, %rdi
callq 0x3650