// File: /workspace/github_cpp_makefile_star2_O1/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 0x63fe
cmpb $0x1, 0x23(%r14)
jne 0x64f9
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 0x72f4
leaq 0xbd7c(%rip), %rsi      # 0x121a8
movq %r15, %rdi
callq 0x46c0
movzwl 0x20(%r14), %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x646e
movl $0x2, %r14d
cmpw $0x64, %bp
jb 0x646e
movl $0x3, %r14d
cmpl $0x3e8, %ebp            # imm = 0x3E8
jb 0x646e
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 0x7286
movq 0xb0(%rsp), %rcx
movq 0xb8(%rsp), %r8
movq 0x38(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r12, %rcx
je 0x64c3
movq 0xc0(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x64e2
movl $0xf, %esi
cmpq %r15, 0x30(%rsp)
je 0x64d9
movq 0x40(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x6628
movq 0x30(%rsp), %rsi
leaq 0xb0(%rsp), %rdi
callq 0x40f0
jmp 0x6636
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 0x6698
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 0x6698
movzwl 0x30(%rsp), %eax
cmpl $0x2, %eax
je 0x66ad
cmpl $0xa, %eax
jne 0x6702
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 0xbb96(%rip), %rsi      # 0x121a7
movq %rbx, %rdi
callq 0x46c0
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x46c0
jmp 0x6698
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 0x6655
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x665b
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 0x6686
callq 0x4340
movq 0xb0(%rsp), %rdi
cmpq %r12, %rdi
je 0x6698
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 0x6698
leaq 0xb0(%rsp), %rsi
movq %rbx, %rdi
callq 0x46d0
jmp 0x6698
jmp 0x6718
jmp 0x6718
movq %rax, %r14
movq (%rbx), %rdi
cmpq 0x8(%rsp), %rdi
jne 0x674d
jmp 0x6752
movq %rax, %r14
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x6740
callq 0x4340
jmp 0x6740
jmp 0x673d
movq %rax, %r14
movq 0xb0(%rsp), %rdi
cmpq %r12, %rdi
je 0x6752
callq 0x4340
movq %r14, %rdi
callq 0x4640