// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.cpp
// Function: hdiff_private::TOldStreamCache::loop_backward_equal_length(hdiff_private::TBlockStreamCache&)
hpatch_StreamPos_t loop_backward_equal_length(TBlockStreamCache& y){
        if (!_loop_backward_cache(kMatchBlockSize,1)) return 0;
        if (!y._loop_backward_cache(kMatchBlockSize,1)) return 0;
        hpatch_StreamPos_t eq_len=0;
        while(true){
            const size_t xLen=dataLength();
            size_t len=y.dataLength();
            len=(len>=xLen)?xLen:len;
            const unsigned char* px=data();
            const unsigned char* py=y.data();
            for (size_t i=0;i<len;++i){
                if (px[i]!=py[i])
                    return eq_len+i;
            }
            eq_len+=len;
            if ((len==xLen)&(cacheSize<maxCacheSize))
                _doGrowCacheSize();
            if (!_loop_backward_cache(len,1)) break;
            if (!y._loop_backward_cache(len,1)) break;
        }
        return eq_len;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r12
movq %rdi, %r14
movq 0x10(%rdi), %rcx
movq 0x28(%rdi), %rax
movq 0x30(%rdi), %rsi
movq 0x40(%rdi), %rdi
addq %rcx, %rdi
subq %rax, %rdi
leaq (%rdi,%rsi), %rdx
addq %rdi, %rsi
incq %rsi
cmpq %rcx, %rsi
ja 0x22fe9
cmpq %rdx, 0x8(%r14)
ja 0x22fe9
subq %rcx, %rax
addq %rdx, %rax
movq %rax, 0x30(%r14)
jmp 0x23002
xorl %ebx, %ebx
movl $0x1, %ecx
movq %r14, %rdi
xorl %esi, %esi
callq 0x20716
testb %al, %al
je 0x231e6
movq 0x10(%r12), %rcx
movq 0x28(%r12), %rax
movq 0x30(%r12), %rsi
movq 0x40(%r14), %rdi
addq %rcx, %rdi
subq %rax, %rdi
leaq (%rdi,%rsi), %rdx
addq %rdi, %rsi
incq %rsi
cmpq %rcx, %rsi
ja 0x2303e
cmpq %rdx, 0x8(%r12)
ja 0x2303e
subq %rcx, %rax
addq %rdx, %rax
movq %rax, 0x30(%r12)
jmp 0x23057
xorl %ebx, %ebx
movl $0x1, %ecx
movq %r12, %rdi
xorl %esi, %esi
callq 0x20716
testb %al, %al
je 0x231e6
xorl %ebx, %ebx
movq %r12, 0x8(%rsp)
movq 0x28(%r14), %rcx
movq 0x30(%r14), %rax
movq %rcx, %rsi
subq %rax, %rsi
movq 0x28(%r12), %r8
movq 0x30(%r12), %r10
subq %r10, %r8
cmpq %rsi, %r8
movq %rsi, %r13
cmovbq %r8, %r13
movq 0x20(%r14), %rdx
movl $0x4, %edi
testq %r13, %r13
setne %r9b
je 0x230f1
movq 0x20(%r12), %r11
movb (%rdx,%rax), %bpl
cmpb (%r11,%r10), %bpl
jne 0x230d7
leaq (%rdx,%rax), %r9
incq %r9
addq %r10, %r11
incq %r11
leaq -0x1(%r13), %rbp
xorl %r10d, %r10d
cmpq %r10, %rbp
je 0x230e9
movb (%r9,%r10), %r15b
leaq 0x1(%r10), %r12
cmpb (%r11,%r10), %r15b
movq %r12, %r10
je 0x230b8
cmpq %r13, %r12
setb %r9b
jmp 0x230da
xorl %r12d, %r12d
addq %rbx, %r12
movl $0x1, %edi
movq %r12, 0x10(%rsp)
jmp 0x230ec
xorl %r9d, %r9d
movq 0x8(%rsp), %r12
testb %r9b, %r9b
jne 0x231d4
cmpq %rsi, %r8
setb %r8b
movq 0x50(%r14), %rdi
movq %rdi, %rsi
subq %rcx, %rsi
setbe %r9b
orb %r8b, %r9b
jne 0x23134
leaq (%rcx,%rcx), %r8
cmpq %rdi, %r8
cmovbeq %rcx, %rsi
subq %rsi, %rdx
movq %rdx, 0x20(%r14)
addq %rsi, %rcx
movq %rcx, 0x28(%r14)
addq %rax, %rsi
movq %rsi, 0x30(%r14)
addq %r13, %rbx
movq 0x10(%r14), %rcx
movq 0x28(%r14), %rax
movq 0x30(%r14), %rsi
leaq (%rcx,%r13), %rdi
subq %rax, %rdi
leaq (%rdi,%rsi), %rdx
addq %rdi, %rsi
incq %rsi
cmpq %rcx, %rsi
ja 0x2316b
cmpq %rdx, 0x8(%r14)
ja 0x2316b
subq %rcx, %rax
addq %rdx, %rax
movq %rax, 0x30(%r14)
jmp 0x23183
movl $0x1, %ecx
movq %r14, %rdi
xorl %esi, %esi
callq 0x20716
movl $0x3, %edi
testb %al, %al
je 0x231d4
movq 0x10(%r12), %rcx
movq 0x28(%r12), %rax
movq 0x30(%r12), %rsi
addq %rcx, %r13
subq %rax, %r13
leaq (%rsi,%r13), %rdx
addq %r13, %rsi
incq %rsi
cmpq %rcx, %rsi
ja 0x231bd
cmpq %rdx, 0x8(%r12)
ja 0x231bd
subq %rcx, %rax
addq %rdx, %rax
movq %rax, 0x30(%r12)
xorl %edi, %edi
jmp 0x231d4
movl $0x1, %ecx
movq %r12, %rdi
xorl %esi, %esi
callq 0x20716
xorb $0x1, %al
movzbl %al, %eax
leal (%rax,%rax,2), %edi
testl %edi, %edi
je 0x2305e
cmpl $0x3, %edi
je 0x231e6
movq 0x10(%rsp), %rbx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq