// File: /workspace/github_cpp_makefile_star2_O1/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 $0x58, %rsp
movl %ecx, %r15d
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rax
cmpq %rax, 0x8(%rsi)
je 0x7477
movq %rax, 0x8(%rbx)
xorps %xmm0, %xmm0
movq %rsp, %r12
movaps %xmm0, (%r12)
leaq 0x20(%rsp), %r13
leaq 0x18(%rsp), %rdx
movq %r13, %rdi
movq %r14, %rsi
callq 0x3190
movq %r12, %rdi
movq %r13, %rsi
callq 0x9096
movl %eax, %r12d
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x74b8
callq 0x33d0
testb %r12b, %r12b
je 0x74ec
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x74d5
movaps (%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x8(%rbx)
jmp 0x74e0
movq %rsp, %rdx
movq %rbx, %rdi
callq 0xa58e
movb $0x1, %r13b
testb %r12b, %r12b
jne 0x7629
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x20(%rdx)
movaps %xmm0, 0x10(%rdx)
movabsq $0x600000001, %rax      # imm = 0x600000001
movq %rax, 0x8(%rdx)
testb %r15b, %r15b
movl $0x20, %eax
movl $0x4, %ecx
cmovnel %eax, %ecx
movl $0x0, 0x4(%rdx)
movl %ecx, (%rdx)
leaq 0x18(%rsp), %rcx
movq $0x0, (%rcx)
xorl %r13d, %r13d
movq %r14, %rdi
xorl %esi, %esi
callq 0x34b0
testl %eax, %eax
jne 0x7629
movq 0x18(%rsp), %r15
testq %r15, %r15
je 0x7614
movl %ebp, %r12d
movq %rsp, %r14
testl %ebp, %ebp
je 0x7573
movq 0x8(%rbx), %rax
subq (%rbx), %rax
sarq $0x4, %rax
cmpq %r12, %rax
jae 0x7614
cmpl $0x2, 0x4(%r15)
jne 0x75c3
cmpl $0xf, 0x10(%r15)
jbe 0x763b
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 0x75b8
movups (%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x8(%rbx)
jmp 0x75c3
movq %rbx, %rdi
movq %r14, %rdx
callq 0xa6c6
cmpl $0xa, 0x4(%r15)
jne 0x7607
cmpl $0x1b, 0x10(%r15)
jbe 0x765a
movq 0x18(%r15), %rax
movups 0x8(%rax), %xmm0
movaps %xmm0, (%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x75fc
addq $0x8, %rax
movups (%rax), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x8(%rbx)
jmp 0x7607
movq %rbx, %rdi
movq %r14, %rdx
callq 0xa6c6
movq 0x28(%r15), %r15
testq %r15, %r15
jne 0x755b
movq 0x18(%rsp), %rdi
callq 0x34e0
movq 0x8(%rbx), %rax
cmpq (%rbx), %rax
setne %r13b
movl %r13d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xbe94(%rip), %rdi      # 0x134d6
leaq 0xbd35(%rip), %rsi      # 0x1337e
leaq 0xbeb0(%rip), %rcx      # 0x13500
movl $0x5d, %edx
callq 0x32b0
leaq 0xbeec(%rip), %rdi      # 0x1354d
leaq 0xbd16(%rip), %rsi      # 0x1337e
leaq 0xbe91(%rip), %rcx      # 0x13500
movl $0x63, %edx
callq 0x32b0
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x768f
callq 0x33d0
movq %rbx, %rdi
callq 0x3650