// File: sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/match_block.cpp
// Function: void hdiff_private::_getPackedCovers<false>(unsigned long long, std::vector<hpatch_TCover, std::allocator<hpatch_TCover>> const&, std::vector<hpatch_TCover, std::allocator<hpatch_TCover>>&)
static 
    void _getPackedCovers(hpatch_StreamPos_t dataSize,const std::vector<hpatch_TCover>& blockCovers,
                          std::vector<TPackedCover>& out_packedCovers){
        const hpatch_TCover* cover=blockCovers.data();
        const hpatch_TCover* cover_end=cover+blockCovers.size();
        hpatch_StreamPos_t dst=0;
        hpatch_StreamPos_t srcPos=0;
        for (;cover<cover_end;++cover){
            if (_cover_pos(isNew,cover)<=srcPos){
                srcPos=std::max(srcPos,_cover_pos(isNew,cover)+cover->length);
                continue;
            }
            hpatch_StreamPos_t moveLen=_cover_pos(isNew,cover)-srcPos;
            if (moveLen){
                TPackedCover pkcover={srcPos,dst,moveLen};
                out_packedCovers.push_back(pkcover);
                dst+=moveLen;
            }
            srcPos=_cover_pos(isNew,cover)+cover->length;
        }
        assert(dataSize>=srcPos);
        hpatch_StreamPos_t moveLen=dataSize-srcPos;
        if (moveLen){
            TPackedCover pkcover={srcPos,dst,moveLen};
            out_packedCovers.push_back(pkcover);
            dst+=moveLen;
        }
        //return dst;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x34630
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2c560
movq %rax, %rcx
movq -0x88(%rbp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x30c4c
movq -0x20(%rbp), %rax
movq (%rax), %rax
cmpq -0x38(%rbp), %rax
ja 0x30be1
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
addq 0x10(%rcx), %rax
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x34650
movq (%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x30c3b
movq -0x20(%rbp), %rax
movq (%rax), %rax
subq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x30c28
movq -0x38(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x2b840
movq -0x48(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
addq 0x10(%rcx), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x20(%rbp)
jmp 0x30b9d
movq -0x8(%rbp), %rax
cmpq -0x38(%rbp), %rax
jb 0x30c58
jmp 0x30c77
leaq 0x7f053(%rip), %rdi     # 0xafcb2
leaq 0x7efaf(%rip), %rsi     # 0xafc15
movl $0x43, %edx
leaq 0x7f051(%rip), %rcx     # 0xafcc3
callq 0x4270
movq -0x8(%rbp), %rax
subq -0x38(%rbp), %rax
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0x30cbb
movq -0x38(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x2b840
movq -0x68(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)