// File: /workspace/github_cpp_makefile_star2_O1/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 0xf8b7
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 0x24696
leaq 0x20(%rsp), %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x256c4
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0x4cc0c(%rip), %rdx     # 0x5c3d6
movq %rbx, %rsi
callq 0x10c65
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
subq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0x257a8
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xf7fe
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x8(%r15), %rsi
leaq 0x20(%rsp), %rdi
callq 0x2581e
movq 0x8(%r14), %rsi
leaq 0x20(%rsp), %rdi
callq 0x2581e
movq 0x178(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x2581e
movq 0x188(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x2581e
movq 0x50(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x2581e
movq %rbx, %rsi
testq %rbx, %rbx
je 0xf85a
movq 0x50(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movq 0x8(%rdi), %r14
callq 0x2581e
movq 0x28(%rsp), %rax
cmpq %rax, %r14
ja 0xf8e9
movq %rsp, %rcx
movq %r14, (%rcx)
movq %rax, 0x8(%rcx)
leaq 0x20(%rsp), %rdi
leaq 0x48(%rsp), %rsi
movq %rbx, %rdx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x25c50
leaq 0x20(%rsp), %rdi
callq 0x25782
leaq 0x48(%rsp), %rdi
callq 0x15abc
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0x10, %edi
callq 0x4190
movq %rax, %r14
leaq 0x4ca0d(%rip), %rsi     # 0x5c2d8
movq %rax, %rdi
callq 0x4110
movq 0x6c70e(%rip), %rsi     # 0x7bfe8
movq 0x6c6d7(%rip), %rdx     # 0x7bfb8
movq %r14, %rdi
callq 0x4590
leaq 0x4ca4d(%rip), %rdi     # 0x5c33d
leaq 0x4ca55(%rip), %rsi     # 0x5c34c
leaq 0x4ca86(%rip), %rcx     # 0x5c384
movl $0x6f, %edx
callq 0x4200
movq %rax, %rbx
movq %r14, %rdi
callq 0x4260
jmp 0xf94e
movq %rax, %rbx
jmp 0xf944
jmp 0xf937
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xf93a
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
jmp 0xf93a
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x25782
leaq 0x48(%rsp), %rdi
callq 0x15abc
movq %rbx, %rdi
callq 0x45e0