// File: /workspace/github_cpp_makefile_star2_O1/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 0x28660
testq %r14, %r14
je 0x473d4
xorl %r13d, %r13d
movq 0x8(%rsp), %rax
movsbl (%rax,%r13), %edi
callq 0x28350
movq 0x68(%rsp), %rcx
movb %al, (%rcx,%r13)
incq %r13
cmpq %r13, %r14
jne 0x473b4
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x473e3
callq 0x27560
movq 0x26436(%rip), %rsi     # 0x6d820
movq 0x26437(%rip), %rcx     # 0x6d828
leaq 0x8(%rsp), %rdi
xorl %edx, %edx
callq 0x28b00
cmpq $-0x1, %rax
je 0x474c7
leaq 0x8(%rsp), %rdi
movl $0x7, %edx
movl $0x2f, %esi
callq 0x27f00
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 0x27f00
cmpq $-0x1, %rax
jne 0x4746b
leaq 0x38(%rbx), %rdi
leaq 0x48(%rsp), %rsi
callq 0x26b80
leaq 0x58(%rbx), %rdi
leaq 0x2639a(%rip), %rsi     # 0x6d800
callq 0x26b80
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movq %r14, %rdx
movq $-0x1, %rcx
callq 0x277f0
cmpq $0x0, 0x30(%rsp)
je 0x474a1
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 0x474b4
callq 0x27560
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x474c7
callq 0x27560
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x474d6
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 0x4751d
callq 0x27560
jmp 0x4751d
jmp 0x4751a
jmp 0x47506
jmp 0x47506
movq %rax, %rbx
jmp 0x47530
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
jne 0x4752b
jmp 0x47530
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x47530
callq 0x27560
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x4753f
callq 0x27560
movq %rbx, %rdi
callq 0x28c20
nop