// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
xorl %ebp, %ebp
movb %bpl, 0xa8(%rdi)
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x267c0
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb %bpl, (%r12)
movq 0x8(%r14), %r14
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
callq 0x28650
testq %r14, %r14
je 0x47374
xorl %r13d, %r13d
movq 0x8(%rsp), %rax
movsbl (%rax,%r13), %edi
callq 0x28340
movq 0x68(%rsp), %rcx
movb %al, (%rcx,%r13)
incq %r13
cmpq %r13, %r14
jne 0x47354
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x47383
callq 0x27560
movq 0x2648e(%rip), %rsi     # 0x6d818
movq 0x2648f(%rip), %rcx     # 0x6d820
leaq 0x8(%rsp), %rdi
xorl %edx, %edx
callq 0x28af0
cmpq $-0x1, %rax
je 0x47467
leaq 0x8(%rsp), %rdi
movl $0x7, %edx
movl $0x2f, %esi
callq 0x27ef0
movq %rax, %r14
leaq -0x7(%rax), %rcx
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movl $0x7, %edx
callq 0x277f0
leaq 0x48(%rsp), %rdi
movl $0x3a, %esi
xorl %edx, %edx
callq 0x27ef0
cmpq $-0x1, %rax
jne 0x4740b
leaq 0x38(%rbx), %rdi
leaq 0x48(%rsp), %rsi
callq 0x26b80
leaq 0x58(%rbx), %rdi
leaq 0x263f2(%rip), %rsi     # 0x6d7f8
callq 0x26b80
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movq %r14, %rdx
movq $-0x1, %rcx
callq 0x277f0
cmpq $0x0, 0x30(%rsp)
je 0x47441
leaq 0x78(%rbx), %rdi
leaq 0x28(%rsp), %rsi
callq 0x26b80
movb $0x1, 0xa8(%rbx)
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x47454
callq 0x27560
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x47467
callq 0x27560
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x47476
callq 0x27560
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x474bd
callq 0x27560
jmp 0x474bd
jmp 0x474ba
jmp 0x474a6
jmp 0x474a6
movq %rax, %rbx
jmp 0x474d0
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
jne 0x474cb
jmp 0x474d0
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x474d0
callq 0x27560
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x474df
callq 0x27560
movq %rbx, %rdi
callq 0x28c10
nop