// File: /workspace/github_cpp_makefile_star2_O2/theuni[P]libbtcnet/src/connection.cpp
// Function: CConnectionBase::ToString[abi:cxx11]() const
std::string CConnectionBase::ToString() const
{
    if (isDns || isOnion)
        return host + ":" + std::to_string(port);
    std::string ret;
    if (!addr.empty()) {
        std::array<char, NI_MAXHOST> hostbuf{};
        std::array<char, NI_MAXSERV> servbuf{};
        sockaddr_storage addr_stor;
        memset(&addr_stor, 0, sizeof(addr_stor));
        memcpy(&addr_stor, addr.data(), addr.size());
        if (getnameinfo(reinterpret_cast<sockaddr*>(&addr_stor), addr.size(), hostbuf.data(), hostbuf.size(), servbuf.data(), servbuf.size(), NI_NUMERICHOST | NI_NUMERICSERV) == 0) {
            if (addr_stor.ss_family == AF_INET6) {
                size_t len = strlen(hostbuf.data()) + strlen(servbuf.data()) + 3;
                ret.reserve(len);
                ret.push_back('[');
                ret.append(hostbuf.data());
                ret.append("]:");
                ret.append(servbuf.data());
            } else if (addr_stor.ss_family == AF_INET) {
                size_t len = strlen(hostbuf.data()) + strlen(servbuf.data()) + 1;
                ret.reserve(len);
                ret.assign(hostbuf.data());
                ret.push_back(':');
                ret.append(servbuf.data());
            } else
                ret.assign(hostbuf.data());
        }
    }
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4b8, %rsp            # imm = 0x4B8
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x0, 0x22(%rsi)
jne 0x5f3a
cmpb $0x1, 0x23(%r14)
jne 0x5fa1
leaq 0xa237(%rip), %rdx      # 0x10178
leaq 0xb0(%rsp), %rdi
movq %r14, %rsi
callq 0x66c9
movzwl 0x20(%r14), %esi
leaq 0x30(%rsp), %rdi
callq 0x6701
leaq 0xb0(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %rbx, %rdi
callq 0x6662
leaq 0x30(%rsp), %rdi
callq 0x41a0
leaq 0xb0(%rsp), %rdi
callq 0x41a0
movq %rbx, %rax
addq $0x4b8, %rsp            # imm = 0x4B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq 0x28(%r14), %r12
movq 0x30(%r14), %r14
cmpq %r14, %r12
je 0x5f8c
leaq 0xb0(%rsp), %r15
movl $0x401, %edx            # imm = 0x401
movq %r15, %rdi
xorl %esi, %esi
callq 0x41e0
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r13
movaps %xmm0, 0x10(%r13)
movaps %xmm0, (%r13)
leaq 0x30(%rsp), %rbp
movaps %xmm0, 0x70(%rbp)
movaps %xmm0, 0x60(%rbp)
movaps %xmm0, 0x50(%rbp)
movaps %xmm0, 0x40(%rbp)
movaps %xmm0, 0x30(%rbp)
movaps %xmm0, 0x20(%rbp)
movaps %xmm0, 0x10(%rbp)
movaps %xmm0, (%rbp)
subq %r12, %r14
movq %rbp, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x42e0
movl $0x3, (%rsp)
pushq $0x20
popq %r9
movq %rbp, %rdi
movl %r14d, %esi
movq %r15, %rdx
movl $0x401, %ecx            # imm = 0x401
movq %r13, %r8
callq 0x4240
testl %eax, %eax
jne 0x5f8c
movzwl 0x30(%rsp), %eax
cmpl $0x2, %eax
je 0x60bf
cmpl $0xa, %eax
jne 0x6115
leaq 0xb0(%rsp), %rdi
callq 0x4180
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x4180
leaq (%r14,%rax), %rsi
addq $0x3, %rsi
movq %rbx, %rdi
callq 0x4590
pushq $0x5b
popq %rsi
movq %rbx, %rdi
callq 0x42f0
leaq 0xb0(%rsp), %rsi
movq %rbx, %rdi
callq 0x46e0
leaq 0xa0d2(%rip), %rsi      # 0x10177
movq %rbx, %rdi
callq 0x46e0
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x46e0
jmp 0x5f8c
leaq 0xb0(%rsp), %rdi
callq 0x4180
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x4180
leaq (%r14,%rax), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x4590
leaq 0xb0(%rsp), %rsi
movq %rbx, %rdi
callq 0x46f0
pushq $0x3a
popq %rsi
movq %rbx, %rdi
callq 0x42f0
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x46e0
jmp 0x5f8c
leaq 0xb0(%rsp), %rsi
movq %rbx, %rdi
callq 0x46f0
jmp 0x5f8c
jmp 0x612e
jmp 0x612e
movq %rax, %r14
movq %rbx, %rdi
jmp 0x6150
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x41a0
jmp 0x6148
movq %rax, %r14
leaq 0xb0(%rsp), %rdi
callq 0x41a0
movq %r14, %rdi
callq 0x4660
nop