// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: create_lite_diff(unsigned char const*, unsigned char const*, unsigned char const*, unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char>>&, hdiffi_TCompress const*, int, bool, ILiteDiffListener*, unsigned long)
void create_lite_diff(const unsigned char* newData,const unsigned char* newData_end,
                      const unsigned char* oldData,const unsigned char* oldData_end,
                      std::vector<hpi_byte>& out_lite_diff,const hdiffi_TCompress* compressPlugin,
                      int kMinSingleMatchScore,bool isUseBigCacheMatch,
                      ILiteDiffListener* listener,size_t threadNum){
    static const int _kMatchScore_optim4bin=6;
    TDiffData diff;
    std::vector<TOldCover> covers;
    get_diff(newData,newData_end,oldData,oldData_end,diff,covers,
             kMinSingleMatchScore-_kMatchScore_optim4bin,isUseBigCacheMatch,listener,0,threadNum);
    size_t oldPosEnd=0;
    size_t newPosEnd=0;
    if (!covers.empty()){
        const TOldCover& c=covers.back();
        oldPosEnd=c.oldPos+c.length;
        newPosEnd=c.newPos+c.length;
    }
    const size_t newSize=newData_end-newData;
    if (newPosEnd<newSize)
        covers.push_back(TOldCover(oldPosEnd,newSize,0));

    TInlpacePatchSets inlpacePatchSets={};
    if (listener&&listener->getInplacePatchExtraSafeSize){
        if (listener->getInplacePatchExtraSafeSize(listener,&inlpacePatchSets.extraSafeSize))
            inlpacePatchSets.isInplacePatchByExtra=true;
    }
    serialize_lite_diff(diff,covers,out_lite_diff,compressPlugin,inlpacePatchSets);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %r9, 0xc0(%rsp)
movq %r8, %r14
movq %rsi, %r12
movq %rdi, %rbp
movb 0x128(%rsp), %sil
movq 0x138(%rsp), %r10
movl 0x120(%rsp), %eax
xorl %r11d, %r11d
leaq 0x30(%rsp), %r9
movq %r11, 0x10(%r9)
xorps %xmm0, %xmm0
movaps %xmm0, (%r9)
addl $-0x6, %eax
movzbl %sil, %ebx
leaq 0xc8(%rsp), %r8
movq %r12, %rsi
pushq $0x1
pushq %r10
pushq %r11
pushq 0x148(%rsp)
pushq %rbx
pushq %rax
callq 0xdb51
addq $0x30, %rsp
movq %r14, 0xb8(%rsp)
movq 0x30(%rsp), %r13
movq 0x38(%rsp), %rbx
cmpq %rbx, %r13
je 0x1128b
movq -0x8(%rbx), %rax
movq -0x18(%rbx), %r15
addq %rax, %r15
addq -0x10(%rbx), %rax
jmp 0x11290
xorl %r15d, %r15d
xorl %eax, %eax
subq %rbp, %r12
movabsq $-0x5555555555555555, %rbp # imm = 0xAAAAAAAAAAAAAAAB
cmpq %r12, %rax
jae 0x113b4
cmpq 0x40(%rsp), %rbx
je 0x112ca
movq %r15, (%rbx)
movq %r12, 0x8(%rbx)
movq $0x0, 0x10(%rbx)
addq $0x18, %rbx
movq %rbx, 0x38(%rsp)
jmp 0x113b4
movq %rbx, %rbp
subq %r13, %rbp
movabsq $0x7ffffffffffffff8, %rax # imm = 0x7FFFFFFFFFFFFFF8
cmpq %rax, %rbp
je 0x1190b
movq %rbp, %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
cmpq $0x1, %rax
movq %rax, %rcx
adcq $0x0, %rcx
leaq (%rcx,%rax), %rdi
movabsq $0x555555555555555, %rdx # imm = 0x555555555555555
cmpq %rdx, %rdi
cmovaeq %rdx, %rdi
addq %rax, %rcx
cmovbq %rdx, %rdi
movq %rdi, 0x88(%rsp)
callq 0x1365c
movq %rax, %r14
movq %r15, (%rax,%rbp)
movq %r12, 0x8(%rax,%rbp)
movq $0x0, 0x10(%rax,%rbp)
movq %rax, %r15
cmpq %rbx, %r13
je 0x11372
movq %r14, %r15
movq %r13, %rax
movq (%rax), %rcx
movq %rcx, (%r15)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%r15)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%r15)
addq $0x18, %rax
addq $0x18, %r15
cmpq %rbx, %rax
jne 0x1134f
addq $0x18, %r15
testq %r13, %r13
movabsq $-0x5555555555555555, %rbp # imm = 0xAAAAAAAAAAAAAAAB
je 0x11395
movq 0x40(%rsp), %rsi
subq %r13, %rsi
movq %r13, %rdi
callq 0x4300
movq %r14, 0x30(%rsp)
movq %r15, 0x38(%rsp)
movq 0x88(%rsp), %rax
leaq (%rax,%rax,2), %rax
leaq (%r14,%rax,8), %rax
movq %rax, 0x40(%rsp)
movq $0x0, 0x28(%rsp)
movq 0x130(%rsp), %rdi
testq %rdi, %rdi
je 0x113e3
movq 0x40(%rdi), %rax
testq %rax, %rax
je 0x113e3
leaq 0x2c(%rsp), %rsi
callq *%rax
testb %al, %al
je 0x113e3
movb $0x1, 0x28(%rsp)
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %r14
movq %r14, %rsi
subq %rbx, %rsi
sarq $0x3, %rsi
imulq %rbp, %rsi
movb 0x28(%rsp), %bpl
xorl %eax, %eax
movq %rax, 0x80(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
leaq 0x10(%rsp), %rdi
movq %rax, 0x10(%rdi)
movaps %xmm0, (%rdi)
movq %rsi, %r15
callq 0x15694
movb %bpl, 0xf(%rsp)
movq 0xd0(%rsp), %rax
subq 0xc8(%rsp), %rax
movq %rax, 0xb0(%rsp)
cmpq %rbx, %r14
je 0x115c7
cmpq $0x1, %r15
adcq $0x0, %r15
movq %r15, 0x88(%rsp)
xorl %r14d, %r14d
leaq 0x10(%rsp), %rdi
xorl %ebp, %ebp
xorl %ebx, %ebx
movq 0x30(%rsp), %r15
leaq (%rbx,%rbx,2), %r12
movq 0x10(%r15,%r12,8), %rsi
callq 0x15694
leaq (%r15,%r12,8), %r15
movq 0x10(%r15), %rsi
leaq 0x70(%rsp), %rdi
callq 0x9d84
movq 0x70(%rsp), %rax
cmpq %rax, 0x78(%rsp)
je 0x114d3
movq 0xc8(%rsp), %rcx
addq 0x8(%r15), %rcx
movq 0xd8(%rsp), %rdx
addq (%r15), %rdx
xorl %esi, %esi
movb (%rcx,%rsi), %dil
subb (%rdx,%rsi), %dil
movb %dil, (%rax,%rsi)
incq %rsi
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rdi
subq %rax, %rdi
cmpq %rdi, %rsi
jb 0x114b2
movq 0x10(%r15), %rax
testq %rax, %rax
sete %r12b
je 0x11514
movq 0x70(%rsp), %rcx
cmpb $0x0, (%rcx)
je 0x114ef
xorl %r12d, %r12d
jmp 0x11514
leaq -0x1(%rax), %rdx
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x1150a
leaq 0x1(%rsi), %rdi
cmpb $0x0, 0x1(%rcx,%rsi)
movq %rdi, %rsi
je 0x114f5
jmp 0x1150d
movq %rax, %rdi
cmpq %rax, %rdi
setae %r12b
movq (%r15), %rsi
leal (%r12,%r12), %eax
leal 0x1(%rax), %ecx
movq %rsi, %rdx
subq %r14, %rdx
movzbl %al, %eax
movzbl %cl, %ecx
cmovael %eax, %ecx
negq %rdx
subq %r14, %rsi
cmovbq %rdx, %rsi
movzbl %cl, %edx
leaq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0x1574d
movq 0x8(%r15), %r14
movq %r14, %rsi
subq %rbp, %rsi
movq %r13, %rdi
callq 0x15694
cmpq %rbp, %r14
je 0x11581
movq 0xc8(%rsp), %rax
addq %rax, %rbp
addq %rax, %r14
movq 0x18(%rsp), %rsi
leaq 0x10(%rsp), %rdi
movq %rbp, %rdx
movq %r14, %rcx
callq 0xa064
testb %r12b, %r12b
jne 0x115a1
movq 0x70(%rsp), %rdx
movq 0x10(%r15), %rcx
addq %rdx, %rcx
movq 0x18(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0xa064
movq 0x10(%r15), %rbp
movq (%r15), %r14
addq %rbp, %r14
addq 0x8(%r15), %rbp
incq %rbx
cmpq 0x88(%rsp), %rbx
leaq 0x10(%rsp), %rdi
jne 0x11468
jmp 0x115c9
xorl %ebp, %ebp
movq 0xb0(%rsp), %r12
cmpq %rbp, %r12
jne 0x11889
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
movq 0xc0(%rsp), %rbx
movq (%rbx), %r14
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq 0x90(%rsp), %rdi
callq 0x4392d
movq 0xb8(%rsp), %r15
movb 0xf(%rsp), %bpl
leaq 0x50(%rsp), %rdi
leaq 0x90(%rsp), %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x26172
leaq 0x90(%rsp), %rsi
movb $0x68, (%rsi)
movq %r15, %rdi
callq 0x17180
leaq 0x90(%rsp), %rsi
movb $0x49, (%rsi)
movq %r15, %rdi
callq 0x17180
movq 0x50(%rsp), %rax
cmpq 0x58(%rsp), %rax
je 0x11668
movb 0x8(%rbx), %al
jmp 0x1166a
xorl %eax, %eax
leaq 0x90(%rsp), %rsi
movb %al, (%rsi)
movq %r15, %rdi
callq 0x17180
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
movq 0x50(%rsp), %rcx
xorl %ebx, %ebx
cmpq 0x58(%rsp), %rcx
cmovneq %rax, %rbx
movq %r12, %rax
shrq $0x20, %rax
jne 0x118bb
xorl %eax, %eax
testq %r12, %r12
je 0x116c2
movq %r12, %rdx
movq %r12, %rcx
incb %al
shrq $0x8, %rcx
cmpq $0xff, %rdx
movq %rcx, %rdx
ja 0x116b0
movq %rbx, %rcx
shrq $0x20, %rcx
jne 0x118d9
xorl %ecx, %ecx
testq %rbx, %rbx
je 0x116ef
movq %rbx, %rsi
movq %rbx, %rdx
shrq $0x8, %rdx
addb $0x8, %cl
cmpq $0xff, %rsi
movq %rdx, %rsi
ja 0x116dc
testb %bpl, %bpl
movl $0x80, %edx
movl $0x40, %esi
cmovnel %edx, %esi
orb %cl, %al
orb %sil, %al
leaq 0x90(%rsp), %rsi
movb %al, (%rsi)
movq %r15, %rdi
callq 0x17180
testb %bpl, %bpl
je 0x1174d
movl 0x2c(%rsp), %ecx
xorl %eax, %eax
testq %rcx, %rcx
je 0x1173b
movq %rcx, %rdx
incb %al
shrq $0x8, %rdx
cmpq $0xff, %rcx
movq %rdx, %rcx
ja 0x11729
leaq 0x90(%rsp), %rsi
movb %al, (%rsi)
movq %r15, %rdi
callq 0x17180
testq %r12, %r12
je 0x11780
leaq 0x90(%rsp), %r14
movb %r12b, 0x90(%rsp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x17180
movq %r12, %rax
shrq $0x8, %rax
cmpq $0xff, %r12
movq %rax, %r12
ja 0x1175a
testq %rbx, %rbx
je 0x117b2
leaq 0x90(%rsp), %r14
movb %bl, 0x90(%rsp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x17180
movq %rbx, %rax
shrq $0x8, %rax
cmpq $0xff, %rbx
movq %rax, %rbx
ja 0x1178d
movl 0x2c(%rsp), %eax
testl %eax, %eax
setne %cl
andb %cl, %bpl
cmpb $0x1, %bpl
jne 0x117f3
movl %eax, %ebx
leaq 0x90(%rsp), %r14
movb %bl, 0x90(%rsp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x17180
movq %rbx, %rax
shrq $0x8, %rax
cmpq $0x100, %rbx            # imm = 0x100
movq %rax, %rbx
jae 0x117ce
movq 0x50(%rsp), %rdx
movq 0x58(%rsp), %rcx
movq 0x8(%r15), %rsi
cmpq %rcx, %rdx
jne 0x11810
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq %r15, %rdi
callq 0xa244
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x1182f
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x11846
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x11860
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x11877
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x4190
movq %rax, %r14
leaq 0x4ab43(%rip), %rsi     # 0x5c3e0
movq %rax, %rdi
callq 0x4110
movq 0x6a73c(%rip), %rsi     # 0x7bfe8
movq 0x6a705(%rip), %rdx     # 0x7bfb8
movq %r14, %rdi
callq 0x4590
movl $0x10, %edi
callq 0x4190
movq %rax, %r14
leaq 0x4ab49(%rip), %rsi     # 0x5c418
movq %rax, %rdi
callq 0x4110
jmp 0x118f5
movl $0x10, %edi
callq 0x4190
movq %rax, %r14
leaq 0x4ab2b(%rip), %rsi     # 0x5c418
movq %rax, %rdi
callq 0x4110
movq 0x6a6ec(%rip), %rsi     # 0x7bfe8
movq 0x6a6b5(%rip), %rdx     # 0x7bfb8
movq %r14, %rdi
callq 0x4590
leaq 0x48b97(%rip), %rdi     # 0x5a4a9
callq 0x41b0
jmp 0x11945
jmp 0x11945
jmp 0x11956
jmp 0x1191f
movq %rax, %rbx
movq %r14, %rdi
callq 0x4260
jmp 0x11959
jmp 0x11974
movq %rax, %rbx
movq %r14, %rdi
callq 0x4260
jmp 0x11977
jmp 0x11956
jmp 0x11956
jmp 0x11956
jmp 0x11956
jmp 0x11974
movq %rax, %rbx
jmp 0x119a8
jmp 0x11956
jmp 0x11956
jmp 0x11974
jmp 0x11956
jmp 0x11956
jmp 0x11974
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x11977
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
jmp 0x11977
jmp 0x11974
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1198e
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x119a8
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x119bf
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq %rbx, %rdi
callq 0x45e0