LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TCoversStream::TCoversStream(hdiff_private::TCovers const&, unsigned long long)
TCoversStream::TCoversStream(const TCovers& _covers,hpatch_StreamPos_t cover_buf_size)
:covers(_covers),curCodePos(0),curCodePos_end(0),
readedCoverCount(0),lastOldEnd(0),lastNewEnd(0),_readFromPos_back(0){
    assert(kCodeBufSize>=hpatch_kMaxPackedUIntBytes*3);
    _code_mem.realloc(kCodeBufSize);
    this->streamImport=this;
    this->streamSize=cover_buf_size;
    this->read=_read;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rdi, %rbx
movq %rsi, 0x20(%rdi)
leaq 0x28(%rdi), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x11e94
xorps %xmm0, %xmm0
movups %xmm0, 0x60(%rbx)
movups %xmm0, 0x50(%rbx)
movups %xmm0, 0x40(%rbx)
movl $0x80000, %esi          # imm = 0x80000
movq %r15, %rdi
callq 0x139d4
movq %rbx, (%rbx)
movq %r14, 0x8(%rbx)
leaq 0x1d(%rip), %rax        # 0x1eb16
movq %rax, 0x10(%rbx)
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %r15, %rdi
callq 0x13a5c
movq %rbx, %rdi
callq 0x4600
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TCoversStream::getDataSize(hdiff_private::TCovers const&)
hpatch_StreamPos_t TCoversStream::getDataSize(const TCovers& covers){
    size_t n=covers.coverCount();
    hpatch_StreamPos_t cover_buf_size=0;
    hpatch_StreamPos_t lastOldEnd=0;
    hpatch_StreamPos_t lastNewEnd=0;
    for (size_t i=0; i<n; ++i) {
        TCover cover;
        covers.covers(i,&cover);
        assert(cover.newPos>=lastNewEnd);
        __private_packCover(hpatch_StreamPos_t,_packUIntWithTag_size,_packUInt_size,
                            &cover_buf_size,0,cover,lastOldEnd,lastNewEnd);
        lastOldEnd=cover.oldPos+cover.length;//! +length
        lastNewEnd=cover.newPos+cover.length;
    }
    return cover_buf_size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, (%rsp)
movq 0x18(%rdi), %r13
pushq $0x8
popq %rbp
xorl %eax, %eax
xorl %r8d, %r8d
xorl %ecx, %ecx
subq $0x1, %r13
jb 0x1ee09
movq %rax, 0x10(%rsp)
movq (%rsp), %rsi
movq 0x10(%rsi), %rdx
cmpb $0x1, 0x20(%rsi)
jne 0x1ed94
movl -0x8(%rdx,%rbp), %ebx
movl -0x4(%rdx,%rbp), %r14d
movl (%rdx,%rbp), %r15d
jmp 0x1eda2
movq -0x10(%rdx,%rbp,2), %rbx
movq -0x8(%rdx,%rbp,2), %r14
movq (%rdx,%rbp,2), %r15
movq %r14, %r12
subq %rcx, %r12
jb 0x1ee18
movq %rbx, %rcx
subq %r8, %rcx
negq %rcx
movq %rbx, %rdi
subq %r8, %rdi
cmovbq %rcx, %rdi
pushq $0x1
popq %rsi
callq 0x3a58c
movl %eax, %eax
movq %rax, 0x8(%rsp)
movq %r12, %rdi
xorl %esi, %esi
callq 0x3a58c
movl %eax, %eax
movq 0x10(%rsp), %r12
addq %rax, %r12
movq %r15, %rdi
xorl %esi, %esi
callq 0x3a58c
movl %eax, %eax
addq %r12, %rax
addq 0x8(%rsp), %rax
addq %r15, %rbx
addq %r15, %r14
addq $0xc, %rbp
movq %rbx, %r8
movq %r14, %rcx
jmp 0x1ed68
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x336b9(%rip), %rdi     # 0x524d8
leaq 0x3356b(%rip), %rsi     # 0x52391
leaq 0x336c4(%rip), %rcx     # 0x524f1
movl $0xa6, %edx
callq 0x4230
nop
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TNewDataDiffStream::_initByRange(unsigned long, unsigned long long, unsigned long long)
void TNewDataDiffStream::_initByRange(size_t coveri,hpatch_StreamPos_t newDataPos,hpatch_StreamPos_t newDataPosEnd){
    _init(getDataSizeByRange(covers,coveri,newDataPos,newDataPosEnd));
    _coveri=coveri;
    _newDataPos=newDataPos;

    readedCoverCount=_coveri;
    lastNewEnd=_newDataPos;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x20(%rdi), %rdi
callq 0x1f024
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%r15)
andq $0x0, 0x50(%r15)
movups %xmm0, 0x30(%r15)
movq %r15, (%r15)
movq %rax, 0x8(%r15)
leaq -0x1a1(%rip), %rax      # 0x1ee64
movq %rax, 0x10(%r15)
andq $0x0, 0x18(%r15)
movq %r14, 0x58(%r15)
movq %rbx, 0x60(%r15)
movq %r14, 0x48(%r15)
movq %rbx, 0x40(%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TNewDataDiffStream::getDataSizeByRange(hdiff_private::TCovers const&, unsigned long, unsigned long long, unsigned long long)
hpatch_StreamPos_t TNewDataDiffStream::getDataSizeByRange(const TCovers& covers,size_t coveri,
                                                          hpatch_StreamPos_t newDataPos,hpatch_StreamPos_t newDataPosEnd){
    size_t n=covers.coverCount();
    hpatch_StreamPos_t newDataDiff_size=0;
    hpatch_StreamPos_t lastNewEnd=newDataPos;
    for (size_t i=coveri;i<n;++i) {
        TCover cover;
        covers.covers(i,&cover);
        assert(cover.newPos>=lastNewEnd);
        hpatch_StreamPos_t inc=cover.newPos-lastNewEnd;
        if (lastNewEnd+inc>=newDataPosEnd)
            inc=newDataPosEnd-lastNewEnd;
        newDataDiff_size+=inc;
        if (lastNewEnd+inc==newDataPosEnd)
            return newDataDiff_size;
        lastNewEnd=cover.newPos+cover.length;
        if (lastNewEnd>=newDataPosEnd)
            return newDataDiff_size;
    }

    assert(newDataPosEnd>=lastNewEnd);
    hpatch_StreamPos_t inc=newDataPosEnd-lastNewEnd;
    newDataDiff_size+=inc;
    return newDataDiff_size;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x10(%rdi), %r8
movq 0x18(%rdi), %r9
movb 0x20(%rdi), %dil
imulq $0xc, %rsi, %r11
addq $0x8, %r11
decq %rsi
xorl %eax, %eax
incq %rsi
cmpq %r9, %rsi
jae 0x1f091
leaq 0xc(%r11), %r10
testb $0x1, %dil
je 0x1f05e
movl -0x4(%r8,%r11), %ebx
movl (%r8,%r11), %r11d
jmp 0x1f067
movq -0x20(%r8,%r10,2), %rbx
movq (%r8,%r11,2), %r11
cmpq %rdx, %rbx
jb 0x1f0a4
cmpq %rcx, %rbx
movq %rcx, %r14
cmovbq %rbx, %r14
subq %rdx, %r14
addq %r14, %rax
cmpq %rcx, %rbx
jae 0x1f09c
addq %r11, %rbx
movq %r10, %r11
movq %rbx, %rdx
cmpq %rcx, %rbx
jb 0x1f041
jmp 0x1f09c
cmpq %rcx, %rdx
ja 0x1f0c3
addq %rcx, %rax
subq %rdx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x3342d(%rip), %rdi     # 0x524d8
leaq 0x332df(%rip), %rsi     # 0x52391
leaq 0x3356c(%rip), %rcx     # 0x52625
movl $0xf9, %edx
callq 0x4230
leaq 0x335ec(%rip), %rdi     # 0x526b6
leaq 0x332c0(%rip), %rsi     # 0x52391
leaq 0x3354d(%rip), %rcx     # 0x52625
movl $0x105, %edx            # imm = 0x105
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TNewDataDiffStream::getDataSize(hdiff_private::TCovers const&, unsigned long long)
hpatch_StreamPos_t TNewDataDiffStream::getDataSize(const TCovers& covers,hpatch_StreamPos_t newDataSize){
    size_t n=covers.coverCount();
    hpatch_StreamPos_t newDataDiff_size=0;
    hpatch_StreamPos_t lastNewEnd=0;
    for (size_t i=0; i<n; ++i) {
        TCover cover;
        covers.covers(i,&cover);
        assert(cover.newPos>=lastNewEnd);
        newDataDiff_size+=(hpatch_StreamPos_t)(cover.newPos-lastNewEnd);
        lastNewEnd=cover.newPos+cover.length;
    }
    assert(newDataSize>=lastNewEnd);
    newDataDiff_size+=(hpatch_StreamPos_t)(newDataSize-lastNewEnd);
    return newDataDiff_size;
}

// Assembly:
pushq %rax
movq 0x10(%rdi), %rcx
movq 0x18(%rdi), %rdx
movb 0x20(%rdi), %dil
pushq $0x8
popq %r8
xorl %eax, %eax
xorl %r9d, %r9d
subq $0x1, %rdx
jb 0x1f12f
testb $0x1, %dil
je 0x1f10f
movl -0x4(%rcx,%r8), %r11d
movl (%rcx,%r8), %r10d
jmp 0x1f118
movq -0x8(%rcx,%r8,2), %r11
movq (%rcx,%r8,2), %r10
cmpq %r9, %r11
jb 0x1f13c
subq %r9, %rax
addq %r11, %rax
addq %r11, %r10
addq $0xc, %r8
movq %r10, %r9
jmp 0x1f0f8
cmpq %rsi, %r9
ja 0x1f15b
addq %rsi, %rax
subq %r9, %rax
popq %rcx
retq
leaq 0x33395(%rip), %rdi     # 0x524d8
leaq 0x33247(%rip), %rsi     # 0x52391
leaq 0x3357f(%rip), %rcx     # 0x526d0
movl $0x112, %edx            # imm = 0x112
callq 0x4230
leaq 0x335dc(%rip), %rdi     # 0x5273e
leaq 0x33228(%rip), %rsi     # 0x52391
leaq 0x33560(%rip), %rcx     # 0x526d0
movl $0x116, %edx            # imm = 0x116
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TNewDataSubDiffStream::TNewDataSubDiffStream(hpatch_TStreamInput const*, hpatch_TStreamInput const*, hdiff_private::TCovers const&, bool, bool)
TNewDataSubDiffStream::TNewDataSubDiffStream(const hdiff_TStreamInput* _newData,const hdiff_TStreamInput* _oldData,
                                             const TCovers& _covers,bool _isOnlySubCover,bool _isZeroSubDiff)
:newData(_newData),oldData(_oldData),covers(_covers),
  isOnlySubCover(_isOnlySubCover),isZeroSubDiff(_isZeroSubDiff),_cache(kSubDiffCacheSize){
    initRead();
    streamImport=this;
    if (isOnlySubCover){
        streamSize=0;
        for (size_t i=0;i<covers.coverCount();++i){
            hpatch_TCover cover;
            covers.covers(i,&cover);
            streamSize+=cover.length;
        }
    }else{
        streamSize=newData->streamSize;
    }
    read=_read;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq %rsi, 0x48(%rdi)
movq %rdx, 0x50(%rdi)
movq %rcx, 0x58(%rdi)
movb %r8b, 0x60(%rdi)
movb %r9b, 0x61(%rdi)
addq $0x68, %rdi
movl $0x80000, %esi          # imm = 0x80000
callq 0x11e94
andq $0x0, 0x20(%rbx)
orq $-0x1, 0x28(%rbx)
xorps %xmm0, %xmm0
andq $0x0, 0x40(%rbx)
movups %xmm0, 0x30(%rbx)
movq %rbx, (%rbx)
cmpb $0x1, 0x60(%rbx)
jne 0x1f1f7
andq $0x0, 0x8(%rbx)
movq 0x58(%rbx), %rax
movq 0x18(%rax), %rcx
pushq $0x8
popq %rdx
xorl %esi, %esi
subq $0x1, %rcx
jb 0x1f203
movq 0x10(%rax), %rdi
cmpb $0x1, 0x20(%rax)
jne 0x1f1e6
movl (%rdi,%rdx), %edi
jmp 0x1f1ea
movq (%rdi,%rdx,2), %rdi
addq %rdi, %rsi
movq %rsi, 0x8(%rbx)
addq $0xc, %rdx
jmp 0x1f1d1
movq 0x48(%rbx), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rbx)
leaq 0x1e(%rip), %rax        # 0x1f228
movq %rax, 0x10(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TNewDataSubDiffStream::_read(hpatch_TStreamInput const*, unsigned long long, unsigned char*, unsigned char*)
hpatch_BOOL TNewDataSubDiffStream::_read(const struct hpatch_TStreamInput* stream,hpatch_StreamPos_t readFromPos,
                                             unsigned char* out_data,unsigned char* out_data_end){
    TNewDataSubDiffStream* self=(TNewDataSubDiffStream*)stream->streamImport;
    if (readFromPos==0) self->initRead();
    if (readFromPos!=self->curReadPos) return hpatch_FALSE;
    self->curReadPos+=(size_t)(out_data_end-out_data);
    assert(self->curReadPos<=self->streamSize);
    self->readTo(out_data,out_data_end);
    return hpatch_TRUE;
}

// Assembly:
pushq %rax
movq (%rdi), %rdi
testq %rsi, %rsi
je 0x1f237
movq 0x30(%rdi), %r8
jmp 0x1f250
andq $0x0, 0x20(%rdi)
orq $-0x1, 0x28(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rdi)
andq $0x0, 0x40(%rdi)
xorl %r8d, %r8d
xorl %eax, %eax
cmpq %rsi, %r8
jne 0x1f278
movq %rcx, %rax
subq %rdx, %rax
addq %rsi, %rax
movq %rax, 0x30(%rdi)
cmpq 0x8(%rdi), %rax
ja 0x1f27a
movq %rdx, %rsi
movq %rcx, %rdx
callq 0x1f29a
pushq $0x1
popq %rax
popq %rcx
retq
leaq 0x33595(%rip), %rdi     # 0x52816
leaq 0x33109(%rip), %rsi     # 0x52391
leaq 0x335aa(%rip), %rcx     # 0x52839
movl $0x178, %edx            # imm = 0x178
callq 0x4230
nop
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TNewDataSubDiffCoverStream::TNewDataSubDiffCoverStream(hpatch_TStreamInput const*, hpatch_TStreamInput const*, bool)
TNewDataSubDiffCoverStream::TNewDataSubDiffCoverStream(const hpatch_TStreamInput* _newStream,
                                                       const hpatch_TStreamInput* _oldStream,
                                                       bool _isZeroSubDiff)
:isZeroSubDiff(_isZeroSubDiff),newStream(_newStream),oldStream(_oldStream),
newData(0),oldData(0),_cache(_isZeroSubDiff?0:kSubDiffCacheSize*2){
    setCover(cover,0,0,0);
    streamImport=this;
    read=_read;
    if (!isZeroSubDiff){
        newData=_cache.data();
        oldData=_cache.data()+kSubDiffCacheSize;
    }
    initRead();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movb %cl, 0x20(%rdi)
movq %rsi, 0x38(%rdi)
movq %rdx, 0x40(%rdi)
addq $0x70, %rdi
xorb $0x1, %cl
movzbl %cl, %esi
shll $0x14, %esi
xorps %xmm0, %xmm0
movups %xmm0, 0x60(%rbx)
callq 0x11e94
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%rbx)
andq $0x0, 0x58(%rbx)
movq %rbx, (%rbx)
leaq 0x28(%rip), %rax        # 0x1f5e8
movq %rax, 0x10(%rbx)
cmpb $0x0, 0x20(%rbx)
jne 0x1f5dc
movq 0x70(%rbx), %rax
movq %rax, 0x60(%rbx)
addq $0x80000, %rax          # imm = 0x80000
movq %rax, 0x68(%rbx)
andq $0x0, 0x8(%rbx)
movups %xmm0, 0x28(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TNewDataSubDiffCoverStream::resetCoverLen(unsigned long long)
void TNewDataSubDiffCoverStream::resetCoverLen(hpatch_StreamPos_t coverLen){
    const hpatch_StreamPos_t skipLen=cover.length-(curDataLen+inStreamLen);
    if (coverLen<=skipLen){ // all cache data invalid
        cover.length=coverLen;
        initRead();
    }else{
        if (coverLen<skipLen+curDataLen)
            curDataLen=(size_t)(coverLen-skipLen);
        inStreamLen=coverLen-(skipLen+curDataLen);
        cover.length=coverLen;
        streamSize=coverLen;
    }
}

// Assembly:
movq 0x30(%rdi), %rcx
movq 0x58(%rdi), %rax
movq 0x28(%rdi), %rdx
addq %rcx, %rdx
subq %rdx, %rax
movq %rsi, %rdx
subq %rax, %rdx
jbe 0x1f678
addq %rcx, %rax
cmpq %rsi, %rax
jbe 0x1f665
movq %rdx, 0x30(%rdi)
movq %rsi, %rax
movq %rsi, %rcx
subq %rax, %rcx
movq %rcx, 0x28(%rdi)
movq %rsi, 0x58(%rdi)
movq %rsi, 0x8(%rdi)
retq
movq %rsi, 0x58(%rdi)
movq %rsi, 0x8(%rdi)
movq %rsi, 0x28(%rdi)
andq $0x0, 0x30(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TNewDataSubDiffCoverStream::readTo(unsigned long long, unsigned char*, unsigned char*)
hpatch_BOOL TNewDataSubDiffCoverStream::readTo(hpatch_StreamPos_t readFromPos,
                                               unsigned char* out_data,unsigned char* out_data_end){
    // newStream:[       |                                          |              ]
    //              cover.newPos                        cover.newPos+cover.length
    // _cache:           |  skipLen  [  curDataLen  ]  inStreamLen  |
    //                                          |
    //                                     readFromPos   
    while (out_data!=out_data_end){
        hpatch_StreamPos_t skipLen=cover.length-(curDataLen+inStreamLen);
        if ((readFromPos<skipLen)||(readFromPos>=(skipLen+curDataLen))){
            if (!_updateCache(readFromPos)) return hpatch_FALSE;
            skipLen=cover.length-(curDataLen+inStreamLen);
        }
        size_t srcPos=(size_t)(readFromPos-skipLen);
        size_t len=std::min((size_t)(curDataLen-srcPos),(size_t)(out_data_end-out_data));
        for (size_t i=0;i<len;i++)
            out_data[i]=newData[srcPos+i]-oldData[srcPos+i];
        readFromPos+=len;
        out_data+=len;
    }
    return hpatch_TRUE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
pushq $0x1
popq %rbx
cmpq %r14, %r15
je 0x1f736
movq 0x30(%r13), %rax
movq 0x58(%r13), %rcx
movq 0x28(%r13), %rdx
addq %rax, %rdx
subq %rdx, %rcx
cmpq %rcx, %r12
jb 0x1f6cb
leaq (%rcx,%rax), %rdx
cmpq %rdx, %r12
jb 0x1f6ec
movq %r13, %rdi
movq %r12, %rsi
callq 0x1f742
testl %eax, %eax
je 0x1f734
movq 0x30(%r13), %rax
movq 0x58(%r13), %rcx
movq 0x28(%r13), %rdx
addq %rax, %rdx
subq %rdx, %rcx
movq %r12, %rdx
subq %rcx, %rdx
subq %rdx, %rax
movq %r14, %rcx
subq %r15, %rcx
cmpq %rax, %rcx
cmovaeq %rax, %rcx
movq %r15, %rax
movq %rcx, %rsi
subq $0x1, %rsi
jb 0x1f729
movq 0x60(%r13), %rdi
movq 0x68(%r13), %r8
movb (%rdi,%rdx), %dil
subb (%r8,%rdx), %dil
movb %dil, (%rax)
incq %rdx
incq %rax
jmp 0x1f708
addq %rcx, %r12
addq %rcx, %r15
jmp 0x1f6a2
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TNewDataSubDiffCoverStream::_updateCache(unsigned long long)
hpatch_BOOL TNewDataSubDiffCoverStream::_updateCache(hpatch_StreamPos_t readFromPos){
    assert(readFromPos<cover.length);
    curDataLen=kSubDiffCacheSize;
    if (curDataLen+readFromPos>cover.length)
        curDataLen=(size_t)(cover.length-readFromPos);
    inStreamLen=cover.length-(curDataLen+readFromPos);
    if (!newStream->read(newStream,cover.newPos+readFromPos,newData,newData+curDataLen))
        return hpatch_FALSE;
    if (!oldStream->read(oldStream,cover.oldPos+readFromPos,oldData,oldData+curDataLen))
        return hpatch_FALSE;
    return hpatch_TRUE;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x58(%rdi), %rax
movq %rax, %rcx
subq %rsi, %rcx
jbe 0x1f7bc
movq %rsi, %rbx
movq %rdi, %r14
movl $0x80000, %edx          # imm = 0x80000
addq %rdx, %rsi
cmpq %rax, %rsi
cmovbeq %rdx, %rcx
movq %rcx, 0x30(%rdi)
subq %rcx, %rax
subq %rbx, %rax
movq %rax, 0x28(%rdi)
movq 0x50(%rdi), %rsi
addq %rbx, %rsi
movq 0x38(%rdi), %rdi
movq 0x60(%r14), %rdx
addq %rdx, %rcx
callq *0x10(%rdi)
testl %eax, %eax
je 0x1f7b2
addq 0x48(%r14), %rbx
movq 0x40(%r14), %rdi
movq 0x68(%r14), %rdx
movq 0x30(%r14), %rcx
addq %rdx, %rcx
movq %rbx, %rsi
callq *0x10(%rdi)
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
setne %al
jmp 0x1f7b4
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x3310f(%rip), %rdi     # 0x528d2
leaq 0x32bc7(%rip), %rsi     # 0x52391
leaq 0x3311a(%rip), %rcx     # 0x528eb
movl $0x1ce, %edx            # imm = 0x1CE
callq 0x4230
nop
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TStepStream::TStepStream(hpatch_TStreamInput const*, hpatch_TStreamInput const*, bool, hdiff_private::TCovers const&, unsigned long)
TStepStream::TStepStream(const hpatch_TStreamInput* newStream,const hpatch_TStreamInput* oldStream,
                         bool isZeroSubDiff,const TCovers& _covers,size_t _patchStepMemSize)
:subDiff(newStream,oldStream,isZeroSubDiff),newDataDiff(_covers,newStream),
covers(_covers),patchStepMemSize(_patchStepMemSize),newDataSize(newStream->streamSize),
readFromPosBack(0),readBufPos(0){
    initStream();
    streamImport=this;
    read=_read;
    streamSize=sumBufSize_forInit;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r14
movq %r8, %r15
movq %rsi, %r12
movq %rdi, %rbx
addq $0x20, %rdi
callq 0x1f582
leaq 0xa8(%rbx), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x120bc
movq %r15, 0x110(%rbx)
movq %r14, 0x118(%rbx)
movq 0x8(%r12), %rax
movq %rax, 0x120(%rbx)
andq $0x0, 0x258(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x248(%rbx)
leaq 0x260(%rbx), %r15
movups %xmm0, 0x158(%rbx)
movups %xmm0, 0x168(%rbx)
movups %xmm0, 0x178(%rbx)
movups %xmm0, 0x188(%rbx)
movups %xmm0, 0x198(%rbx)
movq %r15, %rdi
callq 0x210c0
xorps %xmm0, %xmm0
movups %xmm0, 0x2b0(%rbx)
movq %rbx, %rdi
callq 0x1f8f6
movq %rbx, (%rbx)
leaq 0xc1(%rip), %rax        # 0x1f946
movq %rax, 0x10(%rbx)
movq 0x238(%rbx), %rax
movq %rax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq %r15, %rdi
callq 0x11ebe
jmp 0x1f8b0
movq %rax, %r14
leaq 0x158(%rbx), %r15
leaq 0x170(%rbx), %r12
leaq 0x248(%rbx), %rdi
callq 0x8b88
movq %r12, %rdi
callq 0x12290
movq %r15, %rdi
callq 0x8b88
jmp 0x1f8df
movq %rax, %r14
addq $0x90, %rbx
movq %rbx, %rdi
callq 0x13a5c
movq %r14, %rdi
callq 0x4600
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TStepStream::initStream()
void TStepStream::initStream(){
    isInInit=true;
    sumBufSize_forInit=0;
    beginStep();
    while(doStep()) { }
    isInInit=false;
    endCoverCount=curCoverCount;
    endMaxStepMemSize=curMaxStepMemSize;
    beginStep();
    //assert(buf.empty());
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movb $0x1, 0x230(%rdi)
andq $0x0, 0x238(%rdi)
callq 0x1f9dc
movq %rbx, %rdi
callq 0x1fb0c
testb %al, %al
jne 0x1f90e
movb $0x0, 0x230(%rbx)
movq 0x128(%rbx), %rax
movq 0x138(%rbx), %rcx
movq %rax, 0x130(%rbx)
movq %rcx, 0x140(%rbx)
movq %rbx, %rdi
popq %rbx
jmp 0x1f9dc
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TStepStream::_read(hpatch_TStreamInput const*, unsigned long long, unsigned char*, unsigned char*)
hpatch_BOOL TStepStream::_read(const hpatch_TStreamInput* stream,hpatch_StreamPos_t readFromPos,
                               unsigned char* out_data,unsigned char* out_data_end){
    TStepStream* self=(TStepStream*)stream->streamImport;
    if (readFromPos!=self->readFromPosBack){
        check(readFromPos==0);
        self->beginStep();
    }
    self->readFromPosBack=readFromPos+(size_t)(out_data_end-out_data);
    return self->readTo(out_data,out_data_end);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq (%rdi), %r12
cmpq %rsi, 0x2b0(%r12)
je 0x1f971
testq %r15, %r15
jne 0x1f998
movq %r12, %rdi
callq 0x1f9dc
subq %r14, %r15
addq %rbx, %r15
movq %r15, 0x2b0(%r12)
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1ffa2
pushq $0x10
popq %rdi
callq 0x41c0
movq %rax, %rbx
leaq 0x32fb4(%rip), %rsi     # 0x5295e
movq %rax, %rdi
callq 0x4120
movq 0x5562f(%rip), %rsi     # 0x74fe8
movq 0x555f8(%rip), %rdx     # 0x74fb8
movq %rbx, %rdi
callq 0x45b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x4290
movq %r14, %rdi
callq 0x4600
nop
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TStepStream::beginStep()
void TStepStream::beginStep(){
    curCoverCount=covers.coverCount();
    isHaveLeftCover=false;
    isHaveRightCover=false;
    isHaveLastCover=false;
    if (curCoverCount==0){
        isHaveLastCover=true;
        setCover(lastCover,0,newDataSize,0);
    }else{
        TCover back;
        covers.covers(curCoverCount-1,&back);
        if (back.newPos+back.length<newDataSize){
            isHaveLastCover=true;
            setCover(lastCover,back.oldPos+back.length,newDataSize,0);
        }
    }
    if (isHaveLastCover) ++curCoverCount;

    step_buf.clear();
    step_dataDiff.clear();
    readBufPos=0;
    curMaxStepMemSize=0;
    lastOldEnd=0;
    lastNewEnd=0;
    step_bufCover.clear();
    step_bufCover_size=0;
    step_bufRle.clear();
    step_dataDiffSize=0;
    newDataDiffReadPos=0;
    cur_i=0;
    pCurCover=0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x110(%rdi), %rcx
movq 0x18(%rcx), %rax
movq %rax, 0x128(%rdi)
movb $0x0, 0x1ba(%rdi)
andw $0x0, 0x1b8(%rdi)
testq %rax, %rax
je 0x1fa25
leaq -0x1(%rax), %rsi
movq 0x10(%rcx), %rdx
cmpb $0x1, 0x20(%rcx)
jne 0x1fa3d
imulq $0xc, %rsi, %rdi
movl (%rdx,%rdi), %ecx
movl 0x4(%rdx,%rdi), %esi
movl 0x8(%rdx,%rdi), %edx
jmp 0x1fa4f
movb $0x1, 0x1b8(%rbx)
movq 0x120(%rbx), %rdi
andq $0x0, 0x1c0(%rbx)
jmp 0x1fa6f
imulq $0x18, %rsi, %rdi
movq (%rdx,%rdi), %rcx
movq 0x8(%rdx,%rdi), %rsi
movq 0x10(%rdx,%rdi), %rdx
addq %rdx, %rsi
movq 0x120(%rbx), %rdi
cmpq %rdi, %rsi
jae 0x1fa88
movb $0x1, 0x1b8(%rbx)
addq %rdx, %rcx
movq %rcx, 0x1c0(%rbx)
movq %rdi, 0x1c8(%rbx)
andq $0x0, 0x1d0(%rbx)
incq %rax
movq %rax, 0x128(%rbx)
movq 0x248(%rbx), %rax
cmpq %rax, 0x250(%rbx)
je 0x1fa9f
movq %rax, 0x250(%rbx)
leaq 0x260(%rbx), %rdi
callq 0x13a7a
andq $0x0, 0x2b8(%rbx)
andq $0x0, 0x138(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x148(%rbx)
movq 0x158(%rbx), %rax
cmpq %rax, 0x160(%rbx)
je 0x1fadc
movq %rax, 0x160(%rbx)
andq $0x0, 0x240(%rbx)
leaq 0x170(%rbx), %rdi
callq 0x210ca
andq $0x0, 0x208(%rbx)
andq $0x0, 0x228(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x1a8(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TStepStream::_last_flush_step()
void TStepStream::_last_flush_step(){
    if (step_bufCover_size>0){
        step_dataDiff.reset(&newDataDiff,newDataDiffReadPos-step_dataDiffSize,newDataDiffReadPos);
        step_dataDiffSize=0;
        _flush_step_code();
    }else{
        assert(step_dataDiff.streamSize==0);
        assert(step_dataDiffSize==0);
    }
    assert(curMaxStepMemSize<=patchStepMemSize);
    assert(newDataDiffReadPos==newDataDiff.streamSize);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x240(%rdi)
je 0x20190
leaq 0x260(%rbx), %rdi
leaq 0xa8(%rbx), %rsi
movq 0x1b0(%rbx), %rcx
movq %rcx, %rdx
subq 0x1a8(%rbx), %rdx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x202da
andq $0x0, 0x1a8(%rbx)
movq %rbx, %rdi
callq 0x203a6
jmp 0x201a4
cmpq $0x0, 0x268(%rbx)
jne 0x20204
cmpq $0x0, 0x1a8(%rbx)
jne 0x20223
movq 0x138(%rbx), %rax
cmpq 0x118(%rbx), %rax
ja 0x201c6
movq 0x1b0(%rbx), %rax
cmpq 0xb0(%rbx), %rax
jne 0x201e5
popq %rbx
retq
leaq 0x3285b(%rip), %rdi     # 0x52a28
leaq 0x321bd(%rip), %rsi     # 0x52391
leaq 0x32804(%rip), %rcx     # 0x529df
movl $0x2a3, %edx            # imm = 0x2A3
callq 0x4230
leaq 0x32860(%rip), %rdi     # 0x52a4c
leaq 0x3219e(%rip), %rsi     # 0x52391
leaq 0x327e5(%rip), %rcx     # 0x529df
movl $0x2a4, %edx            # imm = 0x2A4
callq 0x4230
leaq 0x327b8(%rip), %rdi     # 0x529c3
leaq 0x3217f(%rip), %rsi     # 0x52391
leaq 0x327c6(%rip), %rcx     # 0x529df
movl $0x2a0, %edx            # imm = 0x2A0
callq 0x4230
leaq 0x327e9(%rip), %rdi     # 0x52a13
leaq 0x32160(%rip), %rsi     # 0x52391
leaq 0x327a7(%rip), %rcx     # 0x529df
movl $0x2a1, %edx            # imm = 0x2A1
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TStreamClip::reset(hpatch_TStreamInput const*, unsigned long long, unsigned long long, hpatch_TDecompress*, unsigned long long)
void TStreamClip::reset(const hpatch_TStreamInput* stream,
                        hpatch_StreamPos_t clipBeginPos,hpatch_StreamPos_t clipEndPos,
                        hpatch_TDecompress* decompressPlugin,hpatch_StreamPos_t uncompressSize){
    clear();
    assert(clipBeginPos<=clipEndPos);
    assert(clipEndPos<=stream->streamSize);
    _src=stream;
    _src_begin=clipBeginPos;
    _src_end=clipEndPos;
    _decompressPlugin=decompressPlugin;
    _decompressHandle=0;
    _read_uncompress_pos=0;
    if ((uncompressSize==0)&&(decompressPlugin==0))
        uncompressSize=clipEndPos-clipBeginPos;
    this->streamImport=this;
    this->streamSize=uncompressSize;
    this->read=_clip_read;

    if (decompressPlugin)
        openDecompressHandle();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r15
movq %r8, %r14
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %rbx
callq 0x13a7a
movq %r12, %rax
subq %r13, %rax
jb 0x20367
cmpq %r12, 0x8(%rbp)
jb 0x20386
movq %rbp, 0x20(%rbx)
movq %r13, 0x28(%rbx)
movq %r12, 0x30(%rbx)
movq %r14, %rcx
orq %r15, %rcx
cmovneq %r15, %rax
movq %r14, 0x38(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rbx)
movq %rbx, (%rbx)
movq %rax, 0x8(%rbx)
leaq 0x8e3(%rip), %rax       # 0x20c1c
movq %rax, 0x10(%rbx)
testq %r14, %r14
je 0x20358
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20d4c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x32aa1(%rip), %rdi     # 0x52e0f
leaq 0x3201c(%rip), %rsi     # 0x52391
leaq 0x32aac(%rip), %rcx     # 0x52e28
movl $0x32a, %edx            # imm = 0x32A
callq 0x4230
leaq 0x32b31(%rip), %rdi     # 0x52ebe
leaq 0x31ffd(%rip), %rsi     # 0x52391
leaq 0x32a8d(%rip), %rcx     # 0x52e28
movl $0x32b, %edx            # imm = 0x32B
callq 0x4230
nop
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TStepStream::_flush_step_code()
void TStepStream::_flush_step_code() {
    step_bufRle.finishAppend();
    const size_t curStepMemSize=step_bufCover_size+step_bufRle.fixed_code.size();
    if (curMaxStepMemSize<curStepMemSize)
        curMaxStepMemSize=curStepMemSize;
    if (isInInit){
        assert(step_buf.empty());
        sumBufSize_forInit+=hpatch_packUInt_size(step_bufCover_size) +
                            hpatch_packUInt_size(step_bufRle.curCodeSize())+
                            curStepMemSize + step_dataDiff.streamSize;
    }else{
        //step head
        assert(step_bufCover_size==step_bufCover.size());
        packUInt(step_buf,step_bufCover.size());
        packUInt(step_buf,step_bufRle.curCodeSize());
        //step cache data
        pushBack(step_buf,step_bufCover);            
        pushBack(step_buf,step_bufRle.fixed_code);
    }
    step_bufCover_size=0;
    step_bufCover.clear();
    step_bufRle.clear();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %r14
leaq 0x170(%rdi), %rbx
movq %rbx, %rdi
callq 0x17aa0
movq 0x178(%r14), %r15
subq 0x170(%r14), %r15
movq 0x240(%r14), %rdx
addq %rdx, %r15
cmpq %r15, 0x138(%r14)
jae 0x203ec
movq %r15, 0x138(%r14)
cmpb $0x1, 0x230(%r14)
jne 0x20440
movq 0x248(%r14), %rax
cmpq 0x250(%r14), %rax
jne 0x204ff
movq %rdx, %rdi
xorl %esi, %esi
callq 0x3a58c
movl %eax, %ebp
movq %rbx, %rdi
callq 0x210ec
movq %rax, %rdi
xorl %esi, %esi
callq 0x3a58c
addl %ebp, %eax
addq 0x268(%r14), %r15
addq %rax, %r15
addq %r15, 0x238(%r14)
jmp 0x204cb
movq 0x160(%r14), %rax
subq 0x158(%r14), %rax
cmpq %rax, %rdx
jne 0x2051e
leaq 0xd(%rsp), %rax
leaq 0x18(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x18(%rsp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3a508
testl %eax, %eax
je 0x2053d
leaq 0x158(%r14), %r15
leaq 0x248(%r14), %r12
movq 0x250(%r14), %rsi
movq 0x18(%rsp), %rcx
leaq 0xd(%rsp), %rdx
movq %r12, %rdi
callq 0x85ae
movq %rbx, %rdi
callq 0x210ec
movq %r12, %rdi
movq %rax, %rsi
callq 0x202d0
movq %r12, %rdi
movq %r15, %rsi
callq 0x20580
movq %r12, %rdi
movq %rbx, %rsi
callq 0x20580
andq $0x0, 0x240(%r14)
movq 0x158(%r14), %rax
cmpq %rax, 0x160(%r14)
je 0x204ea
movq %rax, 0x160(%r14)
movq %rbx, %rdi
callq 0x210ca
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x32571(%rip), %rdi     # 0x52a77
leaq 0x31e84(%rip), %rsi     # 0x52391
leaq 0x32574(%rip), %rcx     # 0x52a88
movl $0x2ad, %edx            # imm = 0x2AD
callq 0x4230
leaq 0x32597(%rip), %rdi     # 0x52abc
leaq 0x31e65(%rip), %rsi     # 0x52391
leaq 0x32555(%rip), %rcx     # 0x52a88
movl $0x2b3, %edx            # imm = 0x2B3
callq 0x4230
pushq $0x10
popq %rdi
callq 0x41c0
movq %rax, %rbx
leaq 0x2eeb1(%rip), %rsi     # 0x4f400
movq %rax, %rdi
callq 0x4120
movq 0x54a8a(%rip), %rsi     # 0x74fe8
movq 0x54a53(%rip), %rdx     # 0x74fb8
movq %rbx, %rdi
callq 0x45b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x4290
movq %r14, %rdi
callq 0x4600
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TDiffStream::pushBack(unsigned char const*, unsigned long)
void TDiffStream::pushBack(const unsigned char* src,size_t n){
    if (n==0) return;
    checki(out_diff->write(out_diff,writePos,src,src+n),
           "TDiffStream::pushBack() write stream error!");
    writePos+=n;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
testq %rdx, %rdx
je 0x2060a
movq %rsi, %rdx
movq %rdi, %r14
movq (%rdi), %rdi
movq 0x8(%r14), %rsi
leaq (%rdx,%rbx), %rcx
callq *0x18(%rdi)
testl %eax, %eax
je 0x20612
addq %rbx, 0x8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x10
popq %rdi
callq 0x41c0
movq %rax, %rbx
leaq 0x324c1(%rip), %rsi     # 0x52ae5
movq %rax, %rdi
callq 0x4120
movq 0x549b5(%rip), %rsi     # 0x74fe8
movq 0x5497e(%rip), %rdx     # 0x74fb8
movq %rbx, %rdi
callq 0x45b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x4290
movq %r14, %rdi
callq 0x4600
nop
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TDiffStream::packUInt(unsigned long long)
size_t TDiffStream::packUInt(hpatch_StreamPos_t uValue){
    unsigned char  codeBuf[hpatch_kMaxPackedUIntBytes];
    unsigned char* codeEnd=codeBuf;
    check(hpatch_packUInt(&codeEnd,codeBuf+hpatch_kMaxPackedUIntBytes,uValue));
    pushBack(codeBuf,(size_t)(codeEnd-codeBuf));
    return codeEnd-codeBuf;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rdx
movq %rdi, %r14
leaq 0xd(%rsp), %rbx
movq %rsp, %rdi
movq %rbx, (%rdi)
leaq 0x18(%rsp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3a508
testl %eax, %eax
je 0x206a2
movq (%rsp), %rdx
subq %rbx, %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x205e2
movq (%rsp), %rax
subq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
pushq $0x10
popq %rdi
callq 0x41c0
movq %rax, %rbx
leaq 0x3245d(%rip), %rsi     # 0x52b11
movq %rax, %rdi
callq 0x4120
movq 0x54925(%rip), %rsi     # 0x74fe8
movq 0x548ee(%rip), %rdx     # 0x74fb8
movq %rbx, %rdi
callq 0x45b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x4290
movq %r14, %rdi
callq 0x4600
nop
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TDiffStream::_packUInt_limit(unsigned long long, unsigned long)
void TDiffStream::_packUInt_limit(hpatch_StreamPos_t uValue,size_t limitOutSize){
    check(limitOutSize<=hpatch_kMaxPackedUIntBytes);
    unsigned char  _codeBuf[hpatch_kMaxPackedUIntBytes];
    packUInt_fixSize(_codeBuf,_codeBuf+limitOutSize,uValue);
    pushBack(_codeBuf,limitOutSize);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
cmpq $0xc, %rdx
jae 0x20740
testq %rdx, %rdx
je 0x2075c
leaq (%rsp,%rdx), %rax
addq $0xc, %rax
movl %esi, %ecx
andb $0x7f, %cl
movb %cl, (%rax)
leaq 0xd(%rsp), %rcx
cmpq %rcx, %rax
jbe 0x20725
shrq $0x7, %rsi
movl %esi, %r8d
orb $-0x80, %r8b
movb %r8b, -0x1(%rax)
decq %rax
jmp 0x2070c
cmpq $0x80, %rsi
jae 0x20778
leaq 0xd(%rsp), %rsi
callq 0x205e2
addq $0x18, %rsp
popq %rbx
popq %r14
retq
pushq $0x10
popq %rdi
callq 0x41c0
movq %rax, %rbx
leaq 0x32410(%rip), %rsi     # 0x52b62
movq %rax, %rdi
callq 0x4120
jmp 0x20792
pushq $0x10
popq %rdi
callq 0x41c0
movq %rax, %rbx
leaq 0x32a97(%rip), %rsi     # 0x53205
movq %rax, %rdi
callq 0x4120
jmp 0x20792
pushq $0x10
popq %rdi
callq 0x41c0
movq %rax, %rbx
leaq 0x32aa3(%rip), %rsi     # 0x5322d
movq %rax, %rdi
callq 0x4120
movq 0x5484f(%rip), %rsi     # 0x74fe8
movq 0x54818(%rip), %rdx     # 0x74fb8
movq %rbx, %rdi
callq 0x45b0
jmp 0x207ac
jmp 0x207ac
movq %rax, %r14
movq %rbx, %rdi
callq 0x4290
movq %r14, %rdi
callq 0x4600
nop
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TDiffStream::packUInt_update(hdiff_private::TPlaceholder const&, unsigned long long)
void TDiffStream::packUInt_update(const TPlaceholder& pos,hpatch_StreamPos_t uValue){
    hpatch_StreamPos_t writePosBack=writePos;
    writePos=pos.pos;
    _packUInt_limit(uValue,(size_t)(pos.pos_end-pos.pos));
    assert(writePos==pos.pos_end);
    writePos=writePosBack;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %r15
movq (%rsi), %rcx
movq %rcx, 0x8(%rdi)
movq 0x8(%rsi), %rax
subq %rcx, %rax
movq %rdx, %rsi
movq %rax, %rdx
callq 0x206e6
movq 0x8(%rbx), %rax
cmpq 0x8(%r14), %rax
jne 0x207fc
movq %r15, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x32395(%rip), %rdi     # 0x52b98
leaq 0x31b87(%rip), %rsi     # 0x52391
leaq 0x3239d(%rip), %rcx     # 0x52bae
movl $0x2e3, %edx            # imm = 0x2E3
callq 0x4230
nop
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TDiffStream::stream_read(hdiff_private::TPlaceholder const&, unsigned char*)
void TDiffStream::stream_read(const TPlaceholder& pos,hpatch_byte* out_data){
    assert(pos.pos<=pos.pos_end);
    assert(pos.size()==(size_t)pos.size());
    check(pos.pos_end<=writePos);
    checki(out_diff->read_writed!=0,"TDiffStream::stream_read() out_diff can't read error!");
    checki(out_diff->read_writed(out_diff,pos.pos,out_data,out_data+(size_t)pos.size()),
            "TDiffStream::stream_read() out_diff read error!");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rax
movq (%rsi), %rsi
movq 0x8(%rax), %rax
movq %rax, %rcx
subq %rsi, %rcx
jb 0x20855
cmpq 0x8(%rdi), %rax
ja 0x20874
movq (%rdi), %rdi
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x20890
addq %rdx, %rcx
callq *%rax
testl %eax, %eax
je 0x208ac
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x323ad(%rip), %rdi     # 0x52c09
leaq 0x31b2e(%rip), %rsi     # 0x52391
leaq 0x323b4(%rip), %rcx     # 0x52c1e
movl $0x2e8, %edx            # imm = 0x2E8
callq 0x4230
pushq $0x10
popq %rdi
callq 0x41c0
movq %rax, %rbx
leaq 0x323ea(%rip), %rsi     # 0x52c70
movq %rax, %rdi
callq 0x4120
jmp 0x208c6
pushq $0x10
popq %rdi
callq 0x41c0
movq %rax, %rbx
leaq 0x323f1(%rip), %rsi     # 0x52c93
movq %rax, %rdi
callq 0x4120
jmp 0x208c6
pushq $0x10
popq %rdi
callq 0x41c0
movq %rax, %rbx
leaq 0x3240b(%rip), %rsi     # 0x52cc9
movq %rax, %rdi
callq 0x4120
movq 0x5471b(%rip), %rsi     # 0x74fe8
movq 0x546e4(%rip), %rdx     # 0x74fb8
movq %rbx, %rdi
callq 0x45b0
jmp 0x208e0
jmp 0x208e0
movq %rax, %r14
movq %rbx, %rdi
callq 0x4290
movq %r14, %rdi
callq 0x4600
nop
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TDiffStream::stream_update(hdiff_private::TPlaceholder const&, unsigned char const*)
void TDiffStream::stream_update(const TPlaceholder& pos,const hpatch_byte* in_data){
    assert(pos.pos<=pos.pos_end);
    assert(pos.size()==(size_t)pos.size());
    check(pos.pos_end<=writePos);

    hpatch_StreamPos_t writePosBack=writePos;
    writePos=pos.pos;
    pushBack(in_data,(size_t)pos.size());
    assert(writePos==pos.pos_end);
    writePos=writePosBack;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq (%rsi), %rcx
movq 0x8(%rsi), %rsi
movq %rsi, %rax
subq %rcx, %rax
jb 0x2093d
movq %rdi, %rbx
movq 0x8(%rdi), %r15
cmpq %r15, %rsi
ja 0x2095c
movq %rcx, 0x8(%rbx)
movq %rbx, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x205e2
movq 0x8(%rbx), %rax
cmpq 0x8(%r14), %rax
jne 0x2098c
movq %r15, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x322c5(%rip), %rdi     # 0x52c09
leaq 0x31a46(%rip), %rsi     # 0x52391
leaq 0x323a7(%rip), %rcx     # 0x52cf9
movl $0x2f0, %edx            # imm = 0x2F0
callq 0x4230
pushq $0x10
popq %rdi
callq 0x41c0
movq %rax, %rbx
leaq 0x32302(%rip), %rsi     # 0x52c70
movq %rax, %rdi
callq 0x4120
movq 0x5466b(%rip), %rsi     # 0x74fe8
movq 0x54634(%rip), %rdx     # 0x74fb8
movq %rbx, %rdi
callq 0x45b0
leaq 0x32205(%rip), %rdi     # 0x52b98
leaq 0x319f7(%rip), %rsi     # 0x52391
leaq 0x32358(%rip), %rcx     # 0x52cf9
movl $0x2f7, %edx            # imm = 0x2F7
callq 0x4230
movq %rax, %r14
movq %rbx, %rdi
callq 0x4290
movq %r14, %rdi
callq 0x4600
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TDiffStream::_pushStream(hpatch_TStreamInput const*)
void TDiffStream::_pushStream(const hpatch_TStreamInput* stream){
    unsigned char* buf=_temp_mem.data();
    hpatch_StreamPos_t sumReadedLen=0;
    while (sumReadedLen<stream->streamSize) {
        size_t readLen=kBufSize;
        if (readLen+sumReadedLen>stream->streamSize)
            readLen=(size_t)(stream->streamSize-sumReadedLen);
        checki(stream->read(stream,sumReadedLen,buf,buf+readLen),
               "TDiffStream::_pushStream() stream->read() error!");
        this->pushBack(buf,readLen);
        sumReadedLen+=readLen;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %r15
xorl %r12d, %r12d
movl $0x80000, %ebp          # imm = 0x80000
movq 0x8(%rbx), %rax
movq %rax, %r13
subq %r12, %r13
jbe 0x20a19
leaq (%r12,%rbp), %rcx
cmpq %rax, %rcx
cmovbeq %rbp, %r13
leaq (%r15,%r13), %rcx
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq *0x10(%rbx)
testl %eax, %eax
je 0x20a28
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x205e2
addq %r13, %r12
jmp 0x209db
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x41c0
movq %rax, %rbx
leaq 0x32319(%rip), %rsi     # 0x52d53
movq %rax, %rdi
callq 0x4120
movq 0x5459f(%rip), %rsi     # 0x74fe8
movq 0x54568(%rip), %rdx     # 0x74fb8
movq %rbx, %rdi
callq 0x45b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x4290
movq %r14, %rdi
callq 0x4600
nop
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TStreamClip::_clip_read(hpatch_TStreamInput const*, unsigned long long, unsigned char*, unsigned char*)
hpatch_BOOL TStreamClip::_clip_read(const hpatch_TStreamInput* stream,hpatch_StreamPos_t readFromPos,
                                    unsigned char* out_data,unsigned char* out_data_end){
    TStreamClip* self=(TStreamClip*)stream->streamImport;
    assert(out_data<out_data_end);
    if (readFromPos!=self->_read_uncompress_pos){
        if (self->_decompressPlugin){
            check(readFromPos==0); //not support random read compressed cdata
            //reset
            self->closeDecompressHandle();
            self->openDecompressHandle();
            self->_read_uncompress_pos=0;
        }else{
            self->_read_uncompress_pos=readFromPos;
        }
    }
    size_t readLen=out_data_end-out_data;
    assert(readFromPos+readLen <= self->streamSize);
    self->_read_uncompress_pos+=readLen;
    
    if (self->_decompressPlugin){
        return self->_decompressPlugin->decompress_part(self->_decompressHandle,out_data,out_data_end);
    }else{
        return self->_src->read(self->_src,self->_src_begin+readFromPos,out_data,out_data_end);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpq %rcx, %rdx
jae 0x20cca
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq (%rdi), %r12
cmpq %rsi, 0x48(%r12)
je 0x20c6b
cmpq $0x0, 0x38(%r12)
movq %r15, %rax
je 0x20c66
testq %r15, %r15
jne 0x20d08
movq %r12, %rdi
callq 0x20e08
movq %r12, %rdi
callq 0x20d4c
xorl %eax, %eax
movq %rax, 0x48(%r12)
movq %rbx, %rax
subq %r14, %rax
addq %r15, %rax
cmpq 0x8(%r12), %rax
ja 0x20ce9
movq %rax, 0x48(%r12)
movq 0x38(%r12), %rax
testq %rax, %rax
je 0x20ca6
movq 0x18(%rax), %rax
movq 0x40(%r12), %rdi
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmpq *%rax
movq 0x20(%r12), %rdi
movq 0x10(%rdi), %rax
addq 0x28(%r12), %r15
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmpq *%rax
leaq 0x322bb(%rip), %rdi     # 0x52f8c
leaq 0x316b9(%rip), %rsi     # 0x52391
leaq 0x322c3(%rip), %rcx     # 0x52fa2
movl $0x34c, %edx            # imm = 0x34C
callq 0x4230
leaq 0x3233f(%rip), %rdi     # 0x5302f
leaq 0x3169a(%rip), %rsi     # 0x52391
leaq 0x322a4(%rip), %rcx     # 0x52fa2
movl $0x359, %edx            # imm = 0x359
callq 0x4230
pushq $0x10
popq %rdi
callq 0x41c0
movq %rax, %rbx
leaq 0x31c44(%rip), %rsi     # 0x5295e
movq %rax, %rdi
callq 0x4120
movq 0x542bf(%rip), %rsi     # 0x74fe8
movq 0x54288(%rip), %rdx     # 0x74fb8
movq %rbx, %rdi
callq 0x45b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x4290
movq %r14, %rdi
callq 0x4600
nop
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TStreamClip::openDecompressHandle()
void TStreamClip::openDecompressHandle(){
    assert(_decompressHandle==0);
    assert(_decompressPlugin!=0);
    _decompressHandle=_decompressPlugin->open(_decompressPlugin,this->streamSize,_src,_src_begin,_src_end);
    check(_decompressHandle!=0);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpq $0x0, 0x40(%rdi)
jne 0x20d87
movq %rdi, %rbx
movq 0x38(%rdi), %rdi
testq %rdi, %rdi
je 0x20da6
movq 0x8(%rbx), %rsi
movq 0x20(%rbx), %rdx
movq 0x28(%rbx), %rcx
movq 0x30(%rbx), %r8
callq *0x8(%rdi)
movq %rax, 0x40(%rbx)
testq %rax, %rax
je 0x20dc5
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x35be6(%rip), %rdi     # 0x56974
leaq 0x315fc(%rip), %rsi     # 0x52391
leaq 0x32181(%rip), %rcx     # 0x52f1d
movl $0x343, %edx            # imm = 0x343
callq 0x4230
leaq 0x321a8(%rip), %rdi     # 0x52f55
leaq 0x315dd(%rip), %rsi     # 0x52391
leaq 0x32162(%rip), %rcx     # 0x52f1d
movl $0x344, %edx            # imm = 0x344
callq 0x4230
pushq $0x10
popq %rdi
callq 0x41c0
movq %rax, %rbx
leaq 0x32193(%rip), %rsi     # 0x52f6a
movq %rax, %rdi
callq 0x4120
movq 0x54202(%rip), %rsi     # 0x74fe8
movq 0x541cb(%rip), %rdx     # 0x74fb8
movq %rbx, %rdi
callq 0x45b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x4290
movq %r14, %rdi
callq 0x4600
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TStreamClip::closeDecompressHandle()
void TStreamClip::closeDecompressHandle(){
    hpatch_decompressHandle handle=_decompressHandle;
    _decompressHandle=0;
    if (handle)
        check(_decompressPlugin->close(_decompressPlugin,handle));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x40(%rdi), %rsi
andq $0x0, 0x40(%rdi)
testq %rsi, %rsi
je 0x20e25
movq 0x38(%rdi), %rdi
callq *0x10(%rdi)
testl %eax, %eax
je 0x20e2d
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x10
popq %rdi
callq 0x41c0
movq %rax, %rbx
leaq 0x3209e(%rip), %rsi     # 0x52edd
movq %rax, %rdi
callq 0x4120
movq 0x5419a(%rip), %rsi     # 0x74fe8
movq 0x54163(%rip), %rdx     # 0x74fb8
movq %rbx, %rdi
callq 0x45b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x4290
movq %r14, %rdi
callq 0x4600
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::_TCheckOutNewDataStream::_TCheckOutNewDataStream(hpatch_TStreamInput const*, unsigned char*, unsigned long)
_TCheckOutNewDataStream::_TCheckOutNewDataStream(const hpatch_TStreamInput*  _newData,
                                                 unsigned char* _buf,size_t _bufSize)
:newData(_newData),writedLen(0),buf(_buf),bufSize(_bufSize){
    streamImport=this;
    streamSize=newData->streamSize;
    read_writed=_read_writed;
    write=_write_check;
}

// Assembly:
movq %rsi, 0x20(%rdi)
andq $0x0, 0x28(%rdi)
movq %rdx, 0x30(%rdi)
movq %rcx, 0x38(%rdi)
movq %rdi, (%rdi)
movq 0x8(%rsi), %rax
movq %rax, 0x8(%rdi)
leaq 0x11(%rip), %rax        # 0x20ea4
movq %rax, 0x10(%rdi)
leaq 0x60(%rip), %rax        # 0x20efe
movq %rax, 0x18(%rdi)
retq
nop