// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x40(%rdi), %rax
movq 0x10(%rdi), %rsi
movq 0x28(%rdi), %rcx
movq 0x30(%rdi), %rdi
leaq (%rsi,%rax), %r8
subq %rcx, %r8
leaq (%r8,%rdi), %rdx
addq %r8, %rdi
incq %rdi
cmpq %rsi, %rdi
ja 0x22e1e
cmpq %rdx, 0x8(%r14)
ja 0x22e1e
subq %rsi, %rcx
addq %rdx, %rcx
movq %rcx, 0x30(%r14)
jmp 0x22e3c
xorl %r15d, %r15d
movl $0x1, %ecx
movq %r14, %rdi
xorl %esi, %esi
callq 0x206dc
testb %al, %al
je 0x22fa7
movq 0x40(%r14), %rax
movq 0x10(%rbx), %rsi
movq 0x28(%rbx), %rcx
movq 0x30(%rbx), %rdi
addq %rsi, %rax
subq %rcx, %rax
leaq (%rax,%rdi), %rdx
addq %rdi, %rax
incq %rax
cmpq %rsi, %rax
ja 0x22e6f
cmpq %rdx, 0x8(%rbx)
ja 0x22e6f
subq %rsi, %rcx
addq %rdx, %rcx
movq %rcx, 0x30(%rbx)
jmp 0x22e89
xorl %r15d, %r15d
movl $0x1, %ecx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x206dc
testb %al, %al
je 0x22fa7
xorl %r15d, %r15d
movq 0x20(%r14), %rdx
movq 0x28(%r14), %rax
movq 0x30(%r14), %rcx
movq %rax, %rsi
subq %rcx, %rsi
movq 0x28(%rbx), %rdi
movq 0x30(%rbx), %r8
subq %r8, %rdi
cmpq %rsi, %rdi
movq %rsi, %r12
cmovbq %rdi, %r12
testq %r12, %r12
je 0x22ed9
leaq (%rdx,%rcx), %r9
addq 0x20(%rbx), %r8
xorl %r10d, %r10d
movb (%r9,%r10), %r11b
cmpb (%r8,%r10), %r11b
jne 0x22fa4
incq %r10
cmpq %r10, %r12
jne 0x22ec3
cmpq %rsi, %rdi
setb %r8b
movq 0x50(%r14), %rdi
movq %rdi, %rsi
subq %rax, %rsi
setbe %r9b
orb %r8b, %r9b
jne 0x22f13
leaq (%rax,%rax), %r8
cmpq %rdi, %r8
cmovbeq %rax, %rsi
subq %rsi, %rdx
movq %rdx, 0x20(%r14)
addq %rsi, %rax
movq %rax, 0x28(%r14)
addq %rsi, %rcx
movq %rcx, 0x30(%r14)
addq %r12, %r15
movq 0x10(%r14), %rsi
leaq (%rsi,%r12), %rdi
subq %rax, %rdi
leaq (%rdi,%rcx), %rdx
addq %rdi, %rcx
incq %rcx
cmpq %rsi, %rcx
ja 0x22f42
cmpq %rdx, 0x8(%r14)
ja 0x22f42
subq %rsi, %rax
addq %rdx, %rax
movq %rax, 0x30(%r14)
jmp 0x22f55
movl $0x1, %ecx
movq %r14, %rdi
xorl %esi, %esi
callq 0x206dc
testb %al, %al
je 0x22fa7
movq 0x10(%rbx), %rcx
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rsi
addq %rcx, %r12
subq %rax, %r12
leaq (%r12,%rsi), %rdx
addq %r12, %rsi
incq %rsi
cmpq %rcx, %rsi
ja 0x22f8b
cmpq %rdx, 0x8(%rbx)
ja 0x22f8b
subq %rcx, %rax
addq %rdx, %rax
movq %rax, 0x30(%rbx)
jmp 0x22e8c
movl $0x1, %ecx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x206dc
testb %al, %al
jne 0x22e8c
jmp 0x22fa7
addq %r10, %r15
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq