LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: 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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, 0x20(%rdi)
addq $0x28, %rdi
movq %rdi, -0x30(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x29c00
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rdi
movq $0x0, 0x40(%rax)
movq $0x0, 0x48(%rax)
movq $0x0, 0x50(%rax)
movq $0x0, 0x58(%rax)
movq $0x0, 0x60(%rax)
movq $0x0, 0x68(%rax)
movl $0x80000, %esi          # imm = 0x80000
callq 0x301a0
jmp 0x4c6d9
movq -0x38(%rbp), %rax
movq %rax, (%rax)
movq -0x18(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x31(%rip), %rcx        # 0x4c720
movq %rcx, 0x10(%rax)
addq $0x40, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x29ca0
movq -0x20(%rbp), %rdi
callq 0x4680
nopw (%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2af30
movq %rax, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x4cbb1
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x2af50
movq -0x40(%rbp), %rax
cmpq -0x28(%rbp), %rax
jb 0x4cb04
jmp 0x4cb23
leaq 0x63f77(%rip), %rdi     # 0xb0a82
leaq 0x63e29(%rip), %rsi     # 0xb093b
movl $0xa6, %edx
leaq 0x63f7d(%rip), %rcx     # 0xb0a9b
callq 0x4270
movq -0x48(%rbp), %rax
cmpq -0x20(%rbp), %rax
jb 0x4cb4a
movq -0x48(%rbp), %rdx
subq -0x20(%rbp), %rdx
leaq -0x18(%rbp), %rdi
xorl %ecx, %ecx
movl $0x1, %r8d
movl %ecx, %esi
callq 0x4cbc0
jmp 0x4cb66
movq -0x20(%rbp), %rdx
subq -0x48(%rbp), %rdx
leaq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %r8d
movl %r8d, %ecx
callq 0x4cbc0
movq -0x40(%rbp), %rdx
subq -0x28(%rbp), %rdx
leaq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x4cc00
movq -0x38(%rbp), %rdx
leaq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x4cc00
movq -0x48(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x40(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x4cad9
movq -0x18(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TNewDataDiffStream::_init(unsigned long long)
void TNewDataDiffStream::_init(hpatch_StreamPos_t newDataDiff_size){
    curNewPos=0;
    curNewPos_end=0;
    lastNewEnd=0;
    readedCoverCount=0;
    _readFromPos_back=0;
    _coveri=0;
    _newDataPos=0;
    this->streamImport=this;
    this->streamSize=newDataDiff_size;
    this->read=_read;
    this->_private_reserved=0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, 0x30(%rax)
movq $0x0, 0x38(%rax)
movq $0x0, 0x40(%rax)
movq $0x0, 0x48(%rax)
movq $0x0, 0x50(%rax)
movq $0x0, 0x58(%rax)
movq $0x0, 0x60(%rax)
movq %rax, (%rax)
movq -0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x16(%rip), %rcx        # 0x4ccb0
movq %rcx, 0x10(%rax)
movq $0x0, 0x18(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x4cfc0
movq -0x28(%rbp), %rdi
movq %rax, %rsi
callq 0x4cc40
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, 0x58(%rax)
movq -0x18(%rbp), %rcx
movq %rcx, 0x60(%rax)
movq 0x58(%rax), %rcx
movq %rcx, 0x48(%rax)
movq 0x60(%rax), %rcx
movq %rcx, 0x40(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2af30
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x4d0c4
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x2af50
movq -0x58(%rbp), %rax
cmpq -0x40(%rbp), %rax
jb 0x4d028
jmp 0x4d047
leaq 0x63a53(%rip), %rdi     # 0xb0a82
leaq 0x63905(%rip), %rsi     # 0xb093b
movl $0xf9, %edx
leaq 0x63b8d(%rip), %rcx     # 0xb0bcf
callq 0x4270
movq -0x58(%rbp), %rax
subq -0x40(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x40(%rbp), %rax
addq -0x68(%rbp), %rax
cmpq -0x28(%rbp), %rax
jb 0x4d06d
movq -0x28(%rbp), %rax
subq -0x40(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rax
addq -0x68(%rbp), %rax
cmpq -0x28(%rbp), %rax
jne 0x4d091
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x4d10f
movq -0x58(%rbp), %rax
addq -0x50(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x28(%rbp), %rax
jb 0x4d0b1
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x4d10f
jmp 0x4d0b3
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x4cffd
movq -0x28(%rbp), %rax
cmpq -0x40(%rbp), %rax
jb 0x4d0d0
jmp 0x4d0ef
leaq 0x63b89(%rip), %rdi     # 0xb0c60
leaq 0x6385d(%rip), %rsi     # 0xb093b
movl $0x105, %edx            # imm = 0x105
leaq 0x63ae5(%rip), %rcx     # 0xb0bcf
callq 0x4270
movq -0x28(%rbp), %rax
subq -0x40(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2af30
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x4d1c5
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x2af50
movq -0x40(%rbp), %rax
cmpq -0x28(%rbp), %rax
jb 0x4d17c
jmp 0x4d19b
leaq 0x638ff(%rip), %rdi     # 0xb0a82
leaq 0x637b1(%rip), %rsi     # 0xb093b
movl $0x112, %edx            # imm = 0x112
leaq 0x63ae4(%rip), %rcx     # 0xb0c7a
callq 0x4270
movq -0x40(%rbp), %rax
subq -0x28(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x40(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x4d155
movq -0x10(%rbp), %rax
cmpq -0x28(%rbp), %rax
jb 0x4d1d1
jmp 0x4d1f0
leaq 0x63b10(%rip), %rdi     # 0xb0ce8
leaq 0x6375c(%rip), %rsi     # 0xb093b
movl $0x116, %edx            # imm = 0x116
leaq 0x63a8f(%rip), %rcx     # 0xb0c7a
callq 0x4270
movq -0x10(%rbp), %rax
subq -0x28(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movl %r8d, -0x84(%rbp)
movq %rcx, %rax
movl -0x84(%rbp), %ecx
movq %rax, -0x80(%rbp)
movq %rdx, %rax
movq -0x80(%rbp), %rdx
movq %rax, -0x78(%rbp)
movq %rsi, %rax
movq -0x78(%rbp), %rsi
movq %rax, -0x70(%rbp)
movq %rdi, %r8
movq -0x70(%rbp), %rdi
movb %r9b, %al
movq %r8, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
andb $0x1, %cl
movb %cl, -0x21(%rbp)
andb $0x1, %al
movb %al, -0x22(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq %rax, 0x48(%rdi)
movq -0x18(%rbp), %rax
movq %rax, 0x50(%rdi)
movq -0x20(%rbp), %rax
movq %rax, 0x58(%rdi)
movb -0x21(%rbp), %al
andb $0x1, %al
movb %al, 0x60(%rdi)
movb -0x22(%rbp), %al
andb $0x1, %al
movb %al, 0x61(%rdi)
addq $0x68, %rdi
movq %rdi, -0x68(%rbp)
movl $0x80000, %esi          # imm = 0x80000
callq 0x29c00
movq -0x60(%rbp), %rdi
callq 0x4d390
jmp 0x4d2b7
movq -0x60(%rbp), %rax
movq %rax, (%rax)
testb $0x1, 0x60(%rax)
je 0x4d35e
movq -0x60(%rbp), %rax
movq $0x0, 0x8(%rax)
movq $0x0, -0x40(%rbp)
movq -0x60(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, -0x98(%rbp)
movq 0x58(%rax), %rdi
callq 0x2af30
movq %rax, -0x90(%rbp)
jmp 0x4d2fd
movq -0x98(%rbp), %rax
movq -0x90(%rbp), %rcx
cmpq %rcx, %rax
jae 0x4d35c
movq -0x60(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x40(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0x2af50
jmp 0x4d327
movq -0x60(%rbp), %rax
movq -0x48(%rbp), %rcx
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x4d2dc
movq -0x68(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x29ca0
jmp 0x4d386
jmp 0x4d36e
movq -0x60(%rbp), %rax
movq 0x48(%rax), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x60(%rbp), %rax
leaq 0x57(%rip), %rcx        # 0x4d3d0
movq %rcx, 0x10(%rax)
addq $0xa0, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x4680
nop
// File: sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TNewDataSubDiffStream::initRead()
void TNewDataSubDiffStream::initRead(){
    curReadNewPos=0;
    curReadOldPos=_kNullPos;
    curReadPos=0;
    nextCoveri=0;
    curDataLen=0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, 0x20(%rax)
movq $-0x1, 0x28(%rax)
movq $0x0, 0x30(%rax)
movq $0x0, 0x40(%rax)
movq $0x0, 0x38(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x4d403
movq -0x30(%rbp), %rdi
callq 0x4d390
movq -0x18(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpq 0x30(%rcx), %rax
je 0x4d41a
movl $0x0, -0x4(%rbp)
jmp 0x4d47c
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
subq %rax, %rcx
movq -0x30(%rbp), %rax
addq 0x30(%rax), %rcx
movq %rcx, 0x30(%rax)
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x30(%rbp), %rcx
cmpq 0x8(%rcx), %rax
ja 0x4d445
jmp 0x4d464
leaq 0x63974(%rip), %rdi     # 0xb0dc0
leaq 0x634e8(%rip), %rsi     # 0xb093b
movl $0x178, %edx            # imm = 0x178
leaq 0x63984(%rip), %rcx     # 0xb0de3
callq 0x4270
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x4d490
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::_subData(unsigned char*, unsigned long, hpatch_TStreamInput const*, unsigned long long, unsigned char*, unsigned long)
static void _subData(unsigned char* out_data,size_t len,
                         const hdiff_TStreamInput*oldData,hpatch_StreamPos_t oldPos,
                         unsigned char* cache,size_t cacheSize){
        while (len){
            size_t rlen=len;
            if (rlen>cacheSize) rlen=cacheSize;
            check(oldData->read(oldData,oldPos,cache,cache+rlen));
            _subData(out_data,cache,rlen);
            oldPos+=rlen;
            out_data+=rlen;
            len-=rlen;
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x4d875
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jbe 0x4d7c5
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x28(%rbp), %rcx
addq -0x38(%rbp), %rcx
callq *%rax
cmpl $0x0, %eax
jne 0x4d838
movl $0x10, %edi
callq 0x41e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x50(%rbp)
leaq 0x63f8f(%rip), %rsi     # 0xb1792
callq 0x4140
jmp 0x4d80a
movq -0x50(%rbp), %rdi
movq 0x987db(%rip), %rsi     # 0xe5ff0
movq 0x987a4(%rip), %rdx     # 0xe5fc0
callq 0x4630
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0x42e0
jmp 0x4d87b
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x50730
movq -0x38(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x38(%rbp), %rax
addq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x10(%rbp)
jmp 0x4d7a0
addq $0x50, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x4680
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movb %cl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x48(%rbp)
movb -0x19(%rbp), %al
andb $0x1, %al
movb %al, 0x20(%rdi)
movq -0x10(%rbp), %rax
movq %rax, 0x38(%rdi)
movq -0x18(%rbp), %rax
movq %rax, 0x40(%rdi)
movq %rdi, %rax
addq $0x48, %rax
movq %rax, -0x38(%rbp)
movq $0x0, 0x60(%rdi)
movq $0x0, 0x68(%rdi)
addq $0x70, %rdi
movq %rdi, -0x40(%rbp)
movb -0x19(%rbp), %al
notb %al
movzbl %al, %eax
andl $0x1, %eax
shll $0x14, %eax
movl %eax, %esi
callq 0x29c00
movq -0x38(%rbp), %rdi
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rsi
movq %rcx, %rdx
callq 0x4da70
jmp 0x4d9d8
movq -0x48(%rbp), %rax
movq %rax, (%rax)
leaq 0xca(%rip), %rcx        # 0x4dab0
movq %rcx, 0x10(%rax)
testb $0x1, 0x20(%rax)
jne 0x4da4a
movq -0x48(%rbp), %rdi
addq $0x70, %rdi
callq 0x29c40
movq %rax, -0x50(%rbp)
jmp 0x4da03
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rax
movq %rax, 0x60(%rdi)
addq $0x70, %rdi
callq 0x29c40
movq %rax, -0x58(%rbp)
jmp 0x4da1e
movq -0x48(%rbp), %rax
movq -0x58(%rbp), %rcx
addq $0x80000, %rcx          # imm = 0x80000
movq %rcx, 0x68(%rax)
jmp 0x4da4a
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x29ca0
jmp 0x4da5b
movq -0x48(%rbp), %rdi
callq 0x4db20
jmp 0x4da55
addq $0x60, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x4680
nopw %cs:(%rax,%rax)
// File: sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp
// Function: hdiff_private::TNewDataSubDiffCoverStream::_read(hpatch_TStreamInput const*, unsigned long long, unsigned char*, unsigned char*)
hpatch_BOOL TNewDataSubDiffCoverStream::_read(const hpatch_TStreamInput* stream,hpatch_StreamPos_t readFromPos,
                                              unsigned char* out_data,unsigned char* out_data_end){
    TNewDataSubDiffCoverStream* self=(TNewDataSubDiffCoverStream*)stream->streamImport;
    if (self->isZeroSubDiff){
        memset(out_data,0,out_data_end-out_data);
        return hpatch_TRUE;
    }
    return self->readTo(readFromPos,out_data,out_data_end);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
testb $0x1, 0x20(%rax)
je 0x4dafc
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rdx
movq -0x20(%rbp), %rax
subq %rax, %rdx
xorl %esi, %esi
callq 0x4210
movl $0x1, -0x4(%rbp)
jmp 0x4db14
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x4dc30
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdx
movq %rdx, -0x20(%rbp)
movq 0x58(%rdx), %rax
movq 0x30(%rdx), %rcx
addq 0x28(%rdx), %rcx
subq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x18(%rbp), %rax
ja 0x4dbd8
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, 0x58(%rdi)
callq 0x4db20
jmp 0x4dc24
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
addq 0x30(%rdx), %rcx
cmpq %rcx, %rax
jae 0x4dbfd
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
subq -0x18(%rbp), %rcx
movq %rcx, 0x30(%rax)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rdx
addq 0x30(%rax), %rdx
subq %rdx, %rcx
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rcx
movq %rcx, 0x58(%rax)
movq -0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpq 0x58(%rcx), %rax
jae 0x4ddb4
jmp 0x4ddd3
leaq 0x630c1(%rip), %rdi     # 0xb0e7c
leaq 0x62b79(%rip), %rsi     # 0xb093b
movl $0x1ce, %edx            # imm = 0x1CE
leaq 0x630c7(%rip), %rcx     # 0xb0e95
callq 0x4270
movq -0x20(%rbp), %rcx
movq $0x80000, 0x30(%rcx)    # imm = 0x80000
movq 0x30(%rcx), %rax
addq -0x18(%rbp), %rax
cmpq 0x58(%rcx), %rax
jbe 0x4ddfd
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rcx
subq -0x18(%rbp), %rcx
movq %rcx, 0x30(%rax)
movq -0x20(%rbp), %r8
movq 0x58(%r8), %rax
movq 0x30(%r8), %rcx
addq -0x18(%rbp), %rcx
subq %rcx, %rax
movq %rax, 0x28(%r8)
movq 0x38(%r8), %rax
movq 0x10(%rax), %rax
movq 0x38(%r8), %rdi
movq 0x50(%r8), %rsi
addq -0x18(%rbp), %rsi
movq 0x60(%r8), %rdx
movq 0x60(%r8), %rcx
addq 0x30(%r8), %rcx
callq *%rax
cmpl $0x0, %eax
jne 0x4de44
movl $0x0, -0x4(%rbp)
jmp 0x4de7f
movq -0x20(%rbp), %r8
movq 0x40(%r8), %rax
movq 0x10(%rax), %rax
movq 0x40(%r8), %rdi
movq 0x48(%r8), %rsi
addq -0x18(%rbp), %rsi
movq 0x68(%r8), %rdx
movq 0x68(%r8), %rcx
addq 0x30(%r8), %rcx
callq *%rax
cmpl $0x0, %eax
jne 0x4de78
movl $0x0, -0x4(%rbp)
jmp 0x4de7f
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movb %cl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x48(%rbp)
addq $0x20, %rdi
movq %rdi, -0x50(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movzbl -0x19(%rbp), %ecx
andl $0x1, %ecx
callq 0x4d950
movq -0x48(%rbp), %rdi
addq $0xa8, %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x2b030
jmp 0x4def1
movq -0x48(%rbp), %rdi
movq -0x28(%rbp), %rax
movq %rax, 0x110(%rdi)
movq -0x30(%rbp), %rax
movq %rax, 0x118(%rdi)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x120(%rdi)
addq $0x158, %rdi            # imm = 0x158
movq %rdi, -0x60(%rbp)
callq 0xbe70
movq -0x48(%rbp), %rdi
addq $0x170, %rdi            # imm = 0x170
movq %rdi, -0x58(%rbp)
callq 0x508b0
jmp 0x4df40
movq -0x48(%rbp), %rdi
addq $0x248, %rdi            # imm = 0x248
movq %rdi, -0x70(%rbp)
callq 0xbe70
movq -0x48(%rbp), %rdi
addq $0x260, %rdi            # imm = 0x260
movq %rdi, -0x68(%rbp)
callq 0x508f0
jmp 0x4df6a
movq -0x48(%rbp), %rdi
movq $0x0, 0x2b0(%rdi)
movq $0x0, 0x2b8(%rdi)
callq 0x4e020
jmp 0x4df8b
movq -0x48(%rbp), %rax
movq %rax, (%rax)
leaq 0xf7(%rip), %rcx        # 0x4e090
movq %rcx, 0x10(%rax)
movq 0x238(%rax), %rcx
movq %rcx, 0x8(%rax)
addq $0x70, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4e008
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4dfff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4dfed
movq -0x68(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x29e80
movq -0x70(%rbp), %rdi
callq 0xbb80
movq -0x58(%rbp), %rdi
callq 0x2b480
movq -0x60(%rbp), %rdi
callq 0xbb80
movq -0x50(%rbp), %rdi
callq 0x2b4b0
movq -0x38(%rbp), %rdi
callq 0x4680
nopw (%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x10(%rbp)
movb $0x1, 0x230(%rdi)
movq $0x0, 0x238(%rdi)
callq 0x4e170
movq -0x10(%rbp), %rdi
callq 0x4e320
testb $0x1, %al
jne 0x4e05a
jmp 0x4e05c
jmp 0x4e04b
movq -0x10(%rbp), %rdi
movb $0x0, 0x230(%rdi)
movq 0x128(%rdi), %rax
movq %rax, 0x130(%rdi)
movq 0x138(%rdi), %rax
movq %rax, 0x140(%rdi)
callq 0x4e170
addq $0x10, %rsp
popq %rbp
retq
nop
// File: 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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x2b0(%rcx), %rax
je 0x4e124
cmpq $0x0, -0x10(%rbp)
je 0x4e11b
movl $0x10, %edi
callq 0x41e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
leaq 0x62e22(%rip), %rsi     # 0xb0f08
callq 0x4140
jmp 0x4e0ed
movq -0x40(%rbp), %rdi
movq 0x97ef8(%rip), %rsi     # 0xe5ff0
movq 0x97ec1(%rip), %rdx     # 0xe5fc0
callq 0x4630
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x42e0
jmp 0x4e158
movq -0x28(%rbp), %rdi
callq 0x4e170
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rdx
subq %rdx, %rax
addq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x2b0(%rax)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x4eab0
addq $0x40, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x4680
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq 0x110(%rax), %rdi
callq 0x2af30
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x128(%rax)
movb $0x0, 0x1b9(%rax)
movb $0x0, 0x1ba(%rax)
movb $0x0, 0x1b8(%rax)
cmpq $0x0, 0x128(%rax)
jne 0x4e1e7
movq -0x28(%rbp), %rax
movb $0x1, 0x1b8(%rax)
movq %rax, %rdi
addq $0x1c0, %rdi            # imm = 0x1C0
movq 0x120(%rax), %rdx
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rsi
callq 0x4da70
jmp 0x4e24a
movq -0x28(%rbp), %rax
movq 0x110(%rax), %rdi
movq 0x128(%rax), %rsi
subq $0x1, %rsi
leaq -0x20(%rbp), %rdx
callq 0x2af50
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
addq -0x10(%rbp), %rax
cmpq 0x120(%rcx), %rax
jae 0x4e248
movq -0x28(%rbp), %rax
movb $0x1, 0x1b8(%rax)
movq %rax, %rdi
addq $0x1c0, %rdi            # imm = 0x1C0
movq -0x20(%rbp), %rsi
addq -0x10(%rbp), %rsi
movq 0x120(%rax), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x4da70
jmp 0x4e24a
movq -0x28(%rbp), %rax
testb $0x1, 0x1b8(%rax)
je 0x4e26d
movq -0x28(%rbp), %rax
movq 0x128(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x128(%rax)
movq -0x28(%rbp), %rdi
addq $0x248, %rdi            # imm = 0x248
callq 0xce90
movq -0x28(%rbp), %rdi
addq $0x260, %rdi            # imm = 0x260
callq 0x303b0
movq -0x28(%rbp), %rdi
movq $0x0, 0x2b8(%rdi)
movq $0x0, 0x138(%rdi)
movq $0x0, 0x148(%rdi)
movq $0x0, 0x150(%rdi)
addq $0x158, %rdi            # imm = 0x158
callq 0xce90
movq -0x28(%rbp), %rdi
movq $0x0, 0x240(%rdi)
addq $0x170, %rdi            # imm = 0x170
callq 0x50920
movq -0x28(%rbp), %rax
movq $0x0, 0x1a8(%rax)
movq $0x0, 0x1b0(%rax)
movq $0x0, 0x208(%rax)
movq $0x0, 0x228(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, 0x240(%rax)
jbe 0x4ee1e
movq -0x10(%rbp), %rax
movq %rax, %rdi
addq $0x260, %rdi            # imm = 0x260
movq %rax, %rsi
addq $0xa8, %rsi
movq 0x1b0(%rax), %rdx
subq 0x1a8(%rax), %rdx
movq 0x1b0(%rax), %rcx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
callq 0x4f000
movq -0x10(%rbp), %rdi
movq $0x0, 0x1a8(%rdi)
callq 0x4f110
jmp 0x4ee7e
movq -0x10(%rbp), %rax
cmpq $0x0, 0x268(%rax)
jne 0x4ee2e
jmp 0x4ee4d
leaq 0x62138(%rip), %rdi     # 0xb0f6d
leaq 0x61aff(%rip), %rsi     # 0xb093b
movl $0x2a0, %edx            # imm = 0x2A0
leaq 0x62141(%rip), %rcx     # 0xb0f89
callq 0x4270
movq -0x10(%rbp), %rax
cmpq $0x0, 0x1a8(%rax)
jne 0x4ee5d
jmp 0x4ee7c
leaq 0x62159(%rip), %rdi     # 0xb0fbd
leaq 0x61ad0(%rip), %rsi     # 0xb093b
movl $0x2a1, %edx            # imm = 0x2A1
leaq 0x62112(%rip), %rcx     # 0xb0f89
callq 0x4270
jmp 0x4ee7e
movq -0x10(%rbp), %rcx
movq 0x138(%rcx), %rax
cmpq 0x118(%rcx), %rax
ja 0x4ee94
jmp 0x4eeb3
leaq 0x62137(%rip), %rdi     # 0xb0fd2
leaq 0x61a99(%rip), %rsi     # 0xb093b
movl $0x2a3, %edx            # imm = 0x2A3
leaq 0x620db(%rip), %rcx     # 0xb0f89
callq 0x4270
movq -0x10(%rbp), %rcx
movq 0x1b0(%rcx), %rax
cmpq 0xb0(%rcx), %rax
jne 0x4eec9
jmp 0x4eee8
leaq 0x62126(%rip), %rdi     # 0xb0ff6
leaq 0x61a64(%rip), %rsi     # 0xb093b
movl $0x2a4, %edx            # imm = 0x2A4
leaq 0x620a6(%rip), %rcx     # 0xb0f89
callq 0x4270
addq $0x10, %rsp
popq %rbp
retq
nop
// File: 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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x38(%rbp)
callq 0x303b0
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
ja 0x4f039
jmp 0x4f058
leaq 0x62398(%rip), %rdi     # 0xb13d8
leaq 0x618f4(%rip), %rsi     # 0xb093b
movl $0x32a, %edx            # imm = 0x32A
leaq 0x6239e(%rip), %rcx     # 0xb13f1
callq 0x4270
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
ja 0x4f068
jmp 0x4f087
leaq 0x62418(%rip), %rdi     # 0xb1487
leaq 0x618c5(%rip), %rsi     # 0xb093b
movl $0x32b, %edx            # imm = 0x32B
leaq 0x6236f(%rip), %rcx     # 0xb13f1
callq 0x4270
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rcx
movq %rcx, 0x28(%rax)
movq -0x20(%rbp), %rcx
movq %rcx, 0x30(%rax)
movq -0x28(%rbp), %rcx
movq %rcx, 0x38(%rax)
movq $0x0, 0x40(%rax)
movq $0x0, 0x48(%rax)
cmpq $0x0, -0x30(%rbp)
jne 0x4f0d5
cmpq $0x0, -0x28(%rbp)
jne 0x4f0d5
movq -0x20(%rbp), %rax
subq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rax
movq %rax, (%rax)
movq -0x30(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq 0xf05(%rip), %rcx       # 0x4fff0
movq %rcx, 0x10(%rax)
cmpq $0x0, -0x28(%rbp)
je 0x4f0ff
movq -0x38(%rbp), %rdi
callq 0x501b0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x4f478
jmp 0x4f4fd
movq -0x30(%rbp), %rcx
movq (%rcx), %rax
movq 0x18(%rax), %rax
movq (%rcx), %rdi
movq 0x8(%rcx), %rsi
movq -0x10(%rbp), %rdx
movq -0x10(%rbp), %rcx
addq -0x18(%rbp), %rcx
callq *%rax
cmpl $0x0, %eax
jne 0x4f4ed
movl $0x10, %edi
callq 0x41e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
leaq 0x61bd7(%rip), %rsi     # 0xb108f
callq 0x4140
jmp 0x4f4bf
movq -0x38(%rbp), %rdi
movq 0x96b26(%rip), %rsi     # 0xe5ff0
movq 0x96aef(%rip), %rdx     # 0xe5fc0
callq 0x4630
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x42e0
jmp 0x4f503
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
addq $0x40, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x4680
nopl (%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq -0x1b(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq -0x1b(%rbp), %rsi
addq $0xb, %rsi
movq -0x10(%rbp), %rdx
leaq -0x28(%rbp), %rdi
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x85850
cmpl $0x0, %eax
jne 0x4f5a0
movl $0x10, %edi
callq 0x41e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x48(%rbp)
leaq 0x61b50(%rip), %rsi     # 0xb10bb
callq 0x4140
jmp 0x4f572
movq -0x48(%rbp), %rdi
movq 0x96a73(%rip), %rsi     # 0xe5ff0
movq 0x96a3c(%rip), %rdx     # 0xe5fc0
callq 0x4630
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x42e0
jmp 0x4f5c9
movq -0x40(%rbp), %rdi
leaq -0x1b(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x1b(%rbp), %rax
subq %rax, %rdx
callq 0x4f450
movq -0x28(%rbp), %rax
leaq -0x1b(%rbp), %rcx
subq %rcx, %rax
addq $0x50, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x4680
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0xb, -0x18(%rbp)
jbe 0x4f653
movl $0x10, %edi
callq 0x41e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
leaq 0x61aee(%rip), %rsi     # 0xb110c
callq 0x4140
jmp 0x4f625
movq -0x40(%rbp), %rdi
movq 0x969c0(%rip), %rsi     # 0xe5ff0
movq 0x96989(%rip), %rdx     # 0xe5fc0
callq 0x4630
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x42e0
jmp 0x4f67f
leaq -0x2f(%rbp), %rdi
leaq -0x2f(%rbp), %rsi
addq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x4f690
movq -0x38(%rbp), %rdi
leaq -0x2f(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x4f450
addq $0x40, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x4680
nopl (%rax,%rax)
// File: sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/../pack_uint.h
// Function: hdiff_private::packUInt_fixSize(unsigned char*, unsigned char*, unsigned long long)
hpatch_inline static
void packUInt_fixSize(unsigned char* out_code,unsigned char* out_code_fixEnd,
                      hpatch_StreamPos_t uValue){
    if (out_code>=out_code_fixEnd)
        throw std::runtime_error("packUInt_fixSize() out_code size error!");
    --out_code_fixEnd;
    *out_code_fixEnd=uValue&((1<<7)-1); uValue>>=7;
    while (out_code<out_code_fixEnd) {
        --out_code_fixEnd;
        *out_code_fixEnd=(uValue&((1<<7)-1)) | (1<<7);  uValue>>=7;
    }
    if (uValue!=0)
        throw std::runtime_error("packUInt_fixSize() out_code too small error!");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpq -0x10(%rbp), %rax
jb 0x4f701
movl $0x10, %edi
callq 0x41e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x30(%rbp)
leaq 0x62105(%rip), %rsi     # 0xb17ce
callq 0x4140
jmp 0x4f6d0
movq -0x30(%rbp), %rdi
movq 0x96915(%rip), %rsi     # 0xe5ff0
movq 0x968de(%rip), %rdx     # 0xe5fc0
callq 0x4630
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x42e0
jmp 0x4f7c0
movq -0x10(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
andq $0x7f, %rax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, (%rax)
movq -0x18(%rbp), %rax
shrq $0x7, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x4f763
movq -0x10(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
andq $0x7f, %rax
orq $0x80, %rax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, (%rax)
movq -0x18(%rbp), %rax
shrq $0x7, %rax
movq %rax, -0x18(%rbp)
jmp 0x4f729
cmpq $0x0, -0x18(%rbp)
je 0x4f7ba
movl $0x10, %edi
callq 0x41e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
leaq 0x62071(%rip), %rsi     # 0xb17f6
callq 0x4140
jmp 0x4f78c
movq -0x38(%rbp), %rdi
movq 0x96859(%rip), %rsi     # 0xe5ff0
movq 0x96822(%rip), %rdx     # 0xe5fc0
callq 0x4630
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x42e0
jmp 0x4f7c0
addq $0x40, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x4680
nopl (%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
movq 0x8(%rdi), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, 0x8(%rdi)
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x10(%rbp), %rax
subq (%rax), %rdx
callq 0x4f5e0
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x4f82b
jmp 0x4f84a
leaq 0x61910(%rip), %rdi     # 0xb1142
leaq 0x61102(%rip), %rsi     # 0xb093b
movl $0x2e3, %edx            # imm = 0x2E3
leaq 0x61913(%rip), %rcx     # 0xb1158
callq 0x4270
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, 0x8(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)