// File: /workspace/github_cpp_makefile_star2_O3/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 0x63ca
cmpb $0x1, 0x23(%r14)
jne 0x64c3
leaq 0xc0(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0xb0(%rsp), %r15
movq %r15, %rdi
callq 0x7282
leaq 0xbdb0(%rip), %rsi      # 0x121a8
movq %r15, %rdi
callq 0x46c0
movzwl 0x20(%r14), %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x643a
movl $0x2, %r14d
cmpw $0x64, %bp
jb 0x643a
movl $0x3, %r14d
cmpl $0x3e8, %ebp            # imm = 0x3E8
jb 0x643a
cmpl $0x2710, %ebp           # imm = 0x2710
movl $0x5, %r14d
sbbl $0x0, %r14d
movl %r14d, %esi
leaq 0x40(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x30(%rsp), %rdi
movl $0x2d, %edx
callq 0x4420
movq 0x30(%rsp), %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x7214
movq 0xb0(%rsp), %rcx
movq 0xb8(%rsp), %r8
movq 0x38(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r12, %rcx
je 0x648f
movq 0xc0(%rsp), %rdi
movq 0x30(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x64b1
movl $0xf, %edi
cmpq %r15, %rsi
je 0x64a8
movq 0x40(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x65f2
leaq 0xb0(%rsp), %rdi
callq 0x40f0
jmp 0x6600
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq 0x28(%r14), %r12
movq 0x30(%r14), %r14
cmpq %r14, %r12
je 0x6662
movq %rax, 0x8(%rsp)
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 0x42d0
movl $0x3, (%rsp)
movq %rbp, %rdi
movl %r14d, %esi
movq %r15, %rdx
movl $0x401, %ecx            # imm = 0x401
movq %r13, %r8
movl $0x20, %r9d
callq 0x4240
testl %eax, %eax
jne 0x6662
movzwl 0x30(%rsp), %eax
cmpl $0x2, %eax
je 0x6677
cmpl $0xa, %eax
jne 0x66cc
leaq 0xb0(%rsp), %rdi
callq 0x4190
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x4190
leaq (%r14,%rax), %rsi
addq $0x3, %rsi
movq %rbx, %rdi
callq 0x4580
movq %rbx, %rdi
movl $0x5b, %esi
callq 0x42e0
leaq 0xb0(%rsp), %rsi
movq %rbx, %rdi
callq 0x46c0
leaq 0xbbcc(%rip), %rsi      # 0x121a7
movq %rbx, %rdi
callq 0x46c0
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x46c0
jmp 0x6662
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x43f0
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x661f
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x6625
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x6650
callq 0x4340
movq 0xb0(%rsp), %rdi
cmpq %r12, %rdi
je 0x6662
callq 0x4340
movq %rbx, %rax
addq $0x4b8, %rsp            # imm = 0x4B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb0(%rsp), %rdi
callq 0x4190
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x4190
leaq (%r14,%rax), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x4580
leaq 0xb0(%rsp), %rsi
movq %rbx, %rdi
callq 0x46d0
movq %rbx, %rdi
movl $0x3a, %esi
callq 0x42e0
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x46c0
jmp 0x6662
leaq 0xb0(%rsp), %rsi
movq %rbx, %rdi
callq 0x46d0
jmp 0x6662
jmp 0x66e2
jmp 0x66e2
movq %rax, %r14
movq (%rbx), %rdi
cmpq 0x8(%rsp), %rdi
jne 0x6717
jmp 0x671c
movq %rax, %r14
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x670a
callq 0x4340
jmp 0x670a
jmp 0x6707
movq %rax, %r14
movq 0xb0(%rsp), %rdi
cmpq %r12, %rdi
je 0x671c
callq 0x4340
movq %r14, %rdi
callq 0x4640