// File: tenup-coin[P]seeder/netbase.cpp
// Function: CNetAddr::ToStringIP[abi:cxx11]() const
std::string CNetAddr::ToStringIP() const
{
    if (IsTor())
        return EncodeBase32(&ip[6], 10) + ".onion";
    if (IsI2P())
        return EncodeBase32(&ip[6], 10) + ".oc.b32.i2p";
    CService serv(*this, 0);
    struct sockaddr_storage sockaddr;
    socklen_t socklen = sizeof(sockaddr);
    if (serv.GetSockAddr((struct sockaddr*)&sockaddr, &socklen)) {
        char name[1025] = "";
        if (!getnameinfo((const struct sockaddr*)&sockaddr, socklen, name, sizeof(name), NULL, 0, NI_NUMERICHOST))
            return std::string(name);
    }
    if (IsIPv4())
        return strprintf("%u.%u.%u.%u", GetByte(3), GetByte(2), GetByte(1), GetByte(0));
    else
        return strprintf("%x:%x:%x:%x:%x:%x:%x:%x",
                         GetByte(15) << 8 | GetByte(14), GetByte(13) << 8 | GetByte(12),
                         GetByte(11) << 8 | GetByte(10), GetByte(9) << 8 | GetByte(8),
                         GetByte(7) << 8 | GetByte(6), GetByte(5) << 8 | GetByte(4),
                         GetByte(3) << 8 | GetByte(2), GetByte(1) << 8 | GetByte(0));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x600, %rsp            # imm = 0x600
movq %rdi, -0x580(%rbp)
movq %rdi, %rax
movq %rax, -0x578(%rbp)
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq %rdi, -0x570(%rbp)
callq 0x13580
testb $0x1, %al
jne 0x1253d
jmp 0x125a1
movq -0x570(%rbp), %rsi
addq $0x6, %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0x588(%rbp)
movl $0xa, %edx
callq 0x31580
movq -0x580(%rbp), %rdi
movq -0x588(%rbp), %rsi
leaq 0x20e55(%rip), %rdx     # 0x333c7
callq 0x155b0
jmp 0x12579
leaq -0x40(%rbp), %rdi
callq 0x42f0
jmp 0x12aac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x42f0
jmp 0x12abf
movq -0x570(%rbp), %rdi
callq 0x135b0
testb $0x1, %al
jne 0x125b3
jmp 0x12617
movq -0x570(%rbp), %rsi
addq $0x6, %rsi
leaq -0x70(%rbp), %rdi
movq %rdi, -0x590(%rbp)
movl $0xa, %edx
callq 0x31580
movq -0x580(%rbp), %rdi
movq -0x590(%rbp), %rsi
leaq 0x20de6(%rip), %rdx     # 0x333ce
callq 0x155b0
jmp 0x125ef
leaq -0x70(%rbp), %rdi
callq 0x42f0
jmp 0x12aac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x42f0
jmp 0x12abf
movq -0x570(%rbp), %rsi
leaq -0x82(%rbp), %rdi
xorl %edx, %edx
callq 0x14640
movl $0x80, -0x10c(%rbp)
leaq -0x82(%rbp), %rdi
leaq -0x108(%rbp), %rsi
leaq -0x10c(%rbp), %rdx
callq 0x13c30
testb $0x1, %al
jne 0x12659
jmp 0x126fd
leaq -0x510(%rbp), %rdi
xorl %esi, %esi
movl $0x401, %edx            # imm = 0x401
callq 0x4270
movl -0x10c(%rbp), %esi
leaq -0x510(%rbp), %rdx
leaq -0x108(%rbp), %rdi
movl $0x401, %ecx            # imm = 0x401
xorl %eax, %eax
movl %eax, %r8d
xorl %r9d, %r9d
movl $0x1, (%rsp)
callq 0x4300
cmpl $0x0, %eax
jne 0x126fb
leaq -0x511(%rbp), %rdi
movq %rdi, -0x598(%rbp)
callq 0x4800
movq -0x580(%rbp), %rdi
movq -0x598(%rbp), %rdx
leaq -0x510(%rbp), %rsi
callq 0x4690
jmp 0x126cd
leaq -0x511(%rbp), %rdi
callq 0x4520
jmp 0x12aac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x511(%rbp), %rdi
callq 0x4520
jmp 0x12abf
jmp 0x126fd
movq -0x570(%rbp), %rdi
callq 0x134f0
testb $0x1, %al
jne 0x12712
jmp 0x1281f
leaq -0x539(%rbp), %rdi
movq %rdi, -0x5a0(%rbp)
callq 0x4800
movq -0x5a0(%rbp), %rdx
leaq 0x20ca7(%rip), %rsi     # 0x333da
leaq -0x538(%rbp), %rdi
callq 0x4690
jmp 0x12741
movq -0x570(%rbp), %rdi
movl $0x3, %esi
callq 0x134d0
movq -0x570(%rbp), %rdi
movl %eax, -0x5b0(%rbp)
movl $0x2, %esi
callq 0x134d0
movq -0x570(%rbp), %rdi
movl %eax, -0x5ac(%rbp)
movl $0x1, %esi
callq 0x134d0
movq -0x570(%rbp), %rdi
movl %eax, -0x5a8(%rbp)
xorl %esi, %esi
movl %esi, -0x5a4(%rbp)
callq 0x134d0
movq -0x580(%rbp), %rdi
movl -0x5b0(%rbp), %edx
movl -0x5ac(%rbp), %ecx
movl -0x5a8(%rbp), %r8d
movl %eax, %r9d
movl -0x5a4(%rbp), %eax
leaq -0x538(%rbp), %rsi
callq 0x13d70
jmp 0x127cb
leaq -0x538(%rbp), %rdi
callq 0x42f0
leaq -0x539(%rbp), %rdi
callq 0x4520
jmp 0x12aac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x1280e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x538(%rbp), %rdi
callq 0x42f0
leaq -0x539(%rbp), %rdi
callq 0x4520
jmp 0x12abf
leaq -0x561(%rbp), %rdi
movq %rdi, -0x5b8(%rbp)
callq 0x4800
movq -0x5b8(%rbp), %rdx
leaq 0x20ba6(%rip), %rsi     # 0x333e6
leaq -0x560(%rbp), %rdi
callq 0x4690
jmp 0x1284e
movq -0x570(%rbp), %rdi
movl $0xf, %esi
callq 0x134d0
movq -0x570(%rbp), %rdi
shll $0x8, %eax
movl %eax, -0x5ec(%rbp)
movl $0xe, %esi
callq 0x134d0
movq -0x570(%rbp), %rdi
movl %eax, %ecx
movl -0x5ec(%rbp), %eax
orl %ecx, %eax
movl %eax, -0x5cc(%rbp)
movl $0xd, %esi
callq 0x134d0
movq -0x570(%rbp), %rdi
shll $0x8, %eax
movl %eax, -0x5e8(%rbp)
movl $0xc, %esi
callq 0x134d0
movq -0x570(%rbp), %rdi
movl %eax, %ecx
movl -0x5e8(%rbp), %eax
orl %ecx, %eax
movl %eax, -0x5c8(%rbp)
movl $0xb, %esi
callq 0x134d0
movq -0x570(%rbp), %rdi
shll $0x8, %eax
movl %eax, -0x5e4(%rbp)
movl $0xa, %esi
callq 0x134d0
movq -0x570(%rbp), %rdi
movl %eax, %ecx
movl -0x5e4(%rbp), %eax
orl %ecx, %eax
movl %eax, -0x5c4(%rbp)
movl $0x9, %esi
callq 0x134d0
movq -0x570(%rbp), %rdi
shll $0x8, %eax
movl %eax, -0x5e0(%rbp)
movl $0x8, %esi
callq 0x134d0
movq -0x570(%rbp), %rdi
movl %eax, %ecx
movl -0x5e0(%rbp), %eax
orl %ecx, %eax
movl %eax, -0x5c0(%rbp)
movl $0x7, %esi
callq 0x134d0
movq -0x570(%rbp), %rdi
shll $0x8, %eax
movl %eax, -0x5dc(%rbp)
movl $0x6, %esi
callq 0x134d0
movq -0x570(%rbp), %rdi
movl %eax, %ecx
movl -0x5dc(%rbp), %eax
orl %ecx, %eax
movl %eax, -0x5d0(%rbp)
movl $0x5, %esi
callq 0x134d0
movq -0x570(%rbp), %rdi
shll $0x8, %eax
movl %eax, -0x5d8(%rbp)
movl $0x4, %esi
callq 0x134d0
movq -0x570(%rbp), %rdi
movl %eax, %ecx
movl -0x5d8(%rbp), %eax
orl %ecx, %eax
movl %eax, -0x5d4(%rbp)
movl $0x3, %esi
callq 0x134d0
movq -0x570(%rbp), %rdi
movl %eax, %ebx
shll $0x8, %ebx
movl $0x2, %esi
callq 0x134d0
movq -0x570(%rbp), %rdi
orl %eax, %ebx
movl $0x1, %esi
callq 0x134d0
movq -0x570(%rbp), %rdi
movl %eax, %r14d
shll $0x8, %r14d
xorl %esi, %esi
movl %esi, -0x5bc(%rbp)
callq 0x134d0
movl -0x5d4(%rbp), %r11d
movl -0x5d0(%rbp), %r10d
movq -0x580(%rbp), %rdi
movl -0x5cc(%rbp), %edx
movl -0x5c8(%rbp), %ecx
movl -0x5c4(%rbp), %r8d
movl -0x5c0(%rbp), %r9d
movl %eax, %esi
movl -0x5bc(%rbp), %eax
orl %esi, %r14d
movq %rsp, %rsi
movl %r14d, 0x18(%rsi)
movl %ebx, 0x10(%rsi)
movl %r11d, 0x8(%rsi)
movl %r10d, (%rsi)
leaq -0x560(%rbp), %rsi
callq 0x13d70
jmp 0x12a5e
leaq -0x560(%rbp), %rdi
callq 0x42f0
leaq -0x561(%rbp), %rdi
callq 0x4520
jmp 0x12aac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x12a9e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x560(%rbp), %rdi
callq 0x42f0
leaq -0x561(%rbp), %rdi
callq 0x4520
jmp 0x12abf
movq -0x578(%rbp), %rax
addq $0x600, %rsp            # imm = 0x600
popq %rbx
popq %r14
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x47f0
nopl (%rax,%rax)