// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/HostAddress_p.cpp
// Function: BamTools::Internal::HostAddress::ParseAddress()
bool HostAddress::ParseAddress(void) {

    // all IPv6 addresses should have a ':'
    string s = m_ipString;
    size_t found = s.find(':');
    if ( found != string::npos ) {
        // try parse IP6 address
        uint8_t maybeIp6[16];
        if ( ParseIp6(s, maybeIp6) ) {
            SetAddress(maybeIp6);
            m_protocol = HostAddress::IPv6Protocol;
            return true;
        }
    }

    // all IPv4 addresses should have a '.'
    found = s.find('.');
    if ( found != string::npos ) {
        uint32_t maybeIp4(0);
        if ( ParseIp4(s, maybeIp4) ) {
            SetAddress(maybeIp4);
            m_protocol = HostAddress::IPv4Protocol;
            return true;
        }
    }

    // else likely just a plain-text host name "www.foo.bar"
    // will need to look up IP address info later
    m_protocol = HostAddress::UnknownNetworkProtocol;
    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rbx
leaq 0x18(%rdi), %rsi
leaq 0x88(%rsp), %r14
movq %r14, %rdi
callq 0x33ff0
pushq $0x3a
popq %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x33d30
cmpq $-0x1, %rax
je 0x52349
movq %rbx, 0x28(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x33ff0
leaq 0x30(%rsp), %rdi
pushq $0x25
popq %rsi
pushq $-0x1
popq %rdx
callq 0x35710
cmpq $-0x1, %rax
je 0x52283
leaq 0x68(%rsp), %rdi
leaq 0x30(%rsp), %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x332a0
leaq 0x30(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x32060
leaq 0x68(%rsp), %rdi
callq 0x33a00
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %rsi
pushq $0x3a
popq %rdx
callq 0x5261f
movl 0x58(%rsp), %eax
subl 0x50(%rsp), %eax
shrl $0x5, %eax
movzbl %al, %r14d
leal -0x9(%r14), %eax
cmpl $-0x6, %eax
jb 0x5230e
leaq 0xaca9(%rip), %rsi      # 0x5cf5d
leaq 0x68(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x31b30
xorl %eax, %eax
leaq 0x30(%rsp), %r15
leaq 0x68(%rsp), %r12
xorl %r13d, %r13d
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x35770
cmpq $-0x1, %rax
je 0x522ee
incb %r13b
incq %rax
jmp 0x522d2
leaq 0x68(%rsp), %rdi
callq 0x33a00
cmpl $0x8, %r14d
sete %al
cmpb $0x2, %r13b
setae %cl
testb %cl, %al
je 0x523b2
xorl %r12d, %r12d
leaq 0x50(%rsp), %rdi
callq 0x32810
leaq 0x30(%rsp), %rdi
callq 0x33a00
testb %r12b, %r12b
je 0x52344
leaq 0x10(%rsp), %rsi
movq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0x33460
movl $0x1, (%rbx)
jmp 0x52388
movq 0x28(%rsp), %rbx
leaq 0x88(%rsp), %rdi
pushq $0x2e
popq %rsi
xorl %edx, %edx
callq 0x33d30
cmpq $-0x1, %rax
je 0x5238c
leaq 0x30(%rsp), %rsi
andl $0x0, (%rsi)
leaq 0x88(%rsp), %rdi
callq 0x52559
testb %al, %al
je 0x5238c
movl 0x30(%rsp), %eax
movl %eax, 0x4(%rbx)
movb $0x1, 0x38(%rbx)
andl $0x0, (%rbx)
movb $0x1, %bl
jmp 0x52391
orl $-0x1, (%rbx)
xorl %ebx, %ebx
leaq 0x88(%rsp), %rdi
callq 0x33a00
movl %ebx, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x30(%rsp), %rdi
pushq $0x2e
popq %rsi
xorl %edx, %edx
callq 0x33d30
cmpb $0x1, %r13b
je 0x523dc
xorl %ecx, %ecx
cmpq $-0x1, %rax
sete %cl
addl $0x7, %ecx
cmpl %ecx, %r14d
jb 0x5230e
pushq $0x9
popq %r13
subl %r14d, %r13d
leal -0x1(%r14), %eax
addl $-0x2, %r14d
pushq $0x10
popq %r15
movl %eax, 0xc(%rsp)
movl %eax, %ebp
movl %ebp, %r12d
shrb $0x7, %r12b
testb %bpl, %bpl
js 0x52311
testq %r15, %r15
je 0x52311
movsbl %bpl, %ebx
movslq %ebx, %rsi
leaq 0x50(%rsp), %rdi
callq 0x31850
movq %rax, %r12
cmpq $0x0, 0x8(%rax)
je 0x52476
movq (%r12), %rdi
xorl %esi, %esi
pushq $0x10
popq %rdx
callq 0x31930
movq %rax, %rcx
shrq $0x10, %rcx
testw %cx, %cx
je 0x5248b
cmpl %ebx, 0xc(%rsp)
jne 0x5230e
movq %r12, %rdi
leaq 0x68(%rsp), %rsi
callq 0x52559
testb %al, %al
je 0x5230e
movl 0x68(%rsp), %eax
bswapl %eax
movl %eax, 0xc(%rsp,%r15)
addq $-0x4, %r15
decq %r13
jmp 0x524e1
cmpl %ebx, 0xc(%rsp)
jne 0x52497
leaq 0x50(%rsp), %rdi
movq %r14, %rsi
callq 0x31850
jmp 0x524cb
rolw $0x8, %ax
movw %ax, 0xe(%rsp,%r15)
jmp 0x524dd
testb %bpl, %bpl
je 0x524be
xorl %eax, %eax
movzbl %al, %ecx
cmpq %rcx, %r13
jbe 0x524e1
testq %r15, %r15
je 0x5230e
andw $0x0, 0xe(%rsp,%r15)
addq $-0x2, %r15
incb %al
jmp 0x5249e
leaq 0x50(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x31850
cmpq $0x0, 0x8(%rax)
je 0x5230e
andw $0x0, 0xe(%rsp,%r15)
addq $-0x2, %r15
decb %bpl
jmp 0x523f5
jmp 0x52508
jmp 0x52508
jmp 0x52508
jmp 0x52508
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x33a00
jmp 0x52530
jmp 0x52514
jmp 0x52508
jmp 0x5250d
jmp 0x5250d
movq %rax, %rbx
jmp 0x52526
movq %rax, %rbx
jmp 0x52530
jmp 0x52514
movq %rax, %rbx
jmp 0x5253a
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x33a00
leaq 0x50(%rsp), %rdi
callq 0x32810
leaq 0x30(%rsp), %rdi
callq 0x33a00
leaq 0x88(%rsp), %rdi
callq 0x33a00
movq %rbx, %rdi
callq 0x34ed0
jmp 0x52551
movq %rax, %rdi
callq 0x39b2f