// File: zeeev[P]DASVC/bamtools/src/api/internal/io/BamHttp_p.cpp
// Function: BamTools::Internal::BamHttp::ParseUrl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void BamHttp::ParseUrl(const string& url) {

    // clear flag to start
    m_isUrlParsed = false;

    // make sure url starts with "http://", case-insensitive
    string tempUrl(url);
    toLower(tempUrl);
    const size_t prefixFound = tempUrl.find(HTTP_PREFIX);
    if ( prefixFound == string::npos )
        return;

    // find end of host name portion (first '/' hit after the prefix)
    const size_t firstSlashFound = tempUrl.find(HOST_SEPARATOR, HTTP_PREFIX_LENGTH);
    if ( firstSlashFound == string::npos ) {
        ;  // no slash found... no filename given along with host?
    }

    // fetch hostname (check for proxy port)
    string hostname = tempUrl.substr(HTTP_PREFIX_LENGTH, (firstSlashFound - HTTP_PREFIX_LENGTH));
    const size_t colonFound = hostname.find(PROXY_SEPARATOR);
    if ( colonFound != string::npos ) {
        ; // TODO: handle proxy port (later, just skip for now)
    } else {
        m_hostname = hostname;
        m_port = HTTP_PORT;
    }

    // store remainder of URL as filename (must be non-empty)
    string filename = tempUrl.substr(firstSlashFound);
    if ( filename.empty() )
        return;
    m_filename = filename;

    // set parsed OK flag
    m_isUrlParsed = true;
}

// Assembly:
subq $0xf8, %rsp
movq %rdi, 0xf0(%rsp)
movq %rsi, 0xe8(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x28(%rsp)
movb $0x0, 0xa8(%rax)
movq 0xe8(%rsp), %rsi
leaq 0xc8(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x73370
movq 0x30(%rsp), %rsi
leaq 0xa8(%rsp), %rdi
callq 0xcaa80
jmp 0xc9a79
leaq 0xa8(%rsp), %rdi
callq 0x7cce8
jmp 0xc9a88
leaq 0x4f2c9(%rip), %rsi     # 0x118d58
xorl %eax, %eax
movl %eax, %edx
leaq 0xc8(%rsp), %rdi
callq 0x7cb90
movq %rax, 0x20(%rsp)
jmp 0xc9aa7
movq 0x20(%rsp), %rax
movq %rax, 0x90(%rsp)
cmpq $-0x1, 0x90(%rsp)
jne 0xc9ae8
movl $0x1, 0x8c(%rsp)
jmp 0xc9c6a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa0(%rsp)
movl %eax, 0x9c(%rsp)
jmp 0xc9c8f
leaq 0xc8(%rsp), %rdi
movl $0x2f, %esi
movl $0x7, %edx
callq 0x787f0
movq %rax, 0x18(%rsp)
jmp 0xc9b06
movq 0x18(%rsp), %rax
movq %rax, 0x80(%rsp)
cmpq $-0x1, 0x80(%rsp)
jne 0xc9b20
jmp 0xc9b20
movq 0x80(%rsp), %rcx
addq $-0x7, %rcx
leaq 0x60(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
movl $0x7, %edx
callq 0x76c50
jmp 0xc9b45
xorl %eax, %eax
movl %eax, %edx
leaq 0x60(%rsp), %rdi
movl $0x3a, %esi
callq 0x787f0
movq %rax, 0x10(%rsp)
jmp 0xc9b5f
movq 0x10(%rsp), %rax
movq %rax, 0x58(%rsp)
cmpq $-0x1, 0x58(%rsp)
je 0xc9b8c
jmp 0xc9bba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa0(%rsp)
movl %eax, 0x9c(%rsp)
jmp 0xc9c81
movq 0x28(%rsp), %rdi
addq $0x38, %rdi
leaq 0x60(%rsp), %rsi
callq 0x71240
jmp 0xc9ba1
movq 0x28(%rsp), %rdi
addq $0x58, %rdi
leaq 0x4f187(%rip), %rsi     # 0x118d38
callq 0x71240
jmp 0xc9bb8
jmp 0xc9bba
movq 0x80(%rsp), %rdx
leaq 0x38(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
movq $-0x1, %rcx
callq 0x76c50
jmp 0xc9bdd
leaq 0x38(%rsp), %rdi
callq 0x7aba0
movb %al, 0xf(%rsp)
jmp 0xc9bed
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0xc9bf7
jmp 0xc9c24
movl $0x1, 0x8c(%rsp)
jmp 0xc9c50
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa0(%rsp)
movl %eax, 0x9c(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x7cce8
jmp 0xc9c7f
movq 0x28(%rsp), %rdi
addq $0x78, %rdi
leaq 0x38(%rsp), %rsi
callq 0x71240
jmp 0xc9c39
movq 0x28(%rsp), %rax
movb $0x1, 0xa8(%rax)
movl $0x0, 0x8c(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x7cce8
jmp 0xc9c5c
leaq 0x60(%rsp), %rdi
callq 0x7cce8
jmp 0xc9c68
jmp 0xc9c6a
leaq 0xc8(%rsp), %rdi
callq 0x7cce8
addq $0xf8, %rsp
retq
jmp 0xc9c81
leaq 0x60(%rsp), %rdi
callq 0x7cce8
jmp 0xc9c8d
jmp 0xc9c8f
leaq 0xc8(%rsp), %rdi
callq 0x7cce8
jmp 0xc9c9e
jmp 0xc9ca0
movq 0xa0(%rsp), %rdi
callq 0x7b550
movq %rax, %rdi
callq 0x88ef0
nopw %cs:(%rax,%rax)