// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/suffix_string.cpp
// Function: hdiff_private::TSuffixString::build_cache(unsigned long)
void TSuffixString::build_cache(size_t threadNum){
    clear_cache();
#if (_SSTRING_FAST_MATCH>0)
    if (m_isUsedFastMatch) m_fastMatch.buildMatchCache(m_src_begin,m_src_end,threadNum);
#endif
    const size_t kUsedCacheMinSASize =2*(1<<20); //当字符串较大时再启用大缓存表.
    if (SASize()>kUsedCacheMinSASize){
        m_cached2char_range=new TChar[(256*256+1)*(isUseLargeSA()?sizeof(size_t):sizeof(TInt32))];
    }
    
    if (isUseLargeSA()){
        m_lower_bound=(t_lower_bound_func)_lower_bound_TInt;
        if (m_SA_large.empty()) return;
        m_cached_SA_begin=&m_SA_large[0];
        m_cached_SA_end=&m_SA_large[0]+m_SA_large.size();
        _build_range256((TInt*)m_cached_SA_begin,(TInt*)m_cached_SA_end,
                        m_src_begin,m_src_end,(const TInt**)&m_cached1char_range[0]);
        if (m_cached2char_range){
            _build_range((TInt*)m_cached_SA_begin,(TInt*)m_cached_SA_end,
                         m_src_begin,m_src_end,(TInt*)m_cached2char_range);
        }
    }else{
        m_lower_bound=(t_lower_bound_func)_lower_bound_TInt32;
        if (m_SA_limit.empty()) return;
        m_cached_SA_begin=&m_SA_limit[0];
        m_cached_SA_end=&m_SA_limit[0]+m_SA_limit.size();
        _build_range256((TInt32*)m_cached_SA_begin,(TInt32*)m_cached_SA_end,
                        m_src_begin,m_src_end,(const TInt32**)&m_cached1char_range[0]);
        if (m_cached2char_range){
            _build_range((TInt32*)m_cached_SA_begin,(TInt32*)m_cached_SA_end,
                         m_src_begin,m_src_end,(TInt32*)m_cached2char_range);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x1c064
movq %rbx, %rcx
cmpb $0x1, 0x40(%rbx)
movq %rbx, 0x10(%rsp)
jne 0x1c3ef
leaq 0x48(%rcx), %rdi
movq (%rcx), %rsi
movq 0x8(%rcx), %rdx
movq %r14, %rcx
callq 0x1cac8
movq 0x10(%rsp), %rcx
movq (%rcx), %r14
movq 0x8(%rcx), %r15
movq %r15, %rbx
subq %r14, %rbx
cmpq $0x200001, %rbx         # imm = 0x200001
jb 0x1c42b
cmpq $0x7fffffff, %rbx       # imm = 0x7FFFFFFF
movl $0x80008, %eax          # imm = 0x80008
movl $0x40004, %edi          # imm = 0x40004
cmovaq %rax, %rdi
callq 0x4030
movq 0x10(%rsp), %rcx
movq %rax, 0x878(%rcx)
shrq $0x1f, %rbx
je 0x1c664
leaq 0x92d(%rip), %rax       # 0x1cd69
movq %rax, 0x880(%rcx)
movq 0x28(%rcx), %rsi
movq 0x30(%rcx), %rbx
cmpq %rbx, %rsi
je 0x1c88b
movq %rsi, 0x60(%rcx)
movq %rbx, 0x68(%rcx)
xorl %edx, %edx
movq %rsi, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
xorl %eax, %eax
xorl %r9d, %r9d
movq %rbx, %r11
movq %r11, %rcx
subq %rsi, %rcx
je 0x1c4e2
sarq %rcx
andq $-0x8, %rcx
leaq (%rsi,%rcx), %r12
cmpq %rax, %r9
movq %rax, %r8
cmovbq %r9, %r8
movq (%rsi,%rcx), %rcx
addq %r14, %rcx
addq %r8, %rcx
movq %r8, %r13
xorl %ebx, %ebx
cmpq $0x1, %r13
je 0x1c4e9
cmpq %r15, %rcx
je 0x1c4ee
cmpb %dl, (%rcx)
jne 0x1c4cb
incq %r13
incq %rcx
incq %r8
xorl %ebp, %ebp
cmpq $0x2000, %r8            # imm = 0x2000
setb %bpl
leal 0x1(%rbp,%rbp,2), %ebp
cmovaeq %r12, %rdi
jmp 0x1c4d4
setb %r10b
movl $0x5, %ebp
cmpl $0x4, %ebp
je 0x1c49a
cmpl $0x5, %ebp
je 0x1c4f1
movl %ebp, %ebx
jmp 0x1c509
movl $0x3, %ebx
jmp 0x1c509
xorl %r10d, %r10d
jmp 0x1c4f1
movb $0x1, %r10b
testb $0x1, %r10b
je 0x1c503
addq $0x8, %r12
movq %r12, %rsi
movq %r8, %r9
jmp 0x1c509
movq %r8, %rax
movq %r12, %r11
testl %ebx, %ebx
je 0x1c470
cmpl $0x3, %ebx
je 0x1c519
movq %rdi, %rsi
movq 0x10(%rsp), %rax
movq %rsi, 0x70(%rax,%rdx,8)
incq %rdx
cmpq $0x100, %rdx            # imm = 0x100
movq 0x20(%rsp), %rbx
jne 0x1c468
movq %rbx, 0x870(%rax)
movq 0x878(%rax), %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
movq 0x18(%rsp), %rdi
je 0x1c88b
movw $0x0, 0xc(%rsp)
xorl %esi, %esi
movl %esi, %eax
rolw $0x8, %ax
movw %ax, 0xc(%rsp)
xorl %edx, %edx
xorl %r10d, %r10d
movq %rbx, %rax
subq %rdi, %rax
je 0x1c5e8
sarq %rax
andq $-0x8, %rax
leaq (%rdi,%rax), %r12
cmpq %rdx, %r10
movq %rdx, %r9
cmovbq %r10, %r9
movq (%rdi,%rax), %rcx
addq %r14, %rcx
addq %r9, %rcx
movq %r9, %r13
xorl %ebp, %ebp
cmpq $0x2, %r13
je 0x1c5ef
cmpq %r15, %rcx
je 0x1c5f4
movb 0xc(%rsp,%r13), %al
cmpb %al, (%rcx)
jne 0x1c5d1
incq %r13
incq %rcx
incq %r9
xorl %eax, %eax
cmpq $0x2000, %r9            # imm = 0x2000
setb %al
leal 0x1(%rax,%rax,2), %eax
cmovaeq %r12, %r8
jmp 0x1c5da
setb %r11b
movl $0x5, %eax
cmpl $0x4, %eax
je 0x1c59c
cmpl $0x5, %eax
je 0x1c5f7
movl %eax, %ebp
jmp 0x1c60f
movl $0x3, %ebp
jmp 0x1c60f
xorl %r11d, %r11d
jmp 0x1c5f7
movb $0x1, %r11b
testb $0x1, %r11b
je 0x1c609
addq $0x8, %r12
movq %r12, %rdi
movq %r9, %r10
jmp 0x1c60f
movq %r9, %rdx
movq %r12, %rbx
testl %ebp, %ebp
je 0x1c572
cmpl $0x3, %ebp
je 0x1c61f
movq %r8, %rdi
movq %rdi, %rax
movq 0x18(%rsp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
movq 0x10(%rsp), %rdx
movq %rax, (%rdx,%rsi,8)
incq %rsi
cmpq $0x10000, %rsi          # imm = 0x10000
movq 0x20(%rsp), %rbx
jne 0x1c562
subq %rcx, %rbx
sarq $0x3, %rbx
movq 0x10(%rsp), %rax
movq %rbx, 0x80000(%rax)
jmp 0x1c88b
leaq 0x373(%rip), %rax       # 0x1c9de
movq %rax, 0x880(%rcx)
movq 0x10(%rcx), %rsi
movq 0x18(%rcx), %rbx
cmpq %rbx, %rsi
je 0x1c88b
movq %rsi, 0x60(%rcx)
movq %rbx, 0x68(%rcx)
xorl %edx, %edx
movq %rsi, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
xorl %eax, %eax
xorl %r9d, %r9d
movq %rbx, %r11
movq %r11, %rcx
subq %rsi, %rcx
je 0x1c710
sarq %rcx
andq $-0x4, %rcx
leaq (%rsi,%rcx), %r12
cmpq %rax, %r9
movq %rax, %r8
cmovbq %r9, %r8
movslq (%rsi,%rcx), %rcx
addq %r14, %rcx
addq %r8, %rcx
movq %r8, %r13
xorl %ebp, %ebp
cmpq $0x1, %r13
je 0x1c717
cmpq %r15, %rcx
je 0x1c71c
cmpb %dl, (%rcx)
jne 0x1c6f9
incq %r13
incq %rcx
incq %r8
xorl %ebx, %ebx
cmpq $0x2000, %r8            # imm = 0x2000
setb %bl
leal 0x1(%rbx,%rbx,2), %ebx
cmovaeq %r12, %rdi
jmp 0x1c702
setb %r10b
movl $0x5, %ebx
cmpl $0x4, %ebx
je 0x1c6c9
cmpl $0x5, %ebx
je 0x1c71f
movl %ebx, %ebp
jmp 0x1c737
movl $0x3, %ebp
jmp 0x1c737
xorl %r10d, %r10d
jmp 0x1c71f
movb $0x1, %r10b
testb $0x1, %r10b
je 0x1c731
addq $0x4, %r12
movq %r12, %rsi
movq %r8, %r9
jmp 0x1c737
movq %r8, %rax
movq %r12, %r11
testl %ebp, %ebp
je 0x1c69f
cmpl $0x3, %ebp
je 0x1c747
movq %rdi, %rsi
movq 0x10(%rsp), %rax
movq %rsi, 0x70(%rax,%rdx,8)
incq %rdx
cmpq $0x100, %rdx            # imm = 0x100
movq 0x20(%rsp), %rbx
jne 0x1c697
movq %rbx, 0x870(%rax)
movq 0x878(%rax), %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
movq 0x18(%rsp), %rdi
je 0x1c88b
movw $0x0, 0xe(%rsp)
xorl %esi, %esi
movl %esi, %eax
rolw $0x8, %ax
movw %ax, 0xe(%rsp)
xorl %edx, %edx
xorl %r10d, %r10d
movq %rbx, %rax
subq %rdi, %rax
je 0x1c816
sarq %rax
andq $-0x4, %rax
leaq (%rdi,%rax), %r12
cmpq %rdx, %r10
movq %rdx, %r9
cmovbq %r10, %r9
movslq (%rdi,%rax), %rcx
addq %r14, %rcx
addq %r9, %rcx
movq %r9, %r13
xorl %ebp, %ebp
cmpq $0x2, %r13
je 0x1c81d
cmpq %r15, %rcx
je 0x1c822
movb 0xe(%rsp,%r13), %al
cmpb %al, (%rcx)
jne 0x1c7ff
incq %r13
incq %rcx
incq %r9
xorl %eax, %eax
cmpq $0x2000, %r9            # imm = 0x2000
setb %al
leal 0x1(%rax,%rax,2), %eax
cmovaeq %r12, %r8
jmp 0x1c808
setb %r11b
movl $0x5, %eax
cmpl $0x4, %eax
je 0x1c7ca
cmpl $0x5, %eax
je 0x1c825
movl %eax, %ebp
jmp 0x1c83d
movl $0x3, %ebp
jmp 0x1c83d
xorl %r11d, %r11d
jmp 0x1c825
movb $0x1, %r11b
testb $0x1, %r11b
je 0x1c837
addq $0x4, %r12
movq %r12, %rdi
movq %r9, %r10
jmp 0x1c83d
movq %r9, %rdx
movq %r12, %rbx
testl %ebp, %ebp
je 0x1c7a0
cmpl $0x3, %ebp
je 0x1c84d
movq %r8, %rdi
movq %rdi, %rax
movq 0x18(%rsp), %rcx
subq %rcx, %rax
shrq $0x2, %rax
movq 0x10(%rsp), %rdx
movl %eax, (%rdx,%rsi,4)
incq %rsi
cmpq $0x10000, %rsi          # imm = 0x10000
movq 0x20(%rsp), %rbx
jne 0x1c790
subq %rcx, %rbx
shrq $0x2, %rbx
movq 0x10(%rsp), %rax
movl %ebx, 0x40000(%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq