// File: sisong[P]ApkDiffPatch/src/diff/Differ.cpp
// Function: HPatchZ_check(std::vector<unsigned char, std::allocator<unsigned char>> const&, std::vector<unsigned char, std::allocator<unsigned char>> const&, std::vector<unsigned char, std::allocator<unsigned char>> const&, hpatch_TDecompress*, bool)
static bool HPatchZ_check(const std::vector<TByte>& oldData,const std::vector<TByte>& newData,
                          const std::vector<TByte>& diffData,hpatch_TDecompress* decompressPlugin,bool isSD){
    const size_t oldDataSize=oldData.size();
    const size_t newDataSize=newData.size();
    
    const TByte* newData0=newData.data();
    const TByte* oldData0=oldData.data();
    
    double time1=clock_s();
    bool checkRet;
    if (!isSD){
        checkRet=check_compressed_diff(newData0,newData0+newDataSize,oldData0,oldData0+oldDataSize,
                                       diffData.data(),diffData.data()+diffData.size(),decompressPlugin);
    }else{
        checkRet=check_single_compressed_diff(newData0,newData0+newDataSize,oldData0,oldData0+oldDataSize,
                                              diffData.data(),diffData.data()+diffData.size(),decompressPlugin);
    }
    if (!checkRet){
        std::cout<<"\n  hpatchz check hdiffz result error!!!\n";
        return false;
    }else{
        double time2=clock_s();
        std::cout<<"  hpatchz check hdiffz result ok!\n";
        std::cout<<"  patch time: "<<(time2-time1)<<" s\n\n";
        return true;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movb %r8b, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
andb $0x1, %al
movb %al, -0x29(%rbp)
movq -0x10(%rbp), %rdi
callq 0xbe90
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
callq 0xbe90
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
callq 0x14be0
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
callq 0x14be0
movq %rax, -0x50(%rbp)
callq 0x14720
movsd %xmm0, -0x58(%rbp)
testb $0x1, -0x29(%rbp)
jne 0x1443a
movq -0x48(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x48(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x50(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x20(%rbp), %rdi
callq 0x14be0
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rdi
callq 0x14be0
movq %rax, -0x98(%rbp)
movq -0x20(%rbp), %rdi
callq 0xbe90
movq -0x98(%rbp), %r9
movq -0x90(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq -0x78(%rbp), %rcx
movq -0x70(%rbp), %r8
addq %rax, %r9
movq -0x28(%rbp), %rax
movq %rax, (%rsp)
callq 0x1aa60
andb $0x1, %al
movb %al, -0x59(%rbp)
jmp 0x144d6
movq -0x48(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x48(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x50(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x20(%rbp), %rdi
callq 0x14be0
movq %rax, -0xa0(%rbp)
movq -0x20(%rbp), %rdi
callq 0x14be0
movq %rax, -0xc8(%rbp)
movq -0x20(%rbp), %rdi
callq 0xbe90
movq -0xc8(%rbp), %r9
movq -0xc0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
movq -0xa8(%rbp), %rcx
movq -0xa0(%rbp), %r8
addq %rax, %r9
movq -0x28(%rbp), %rax
movq %rax, (%rsp)
callq 0x1acc0
andb $0x1, %al
movb %al, -0x59(%rbp)
testb $0x1, -0x59(%rbp)
jne 0x144f5
movq 0xd1ae5(%rip), %rdi     # 0xe5fc8
leaq 0x99fdb(%rip), %rsi     # 0xae4c5
callq 0x4380
movb $0x0, -0x1(%rbp)
jmp 0x1454a
callq 0x14720
movsd %xmm0, -0x68(%rbp)
movq 0xd1ac2(%rip), %rdi     # 0xe5fc8
leaq 0x99fe1(%rip), %rsi     # 0xae4ee
callq 0x4380
movq 0xd1aaf(%rip), %rdi     # 0xe5fc8
leaq 0x99ff1(%rip), %rsi     # 0xae511
callq 0x4380
movq %rax, %rdi
movsd -0x68(%rbp), %xmm0
subsd -0x58(%rbp), %xmm0
callq 0x46e0
movq %rax, %rdi
leaq 0x99fdf(%rip), %rsi     # 0xae520
callq 0x4380
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xd0, %rsp
popq %rbp
retq
nopl (%rax,%rax)