// File: /workspace/github_cpp_makefile_star2_O3/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/suffix_string.cpp
// Function: hdiff_private::TSuffixString::lower_bound(unsigned char const*, unsigned char const*) const
TInt TSuffixString::lower_bound(const TChar* str,const TChar* str_end)const{
    //not use any cached range table
    //return m_lower_bound(m_cached_SA_begin,m_cached_SA_end,
    //                     str,str_end,m_src_begin,m_src_end,m_cached_SA_begin,0);
#if (_SSTRING_FAST_MATCH>0)
    if (m_isUsedFastMatch&&(!m_fastMatch.isHit(TFastMatchForSString::getHash(str))))
        return -1;
    #define kMinStrLen _SSTRING_FAST_MATCH
#else
    //assert(str_end-str>=2);
    #define kMinStrLen 2
#endif
    if ((kMinStrLen>=2)&(m_cached2char_range!=0)){
        size_t cc=((size_t)str[1]) | (((size_t)str[0])<<8);
        size_t r0,r1;
        if (isUseLargeSA()){
            r0=((TInt*)m_cached2char_range)[cc]*sizeof(TInt);
            r1=((TInt*)m_cached2char_range)[cc+1]*sizeof(TInt);
        }else{
            r0=((TInt32*)m_cached2char_range)[cc]*sizeof(TInt32);
            r1=((TInt32*)m_cached2char_range)[cc+1]*sizeof(TInt32);
        }
        return m_lower_bound((TChar*)m_cached_SA_begin+r0,(TChar*)m_cached_SA_begin+r1,
                             str,str_end,m_src_begin,m_src_end,m_cached_SA_begin,2);
    }else if (kMinStrLen>0){
        size_t c=str[0];
        return m_lower_bound(m_cached1char_range[c],m_cached1char_range[c+1],
                             str,str_end,m_src_begin,m_src_end,m_cached_SA_begin,1);
    }else{
        return -1;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
cmpb $0x1, 0x40(%rdi)
jne 0x1c584
movl $0x5, %edx
movl $0x1, %edi
movq %r15, %rsi
callq 0x264cf
movl %eax, %r8d
shrl $0x10, %r8d
xorl %eax, %r8d
movq 0x48(%rbx), %rsi
movq 0x58(%rbx), %rdi
movl %edi, %ecx
andl %r8d, %ecx
movl %ecx, %edx
shrl $0x5, %edx
movl (%rsi,%rdx,4), %edx
btl %ecx, %edx
jae 0x1c5c1
movl %eax, %ecx
shll $0x9, %ecx
subl %eax, %ecx
movq %rcx, %rax
xorl %edx, %edx
divq %rdi
movl %edx, %eax
shrl $0x5, %eax
movl (%rsi,%rax,4), %eax
btl %edx, %eax
jae 0x1c5c1
xorq $0x3d, %r8
leaq (%r8,%r8,8), %rax
movq %rax, %rcx
shrq $0x4, %rcx
xorq %rax, %rcx
imulq $0x27d4eb2d, %rcx, %rcx # imm = 0x27D4EB2D
movq %rcx, %rax
shrq $0xf, %rax
xorq %rcx, %rax
decq %rdi
xorl %edx, %edx
divq %rdi
movq %rdx, %rax
shrq $0x5, %rax
movl (%rsi,%rax,4), %eax
btl %edx, %eax
jae 0x1c5c1
movq 0x878(%rbx), %rax
testq %rax, %rax
je 0x1c5ca
movzwl (%r15), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
movq (%rbx), %r8
movq 0x8(%rbx), %r9
movq %r9, %rdx
subq %r8, %rdx
shrq $0x1f, %rdx
je 0x1c5ec
movq (%rax,%rcx,8), %rdi
movq 0x8(%rax,%rcx,8), %rsi
shlq $0x3, %rdi
shlq $0x3, %rsi
jmp 0x1c5fd
movq $-0x1, %rax
jmp 0x1c61a
movzbl (%r15), %eax
movq 0x70(%rbx,%rax,8), %rdi
movq 0x78(%rbx,%rax,8), %rsi
movq (%rbx), %r8
movq 0x8(%rbx), %r9
movq %r15, %rdx
movq %r14, %rcx
pushq $0x1
pushq 0x60(%rbx)
jmp 0x1c610
movslq (%rax,%rcx,4), %rdi
shlq $0x2, %rdi
movslq 0x4(%rax,%rcx,4), %rsi
shlq $0x2, %rsi
movq 0x60(%rbx), %rax
addq %rax, %rdi
addq %rax, %rsi
movq %r15, %rdx
movq %r14, %rcx
pushq $0x2
pushq %rax
callq *0x880(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq