// File: zeeev[P]DASVC/bamtools/src/api/internal/io/HostAddress_p.cpp
// Function: BamTools::Internal::HostAddress::GetIPString[abi:cxx11]() const
std::string HostAddress::GetIPString(void) const {

    stringstream ss("");

    // IPv4 format
    if ( m_protocol == HostAddress::IPv4Protocol ) {
        ss << ( (m_ip4Address>>24) & 0xff ) << '.'
           << ( (m_ip4Address>>16) & 0xff ) << '.'
           << ( (m_ip4Address>> 8) & 0xff ) << '.'
           << (  m_ip4Address      & 0xff );

    }

    // IPv6 format
    else if ( m_protocol == HostAddress::IPv6Protocol ) {
        for ( uint8_t i = 0; i < 8; ++i ) {
            if ( i != 0 )
                ss << ':';
                ss << hex << ( (uint16_t(m_ip6Address[2*i]) << 8) |
                               (uint16_t(m_ip6Address[2*i+1]))
                             );
        }
    }

    // return result (empty string if unknown protocol)
    return ss.str();
}

// Assembly:
subq $0x238, %rsp            # imm = 0x238
movq %rdi, 0x48(%rsp)
movq %rdi, %rax
movq %rax, 0x50(%rsp)
movq %rdi, 0x230(%rsp)
movq %rsi, 0x228(%rsp)
movq 0x228(%rsp), %rax
movq %rax, 0x58(%rsp)
leaq 0x7f(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0x7b5f0
movq 0x60(%rsp), %rdx
leaq 0x17ed0(%rip), %rsi     # 0xeb0dc
leaq 0x80(%rsp), %rdi
callq 0x78e70
jmp 0xd321b
movl $0x10, %edi
movl $0x8, %esi
callq 0x7b8d0
movl %eax, 0x44(%rsp)
jmp 0xd3230
movl 0x44(%rsp), %edx
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x7a4b0
jmp 0xd324b
leaq 0x80(%rsp), %rdi
callq 0x7cce8
jmp 0xd325a
leaq 0x7f(%rsp), %rdi
callq 0x76f80
movq 0x58(%rsp), %rax
cmpl $0x0, (%rax)
jne 0xd337d
movq 0x58(%rsp), %rax
leaq 0xb0(%rsp), %rdi
movzbl 0x7(%rax), %esi
callq 0x78b20
movq %rax, 0x38(%rsp)
jmp 0xd328f
movq 0x38(%rsp), %rdi
movl $0x2e, %esi
callq 0x779c0
movq %rax, 0x30(%rsp)
jmp 0xd32a5
movq 0x30(%rsp), %rdi
movq 0x58(%rsp), %rax
movzbl 0x6(%rax), %esi
callq 0x78b20
movq %rax, 0x28(%rsp)
jmp 0xd32bf
movq 0x28(%rsp), %rdi
movl $0x2e, %esi
callq 0x779c0
movq %rax, 0x20(%rsp)
jmp 0xd32d5
movq 0x20(%rsp), %rdi
movq 0x58(%rsp), %rax
movzbl 0x5(%rax), %esi
callq 0x78b20
movq %rax, 0x18(%rsp)
jmp 0xd32ef
movq 0x18(%rsp), %rdi
movl $0x2e, %esi
callq 0x779c0
movq %rax, 0x10(%rsp)
jmp 0xd3305
movq 0x10(%rsp), %rdi
movq 0x58(%rsp), %rax
movzbl 0x4(%rax), %esi
callq 0x78b20
jmp 0xd331a
jmp 0xd3451
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
jmp 0xd334e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x7cce8
jmp 0xd334c
jmp 0xd334e
leaq 0x7f(%rsp), %rdi
callq 0x76f80
jmp 0xd3481
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x74f60
jmp 0xd347f
movq 0x58(%rsp), %rax
cmpl $0x1, (%rax)
jne 0xd344f
movb $0x0, 0x6b(%rsp)
movzbl 0x6b(%rsp), %eax
cmpl $0x8, %eax
jge 0xd344d
movzbl 0x6b(%rsp), %eax
cmpl $0x0, %eax
je 0xd33be
leaq 0xb0(%rsp), %rdi
movl $0x3a, %esi
callq 0x779c0
jmp 0xd33bc
jmp 0xd33be
leaq 0xb0(%rsp), %rdi
movq 0x3ec13(%rip), %rsi     # 0x111fe0
callq 0x72aa0
movq %rax, 0x8(%rsp)
jmp 0xd33d9
movq 0x58(%rsp), %rdi
addq $0x8, %rdi
movzbl 0x6b(%rsp), %eax
addl %eax, %eax
movl %eax, %esi
callq 0x7a970
movb %al, 0x7(%rsp)
jmp 0xd33f6
movq 0x58(%rsp), %rdi
movb 0x7(%rsp), %al
movzbl %al, %eax
shll $0x8, %eax
movl %eax, (%rsp)
addq $0x8, %rdi
movzbl 0x6b(%rsp), %ecx
movl %ecx, %eax
leal 0x1(%rax,%rax), %eax
movl %eax, %esi
callq 0x7a970
movb %al, 0x6(%rsp)
jmp 0xd3424
movq 0x8(%rsp), %rdi
movl (%rsp), %esi
movb 0x6(%rsp), %al
movzbl %al, %eax
orl %eax, %esi
callq 0x7b150
jmp 0xd343c
jmp 0xd343e
movb 0x6b(%rsp), %al
addb $0x1, %al
movb %al, 0x6b(%rsp)
jmp 0xd3390
jmp 0xd344f
jmp 0xd3451
movq 0x48(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x76880
jmp 0xd3465
leaq 0xa0(%rsp), %rdi
callq 0x74f60
movq 0x50(%rsp), %rax
addq $0x238, %rsp            # imm = 0x238
retq
jmp 0xd3481
movq 0x70(%rsp), %rdi
callq 0x7b550
movq %rax, %rdi
callq 0x88ef0
nopw %cs:(%rax,%rax)