// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: serialize_single_compressed_diff(hpatch_TStreamInput const*, hpatch_TStreamInput const*, bool, hdiff_private::TCovers const&, hpatch_TStreamOutput const*, hdiff_TCompress const*, unsigned long)
static void serialize_single_compressed_diff(const hpatch_TStreamInput* newStream,const hpatch_TStreamInput* oldStream,
                                             bool isZeroSubDiff,const TCovers& covers,const hpatch_TStreamOutput* out_diff,
                                             const hdiff_TCompress* compressPlugin,size_t patchStepMemSize){
    check(patchStepMemSize>=hpatch_kStreamCacheSize);
    if (patchStepMemSize>newStream->streamSize){
        patchStepMemSize=(size_t)newStream->streamSize;
        if (patchStepMemSize<hpatch_kStreamCacheSize)
            patchStepMemSize=hpatch_kStreamCacheSize;
    }
    TStepStream stepStream(newStream,oldStream,isZeroSubDiff,covers,patchStepMemSize);
    
    TDiffStream outDiff(out_diff);
    {//type
        std::vector<TByte> out_type;
        _outType(out_type,compressPlugin,kHDiffSFVersionType);
        outDiff.pushBack(out_type.data(),out_type.size());
    }
    outDiff.packUInt(newStream->streamSize);
    outDiff.packUInt(oldStream->streamSize);
    outDiff.packUInt(stepStream.getCoverCount());
    outDiff.packUInt(stepStream.getMaxStepMemSize());
    outDiff.packUInt(stepStream.streamSize);
    TPlaceholder compressed_sizePos=outDiff.packUInt_pos(compressPlugin?stepStream.streamSize:0);
    outDiff.pushStream(&stepStream,compressPlugin,compressed_sizePos);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
movq 0x330(%rsp), %rax
cmpq $0xfff, %rax            # imm = 0xFFF
jbe 0xcf3a
movq %r9, %rbx
movq %r8, %r12
movq %rcx, %r8
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rdi), %rcx
cmpq $0x1001, %rcx           # imm = 0x1001
movl $0x1000, %r9d           # imm = 0x1000
cmovaeq %rcx, %r9
cmpq %rax, %rcx
cmovaeq %rax, %r9
movzbl %dl, %ecx
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1f7dc
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x20594
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
leaq 0x44696(%rip), %rdx     # 0x514fa
movq %rbx, %rsi
callq 0xe07a
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
subq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x205e2
leaq 0x30(%rsp), %rdi
callq 0x8b88
movq 0x8(%r15), %rsi
leaq 0x8(%rsp), %rdi
callq 0x20656
movq 0x8(%r14), %rsi
leaq 0x8(%rsp), %rdi
callq 0x20656
movq 0x178(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x20656
movq 0x188(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x20656
movq 0x50(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x20656
movq %rbx, %rsi
testq %rbx, %rbx
je 0xcee9
movq 0x50(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x11ece
leaq 0x30(%rsp), %rcx
movq %rax, (%rcx)
movq %rdx, 0x8(%rcx)
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
movq %rbx, %rdx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x20a6c
leaq 0x8(%rsp), %rdi
callq 0x205d8
leaq 0x48(%rsp), %rdi
callq 0x1224c
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r14
popq %r15
retq
pushq $0x10
popq %rdi
callq 0x41c0
movq %rax, %r14
leaq 0x443fd(%rip), %rsi     # 0x51349
movq %rax, %rdi
callq 0x4120
movq 0x6808d(%rip), %rsi     # 0x74fe8
movq 0x68056(%rip), %rdx     # 0x74fb8
movq %r14, %rdi
callq 0x45b0
movq %rax, %rbx
movq %r14, %rdi
callq 0x4290
jmp 0xcfa4
movq %rax, %rbx
jmp 0xcf9a
jmp 0xcf8d
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x8b88
jmp 0xcf90
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x205d8
leaq 0x48(%rsp), %rdi
callq 0x1224c
movq %rbx, %rdi
callq 0x4600