// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/diff/DiffData.cpp
// Function: serializeZipDiffData(std::vector<unsigned char, std::allocator<unsigned char>>&, UnZipper*, UnZipper*, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, std::vector<unsigned int, std::allocator<unsigned int>> const&, std::vector<unsigned int, std::allocator<unsigned int>> const&, std::vector<unsigned int, std::allocator<unsigned int>> const&, std::vector<unsigned int, std::allocator<unsigned int>> const&, std::vector<unsigned char, std::allocator<unsigned char>> const&, hdiff_TCompress const*, unsigned long)
bool serializeZipDiffData(std::vector<TByte>& out_data, UnZipper* newZip,UnZipper* oldZip,
                          size_t newZipAlignSize,size_t compressLevel,size_t compressMemLevel,
                          size_t otherCompressLevel,size_t otherCompressMemLevel,
                          const std::vector<uint32_t>& samePairList,
                          const std::vector<uint32_t>& newRefOtherCompressedList,
                          const std::vector<uint32_t>& newRefCompressedSizeList,
                          const std::vector<uint32_t>& oldRefList,
                          const std::vector<TByte>&    hdiffzData,
                          const hdiff_TCompress* compressPlugin,
                          const size_t patchModel){
    ZipDiffData  data;
    memset(&data,0,sizeof(ZipDiffData));
    data.PatchModel=patchModel; //now must 0 or 1
    data.newZipFileCount=UnZipper_fileCount(newZip);
    data.newZipIsDataNormalized=newZip->_isDataNormalized?1:0;
    data.newZipAlignSize=newZipAlignSize;
    data.newCompressLevel=compressLevel;
    data.newCompressMemLevel=compressMemLevel;
    data.newOtherCompressLevel=otherCompressLevel;
    data.newOtherCompressMemLevel=otherCompressMemLevel;
    data.newZipCESize=UnZipper_CESize(newZip);
    data.samePairList=(uint32_t*)samePairList.data();
    data.samePairCount=samePairList.size()/2;
    data.newRefOtherCompressedList=(uint32_t*)newRefOtherCompressedList.data();
    data.newRefOtherCompressedCount=newRefOtherCompressedList.size();
    data.newRefCompressedSizeList=(uint32_t*)newRefCompressedSizeList.data();
    data.newRefCompressedSizeCount=newRefCompressedSizeList.size();
    data.oldZipIsDataNormalized=(UnZipper_isHaveApkV2Sign(oldZip)&&oldZip->_isDataNormalized)?1:0;
    data.oldIsFileDataOffsetMatch=(UnZipper_isHaveApkV2Sign(oldZip)&&oldZip->_isFileDataOffsetMatch)?1:0;
    data.oldZipCESize=UnZipper_CESize(oldZip);
    data.oldRefList=(uint32_t*)oldRefList.data();
    data.oldRefCount=oldRefList.size();
    data.oldCrc=OldStream_getOldCrc(oldZip,oldRefList.data(),oldRefList.size());
    data.normalizeSoPageAlign=UnZipper_getHugePageAlign(newZip,newZipAlignSize);
    return _serializeZipDiffData(out_data,&data,hdiffzData,compressPlugin,newZip);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %r9, 0x80(%rsp)
movq %r8, 0x88(%rsp)
movq %rcx, 0x70(%rsp)
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, 0xd0(%rsp)
movq 0x178(%rsp), %r14
movq 0x170(%rsp), %r15
movq 0x168(%rsp), %r12
movq 0x160(%rsp), %rbp
movq %rsi, %rdi
callq 0x36bfd
movzbl 0x89(%rbx), %ecx
movq %rcx, 0x90(%rsp)
movl 0xa8(%rbx), %ecx
movq %rbx, 0x38(%rsp)
addq 0xa0(%rbx), %rcx
movq %rcx, 0x40(%rsp)
movq (%rbp), %rbx
movq 0x8(%rbp), %rcx
subq %rbx, %rcx
sarq $0x2, %rcx
movq %rcx, 0x48(%rsp)
movq (%r12), %rcx
movq 0x8(%r12), %rdi
movq %rcx, 0xb0(%rsp)
subq %rcx, %rdi
movq (%r15), %rdx
movq 0x8(%r15), %rsi
subq %rdx, %rsi
movq 0x50(%r13), %rcx
cmpq %rcx, 0x98(%r13)
movq %rdx, 0xb8(%rsp)
jae 0x7d52
movzbl 0x89(%r13), %edx
movq %rdx, 0x60(%rsp)
movzbl 0x8a(%r13), %edx
movq %rdx, 0x58(%rsp)
jmp 0x7d64
movq $0x0, 0x60(%rsp)
movq $0x0, 0x58(%rsp)
movq 0x38(%rsp), %r15
movq 0x40(%rsp), %rdx
subq 0x50(%r15), %rdx
movq %rdx, 0x40(%rsp)
cltq
movq %rax, 0x98(%rsp)
shrq 0x48(%rsp)
sarq $0x2, %rdi
movq %rdi, 0xc0(%rsp)
sarq $0x2, %rsi
movq %rsi, 0xc8(%rsp)
movl 0xa8(%r13), %eax
addq 0xa0(%r13), %rax
subq %rcx, %rax
movq %rax, 0x78(%rsp)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
subq %rsi, %rdx
sarq $0x2, %rdx
movq %r13, %rdi
movq %rsi, 0xa8(%rsp)
movq %rdx, 0x68(%rsp)
callq 0x35343
movl %eax, 0x54(%rsp)
movq %r15, %rdi
movq 0x70(%rsp), %rsi
callq 0x385cc
movq %rax, 0xa0(%rsp)
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %r13
movaps %xmm0, (%r13)
andq $0x0, 0x10(%r13)
pushq $-0x1
popq %r14
xorl %ebp, %ebp
movl %r14d, %esi
cmpq %rbp, 0x48(%rsp)
je 0x7e57
movl (%rbx,%rbp,8), %r12d
notl %esi
addl %r12d, %esi
movq %r13, %rdi
callq 0x8201
movl 0x4(%rbx,%rbp,8), %r15d
incl %r14d
movl %r15d, %eax
subl %r14d, %eax
negl %eax
xorl %edx, %edx
movl %r15d, %esi
subl %r14d, %esi
setb %dl
cmovbl %eax, %esi
movq %r13, %rdi
pushq $0x1
popq %rcx
callq 0x8207
incq %rbp
movl %r15d, %r14d
movl %r12d, %esi
jmp 0x7e0b
leaq 0x20(%rsp), %rdi
movq 0xb0(%rsp), %rsi
movq 0xc0(%rsp), %rbp
movq %rbp, %rdx
callq 0x8297
movq 0xd0(%rsp), %r12
movq 0xc8(%rsp), %r13
movq 0xb8(%rsp), %r15
xorl %ebx, %ebx
leaq 0x20(%rsp), %r14
cmpq %rbx, %r13
je 0x7ea9
movl (%r15,%rbx,4), %esi
movq %r14, %rdi
callq 0x8201
incq %rbx
jmp 0x7e93
leaq 0x20(%rsp), %rdi
movq 0xa8(%rsp), %rsi
movq 0x68(%rsp), %rdx
callq 0x8297
xorps %xmm0, %xmm0
andq $0x0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rdi
cmpq %rdi, %rax
movq 0x188(%rsp), %rbx
je 0x7f5f
subq %rax, %rdi
callq *0x8(%rbx)
movq %rsp, %rdi
movq %rax, %rsi
callq 0x843c
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x20(%rsp), %r14
movq 0x28(%rsp), %r15
leaq 0xd8(%rsp), %rdi
callq 0x3a656
leaq 0xf8(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3a60a
leaq 0xd8(%rsp), %rsi
leaq 0xf8(%rsp), %rdx
movq %rbx, %rdi
callq *0x18(%rbx)
movq 0x8(%rsp), %rcx
subq (%rsp), %rcx
leaq -0x1(%rax), %rdx
cmpq %rcx, %rdx
jae 0x7fe4
movq %rsp, %rdi
movq %rax, %rsi
callq 0x843c
leaq 0x47492(%rip), %rsi     # 0x4f3f8
leaq 0x47492(%rip), %rdx     # 0x4f3ff
movq %r12, %rdi
callq 0x82d3
callq *(%rbx)
movq %rax, %r14
movq %rax, %rdi
callq 0x4150
cmpq $0x104, %rax            # imm = 0x104
jae 0x7fe4
leaq (%r14,%rax), %rdx
incq %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x82d3
xorl %ebx, %ebx
movl $0x1000, %eax           # imm = 0x1000
movq 0xa0(%rsp), %rcx
cmpq %rax, %rcx
cmovneq %rcx, %rbx
testq %rcx, %rcx
cmoveq %rax, %rbx
leaq 0x47af0(%rip), %r14     # 0x4fab0
leaq 0x47aea(%rip), %r15     # 0x4fab1
cmpq $0x1000, %rbx           # imm = 0x1000
jb 0x7feb
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x82d3
shrq $0x2, %rbx
jmp 0x7fc7
xorl %ebx, %ebx
jmp 0x81a7
movq %r12, %rdi
movq 0x190(%rsp), %rsi
callq 0x82e2
movq %r12, %rdi
movq 0x98(%rsp), %rsi
callq 0x82e2
movq %r12, %rdi
movq 0x90(%rsp), %rsi
callq 0x82e2
movq %r12, %rdi
movq 0x70(%rsp), %rsi
callq 0x82e2
movq %r12, %rdi
movq 0x88(%rsp), %rsi
callq 0x82e2
movq %r12, %rdi
movq 0x80(%rsp), %rsi
callq 0x82e2
movq %r12, %rdi
movq 0x150(%rsp), %rsi
callq 0x82e2
movq %r12, %rdi
movq 0x158(%rsp), %rsi
callq 0x82e2
movq %r12, %rdi
movq 0x40(%rsp), %rsi
callq 0x82e2
movq %r12, %rdi
movq 0x48(%rsp), %rsi
callq 0x82e2
movq %r12, %rdi
movq %rbp, %rsi
callq 0x82e2
movq %r12, %rdi
movq %r13, %rsi
callq 0x82e2
movq %r12, %rdi
movq 0x60(%rsp), %rsi
callq 0x82e2
movq %r12, %rdi
movq 0x58(%rsp), %rsi
callq 0x82e2
movq %r12, %rdi
movq 0x78(%rsp), %rsi
callq 0x82e2
movq %r12, %rdi
movq 0x68(%rsp), %rsi
callq 0x82e2
movq %r12, %rdi
movl 0x54(%rsp), %esi
callq 0x8201
movq 0x28(%rsp), %rsi
subq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0x82e2
movq 0x8(%rsp), %rsi
subq (%rsp), %rsi
movq %r12, %rdi
callq 0x82e2
movq 0x180(%rsp), %rax
movq 0x8(%rax), %rsi
subq (%rax), %rsi
movq %r12, %rdi
callq 0x82e2
movq 0x20(%rsp), %rax
cmpq %rax, 0x28(%rsp)
je 0x8123
movq %rax, 0x28(%rsp)
movq %rsp, %rsi
movq %r12, %rdi
callq 0x8370
movq (%rsp), %rax
cmpq %rax, 0x8(%rsp)
je 0x813e
movq %rax, 0x8(%rsp)
movq %r12, %rdi
movq 0x180(%rsp), %rsi
callq 0x8370
movq 0x38(%rsp), %rax
movq 0x50(%rax), %rdx
movq 0xa0(%rax), %rsi
movq %r12, %rdi
callq 0x82d3
movq 0x38(%rsp), %rcx
movl 0x50(%rcx), %eax
subl 0xa0(%rcx), %eax
leaq 0xdc(%rsp), %rdx
movl %eax, -0x4(%rdx)
leaq 0xd8(%rsp), %rsi
movq %r12, %rdi
callq 0x82d3
leaq 0x472bb(%rip), %rsi     # 0x4f451
leaq 0x472c0(%rip), %rdx     # 0x4f45d
movq %r12, %rdi
callq 0x82d3
movb $0x1, %bl
movq %rsp, %rdi
callq 0x8b88
leaq 0x20(%rsp), %rdi
callq 0x8b88
movl %ebx, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x81db
jmp 0x81db
jmp 0x81db
jmp 0x81db
jmp 0x81ec
jmp 0x81db
jmp 0x81db
movq %rax, %rbx
movq %rsp, %rdi
callq 0x8b88
jmp 0x81ef
jmp 0x81ec
jmp 0x81ec
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x8b88
movq %rbx, %rdi
callq 0x4600