// File: 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
movq %rsp, %rbp
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movb 0x18(%rbp), %al
movl 0x10(%rbp), %r10d
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
andb $0x1, %al
movb %al, -0x39(%rbp)
leaq -0x78(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x18c60
movq -0xd0(%rbp), %r9
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl 0x10(%rbp), %r8d
addl $-0x6, %r8d
movq 0x20(%rbp), %r11
movq 0x28(%rbp), %rbx
movzbl -0x39(%rbp), %r10d
movq %rsp, %rax
movq %rbx, 0x20(%rax)
movq %r11, 0x10(%rax)
andl $0x1, %r10d
movl %r10d, 0x8(%rax)
movl %r8d, (%rax)
movl $0x1, 0x28(%rax)
movq $0x0, 0x18(%rax)
leaq -0x60(%rbp), %r8
callq 0x18c80
jmp 0x1c9f4
movq $0x0, -0x90(%rbp)
movq $0x0, -0x98(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x1cb70
testb $0x1, %al
jne 0x1ca7f
leaq -0x78(%rbp), %rdi
callq 0x1cbb0
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movq -0xa0(%rbp), %rcx
addq 0x10(%rcx), %rax
movq %rax, -0x90(%rbp)
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rax
movq -0xa0(%rbp), %rcx
addq 0x10(%rcx), %rax
movq %rax, -0x98(%rbp)
jmp 0x1ca7f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x19760
jmp 0x1cb59
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0xa8(%rbp)
movq -0x98(%rbp), %rax
cmpq -0xa8(%rbp), %rax
jae 0x1cad5
movq -0x90(%rbp), %rsi
movq -0xa8(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
leaq -0xc0(%rbp), %rdi
callq 0x1cc20
jmp 0x1cac1
leaq -0x78(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x1cbf0
jmp 0x1cad3
jmp 0x1cad5
leaq -0xc8(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x4210
cmpq $0x0, 0x20(%rbp)
je 0x1cb28
movq 0x20(%rbp), %rax
cmpq $0x0, 0x40(%rax)
je 0x1cb28
movq 0x20(%rbp), %rdi
movq 0x40(%rdi), %rax
leaq -0xc4(%rbp), %rsi
callq *%rax
movb %al, -0xd1(%rbp)
jmp 0x1cb13
movb -0xd1(%rbp), %al
testb $0x1, %al
jne 0x1cb1f
jmp 0x1cb26
movb $0x1, -0xc8(%rbp)
jmp 0x1cb28
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
leaq -0x60(%rbp), %rdi
leaq -0x78(%rbp), %rsi
leaq -0xc8(%rbp), %r8
callq 0x1cc60
jmp 0x1cb46
leaq -0x78(%rbp), %rdi
callq 0x19760
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0x4680
nopw %cs:(%rax,%rax)