// File: 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
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movb %cl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
andb $0x1, %al
movb %al, -0x1d(%rbp)
movq -0x18(%rbp), %rdi
callq 0x15890
leaq -0x2d(%rbp), %rdi
callq 0x132e0
movq -0x10(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x4800
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
leaq -0x50(%rbp), %rdi
callq 0x4690
jmp 0xfa03
leaq -0x2d(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x12e90
movb %al, -0xe1(%rbp)
jmp 0xfa18
leaq -0x50(%rbp), %rdi
callq 0x42f0
leaq -0x51(%rbp), %rdi
callq 0x4520
movb -0xe1(%rbp), %al
testb $0x1, %al
jne 0xfa36
jmp 0xfa7d
movq -0x18(%rbp), %rdi
leaq -0x2d(%rbp), %rsi
callq 0x158b0
movb $0x1, -0x1(%rbp)
jmp 0xfc8c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xfa6f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x42f0
leaq -0x51(%rbp), %rdi
callq 0x4520
jmp 0xfc9a
leaq -0x98(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x4270
movl $0x1, -0x90(%rbp)
movl $0x6, -0x8c(%rbp)
movl $0x0, -0x94(%rbp)
movb -0x1d(%rbp), %dl
movl $0x4, %eax
movl $0x20, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x98(%rbp)
movq $0x0, -0xa0(%rbp)
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq -0x98(%rbp), %rdx
leaq -0xa0(%rbp), %rcx
callq 0x45f0
movl %eax, -0xa4(%rbp)
cmpl $0x0, -0xa4(%rbp)
je 0xfb05
movb $0x0, -0x1(%rbp)
jmp 0xfc8c
movq -0xa0(%rbp), %rax
movq %rax, -0xb0(%rbp)
xorl %eax, %eax
cmpq $0x0, -0xb0(%rbp)
movb %al, -0xe2(%rbp)
je 0xfb57
movb $0x1, %al
cmpl $0x0, -0x1c(%rbp)
movb %al, -0xe3(%rbp)
je 0xfb4b
movq -0x18(%rbp), %rdi
callq 0x15360
movl -0x1c(%rbp), %ecx
cmpq %rcx, %rax
setb %al
movb %al, -0xe3(%rbp)
movb -0xe3(%rbp), %al
movb %al, -0xe2(%rbp)
movb -0xe2(%rbp), %al
testb $0x1, %al
jne 0xfb66
jmp 0xfc6b
movq -0xb0(%rbp), %rax
cmpl $0x2, 0x4(%rax)
jne 0xfbdd
movq -0xb0(%rbp), %rax
movl 0x10(%rax), %eax
cmpq $0x10, %rax
jb 0xfb85
jmp 0xfba4
leaq 0x2392a(%rip), %rdi     # 0x334b6
leaq 0x237cb(%rip), %rsi     # 0x3335e
movl $0x5d, %edx
leaq 0x23941(%rip), %rcx     # 0x334e0
callq 0x4350
movq -0x18(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0xb0(%rbp), %rax
movq 0x18(%rax), %rsi
addq $0x4, %rsi
leaq -0xc0(%rbp), %rdi
callq 0x13300
movq -0xf0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x15920
movq -0xb0(%rbp), %rax
cmpl $0xa, 0x4(%rax)
jne 0xfc54
movq -0xb0(%rbp), %rax
movl 0x10(%rax), %eax
cmpq $0x1c, %rax
jb 0xfbfc
jmp 0xfc1b
leaq 0x2392a(%rip), %rdi     # 0x3352d
leaq 0x23754(%rip), %rsi     # 0x3335e
movl $0x63, %edx
leaq 0x238ca(%rip), %rcx     # 0x334e0
callq 0x4350
movq -0x18(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0xb0(%rbp), %rax
movq 0x18(%rax), %rsi
addq $0x8, %rsi
leaq -0xd0(%rbp), %rdi
callq 0x13330
movq -0xf8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x15920
movq -0xb0(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0xb0(%rbp)
jmp 0xfb13
movq -0xa0(%rbp), %rdi
callq 0x4630
movq -0x18(%rbp), %rdi
callq 0x15360
cmpq $0x0, %rax
seta %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x47f0
nopw %cs:(%rax,%rax)