LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/diff/Differ.cpp
// Function: checkZipDiff(char const*, char const*, char const*, int)
TCheckZipDiffResult checkZipDiff(const char* oldZipPath,const char* newZipPath,const char* diffFileName,int threadNum){
    hpatch_TFileStreamInput    oldZipStream;
    hpatch_TFileStreamInput    newZipStream;
    hpatch_TFileStreamInput    diffStream;
    TCheckZipDiffResult result=CHECK_OTHER_ERROR;
    bool            _isInClear=false;
    
    hpatch_TFileStreamInput_init(&oldZipStream);
    hpatch_TFileStreamInput_init(&newZipStream);
    hpatch_TFileStreamInput_init(&diffStream);
    checkC(hpatch_TFileStreamInput_open(&oldZipStream,oldZipPath));
    checkC(hpatch_TFileStreamInput_open(&newZipStream,newZipPath));
    checkC(hpatch_TFileStreamInput_open(&diffStream,diffFileName));
    result=checkZipDiffWithStream(&oldZipStream.base,&newZipStream.base,&diffStream.base,threadNum);
clear:
    _isInClear=true;
    checkC(hpatch_TFileStreamInput_close(&diffStream));
    checkC(hpatch_TFileStreamInput_close(&newZipStream));
    checkC(hpatch_TFileStreamInput_close(&oldZipStream));
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rsi
xorps %xmm0, %xmm0
leaq 0x80(%rsp), %rdi
movaps %xmm0, (%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, (%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x30(%rsp)
callq 0x3e9c9
pushq $0x5
popq %rbx
testl %eax, %eax
je 0xa4dc
leaq 0x40(%rsp), %rdi
movq %r15, %rsi
callq 0x3e9c9
testl %eax, %eax
je 0xa4e5
movq %rsp, %rdi
movq %r14, %rsi
callq 0x3e9c9
testl %eax, %eax
je 0xa4ee
leaq 0x80(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %rsp, %rdx
movl %ebp, %ecx
callq 0xa562
movl %eax, %ebx
jmp 0xa4fa
leaq 0x4517c(%rip), %rdi     # 0x4f65f
jmp 0xa4f5
leaq 0x451b1(%rip), %rdi     # 0x4f69d
jmp 0xa4f5
leaq 0x45ce7(%rip), %rdi     # 0x501dc
callq 0x4510
movq %rsp, %rdi
callq 0x3ec30
testl %eax, %eax
jne 0xa515
leaq 0x45d0d(%rip), %rdi     # 0x5021a
callq 0x4510
pushq $0x5
popq %rbx
leaq 0x40(%rsp), %rdi
callq 0x3ec30
testl %eax, %eax
jne 0xa532
leaq 0x451b1(%rip), %rdi     # 0x4f6db
callq 0x4510
pushq $0x5
popq %rbx
leaq 0x80(%rsp), %rdi
callq 0x3ec30
testl %eax, %eax
jne 0xa552
leaq 0x451c5(%rip), %rdi     # 0x4f70f
callq 0x4510
pushq $0x5
popq %rbx
movl %ebx, %eax
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/diff/Differ.cpp
// Function: TVectorStreamOutput::_write(hpatch_TStreamOutput const*, unsigned long long, unsigned char const*, unsigned char const*)
static hpatch_BOOL _write(const hpatch_TStreamOutput* stream,
                                  const hpatch_StreamPos_t writeToPos,
                                  const unsigned char* data,const unsigned char* data_end){
            TVectorStreamOutput* self=(TVectorStreamOutput*)stream->streamImport;
            std::vector<TByte>& dst=self->dst;
            size_t writeLen=(size_t)(data_end-data);
            if  (dst.size()==writeToPos){
                dst.insert(dst.end(),data,data_end);
            }else{
                assert((size_t)(writeToPos+writeLen)==writeToPos+writeLen);
                if (dst.size()<writeToPos+writeLen)
                    dst.resize((size_t)(writeToPos+writeLen));
                memcpy(&dst[(size_t)writeToPos],data,writeLen);
            }
            return hpatch_TRUE;
        }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq (%rdi), %rax
movq 0x20(%rax), %r12
movq (%r12), %rdi
movq 0x8(%r12), %rsi
movq %rsi, %rax
subq %rdi, %rax
cmpq %r15, %rax
jne 0xa866
movq %r12, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x87d8
jmp 0xa88c
subq %r14, %rbx
leaq (%rbx,%r15), %rsi
cmpq %rsi, %rax
jae 0xa87e
movq %r12, %rdi
callq 0x843c
movq (%r12), %rdi
addq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x42c0
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite.c
// Function: hpi_cache_update
hpi_BOOL _cache_update(struct _TInputCache* self){
    //    [                    cache  buf                        ]
    hpi_size_t len=self->cache_end;
    assert(len==self->cache_begin); //empty
    if (!self->read_code(self->inputStream,self->cache_buf,&len))
        len=0;
    //    |                                   len|               |
    self->cache_begin=0;
    self->cache_end=len;
    return len!=0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl 0x4(%rdi), %eax
movl %eax, 0xc(%rsp)
cmpl (%rdi), %eax
jne 0xb154
movq %rdi, %rbx
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rdi
leaq 0xc(%rsp), %rdx
callq *0x18(%rbx)
testl %eax, %eax
je 0xb13f
movl 0xc(%rsp), %eax
andl $0x0, (%rbx)
movl %eax, 0x4(%rbx)
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
movl %ecx, %eax
addq $0x10, %rsp
popq %rbx
retq
leaq 0x453b8(%rip), %rdi     # 0x50513
leaq 0x453c8(%rip), %rsi     # 0x5052a
leaq 0x453f3(%rip), %rcx     # 0x5055c
pushq $0x22
popq %rdx
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite.c
// Function: hpi_cache_read_1byte
hpi_fast_uint8 _cache_read_1byte(struct _TInputCache* self){
    if (self->cache_begin!=self->cache_end){
__cache_read_1byte:
        return self->cache_buf[self->cache_begin++];
    }
    if(_cache_update(self))
        goto __cache_read_1byte;
    else
        return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %eax
cmpl 0x4(%rdi), %eax
jne 0xb18a
movq %rbx, %rdi
callq 0xb114
testl %eax, %eax
je 0xb19b
movl (%rbx), %eax
movq 0x8(%rbx), %rcx
leal 0x1(%rax), %edx
movl %edx, (%rbx)
movl %eax, %eax
movzbl (%rcx,%rax), %eax
popq %rbx
retq
xorl %eax, %eax
jmp 0xb199
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite.c
// Function: hpatch_lite_open
hpi_BOOL hpatch_lite_open(hpi_TInputStreamHandle diff_data,hpi_TInputStream_read read_diff,
                          hpi_compressType* out_compress_type,hpi_pos_t* out_newSize,hpi_pos_t* out_uncompressSize){
    #define kHPatchLite_versionCode     1
    hpi_size_t lenn=hpi_kHeadSize;
    hpi_size_t lenu;
    hpi_byte   buf[(hpi_kHeadSize>sizeof(hpi_pos_t))?hpi_kHeadSize:sizeof(hpi_pos_t)];
    
    _CHECK(read_diff(diff_data,buf,&lenn));
    //HPatchLite type tag 2byte, version code(high 2bit)
    lenu=buf[3];
    _SAFE_CHECK((lenn==hpi_kHeadSize)&(buf[0]=='h')&(buf[1]=='I')&((lenu>>6)==kHPatchLite_versionCode));
    *out_compress_type=buf[2]; //compress type
    lenn=lenu&7; //newSize bytes(low 3bit)
    lenu=(lenu>>3)&7; //uncompressSize bytes(mid 3bit)

    _SAFE_CHECK((lenn<=sizeof(hpi_pos_t))&(lenu<=sizeof(hpi_pos_t)));
    _CHECK(read_diff(diff_data,buf,&lenn));
    *out_newSize=_hpi_readSize(buf,lenn);
    _CHECK(read_diff(diff_data,buf,&lenu));
    *out_uncompressSize=_hpi_readSize(buf,lenu);
    return hpi_TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r14
movq %rcx, %r13
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %r12
leaq 0x10(%rsp), %rdx
movl $0x4, (%rdx)
leaq 0xc(%rsp), %rsi
callq *%r15
xorl %ebx, %ebx
testl %eax, %eax
je 0xb283
movzbl 0xf(%rsp), %eax
movl %eax, %ecx
andl $-0x40, %ecx
cmpl $0x40, %ecx
jne 0xb283
cmpl $0x4, 0x10(%rsp)
jne 0xb283
cmpb $0x68, 0xc(%rsp)
jne 0xb283
cmpb $0x49, 0xd(%rsp)
jne 0xb283
movzbl 0xe(%rsp), %ecx
movl %ecx, (%rbp)
movl %eax, %ecx
andl $0x7, %ecx
movl %ecx, 0x10(%rsp)
shrl $0x3, %eax
andl $0x7, %eax
movl %eax, 0x14(%rsp)
cmpl $0x5, %ecx
setae %cl
cmpl $0x5, %eax
setae %al
orb %cl, %al
jne 0xb283
leaq 0xc(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %r12, %rdi
callq *%r15
testl %eax, %eax
je 0xb283
movl 0x10(%rsp), %esi
leaq 0xc(%rsp), %rbp
movq %rbp, %rdi
callq 0xb294
movl %eax, (%r13)
leaq 0x14(%rsp), %rdx
movq %r12, %rdi
movq %rbp, %rsi
callq *%r15
testl %eax, %eax
je 0xb283
movl 0x14(%rsp), %esi
leaq 0xc(%rsp), %rdi
callq 0xb294
movl %eax, (%r14)
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite.c
// Function: hpi_readSize
static hpi_pos_t _hpi_readSize(const hpi_byte* buf,hpi_size_t len){
    hpi_pos_t v=0;
    while(len--){
        v=(v<<8)|(hpi_pos_t)buf[len];
    }
    return v;
}

// Assembly:
movl %esi, %ecx
xorl %eax, %eax
movq %rcx, %rdx
subq $0x1, %rdx
jb 0xb2b0
shll $0x8, %eax
movzbl -0x1(%rdi,%rcx), %ecx
orl %ecx, %eax
movq %rdx, %rcx
jmp 0xb29b
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite.c
// Function: cache_unpackUInt
static hpi_pos_t _cache_unpackUInt(_TInputCache* self,hpi_pos_t v,hpi_fast_uint8 isNext){
    while (isNext){
        hpi_fast_uint8 b=_cache_read_1byte(self);
        v=(v<<7)|(b&127);
        isNext=b>>7;
    }
    return v;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %eax
movl %esi, %ebx
movq %rdi, %r14
testl %eax, %eax
je 0xb53a
movq %r14, %rdi
callq 0xb171
shll $0x7, %ebx
movl %eax, %ecx
andl $0x7f, %ecx
orl %ecx, %ebx
shrl $0x7, %eax
jmp 0xb51f
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite.c
// Function: hpatchi_inplace_open
hpi_BOOL hpatchi_inplace_open(hpi_TInputStreamHandle diff_data,hpi_TInputStream_read read_diff,
                              hpi_compressType* out_compress_type,hpi_pos_t* out_newSize,
                              hpi_pos_t* out_uncompressSize,hpi_size_t* out_extraSafeSize){
    #define kHPatchLite_inplaceCode     2
    hpi_size_t lenn=hpi_kInplaceHeadSize;
    hpi_size_t lenu,lene;
    hpi_byte   buf[(hpi_kInplaceHeadSize>sizeof(hpi_pos_t))?hpi_kInplaceHeadSize:sizeof(hpi_pos_t)];
    
    _CHECK(read_diff(diff_data,buf,&lenn));
    //HPatchLite type tag 2byte, version code(high 2bit)
    lenu=buf[3];
    _SAFE_CHECK((lenn==hpi_kInplaceHeadSize)&(buf[0]=='h')&(buf[1]=='I')&((lenu>>6)==kHPatchLite_inplaceCode));
    *out_compress_type=buf[2]; //compress type
    lenn=lenu&7; //newSize bytes(low 3bit)
    lenu=(lenu>>3)&7; //uncompressSize bytes(mid 3bit)
    lene=buf[4];

    _SAFE_CHECK((lenn<=sizeof(hpi_pos_t))&(lenu<=sizeof(hpi_pos_t))&(lene<=sizeof(hpi_size_t)));
    _CHECK(read_diff(diff_data,buf,&lenn));
    *out_newSize=_hpi_readSize(buf,lenn);
    _CHECK(read_diff(diff_data,buf,&lenu));
    *out_uncompressSize=_hpi_readSize(buf,lenu);
    _CHECK(read_diff(diff_data,buf,&lene));
    *out_extraSafeSize=(hpi_size_t)_hpi_readSize(buf,lene);
    return hpi_TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, 0x20(%rsp)
movq %r8, %r12
movq %rcx, %rbp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r13
leaq 0x14(%rsp), %rdx
movl $0x5, (%rdx)
leaq 0xf(%rsp), %rsi
callq *%r15
xorl %ebx, %ebx
testl %eax, %eax
je 0xb671
movzbl 0x12(%rsp), %eax
movl %eax, %ecx
andl $-0x40, %ecx
cmpl $0x80, %ecx
jne 0xb671
cmpl $0x5, 0x14(%rsp)
jne 0xb671
cmpb $0x68, 0xf(%rsp)
jne 0xb671
cmpb $0x49, 0x10(%rsp)
jne 0xb671
movzbl 0x11(%rsp), %ecx
movl %ecx, (%r14)
movl %eax, %ecx
andl $0x7, %ecx
movl %ecx, 0x14(%rsp)
shrl $0x3, %eax
andl $0x7, %eax
movl %eax, 0x1c(%rsp)
movzbl 0x13(%rsp), %edx
cmpl $0x5, %edx
setae %sil
movl %edx, 0x18(%rsp)
cmpl $0x5, %ecx
setae %cl
cmpl $0x5, %eax
setae %al
orb %sil, %cl
orb %al, %cl
jne 0xb671
leaq 0xf(%rsp), %rsi
leaq 0x14(%rsp), %rdx
movq %r13, %rdi
callq *%r15
testl %eax, %eax
je 0xb671
movl 0x14(%rsp), %esi
leaq 0xf(%rsp), %r14
movq %r14, %rdi
callq 0xb294
movl %eax, (%rbp)
leaq 0x1c(%rsp), %rdx
movq %r13, %rdi
movq %r14, %rsi
callq *%r15
testl %eax, %eax
je 0xb671
movl 0x1c(%rsp), %esi
leaq 0xf(%rsp), %r14
movq %r14, %rdi
callq 0xb294
movl %eax, (%r12)
leaq 0x18(%rsp), %rdx
movq %r13, %rdi
movq %r14, %rsi
callq *%r15
testl %eax, %eax
je 0xb671
movl 0x18(%rsp), %esi
leaq 0xf(%rsp), %rdi
callq 0xb294
movq 0x20(%rsp), %rcx
movl %eax, (%rcx)
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite.c
// Function: hpatchi_inplaceB
hpi_BOOL hpatchi_inplaceB(hpatchi_listener_t* listener,hpi_pos_t newSize,
                          hpi_byte* temp_cache,hpi_size_t extraSafeSize_in_temp_cache,hpi_size_t temp_cache_size){
    hpi_BOOL result;
    hpatchi_listener_extra_t extra_listener;
    assert(temp_cache_size>=hpi_kMinCacheSize+extraSafeSize_in_temp_cache);
    _hpatchi_listener_extra_init(&extra_listener,listener,temp_cache,extraSafeSize_in_temp_cache);
    result=hpatch_lite_patch(extraSafeSize_in_temp_cache?&extra_listener.base:listener,newSize,
                             temp_cache+extraSafeSize_in_temp_cache,temp_cache_size-extraSafeSize_in_temp_cache);
    return result&&_hpatchi_listener_extra_out(&extra_listener,extra_listener.cached_data_len);
}

// Assembly:
subq $0x48, %rsp
leal 0x2(%rcx), %eax
cmpl %r8d, %eax
ja 0xb6fb
movups (%rdi), %xmm0
movq %rsp, %rax
movaps %xmm0, (%rax)
leaq 0x108(%rip), %r9        # 0xb7a6
movq %r9, 0x10(%rax)
leaq 0x107(%rip), %r9        # 0xb7b0
movq %r9, 0x18(%rax)
movq %rdi, 0x20(%rax)
movq %rdx, 0x28(%rax)
movl %ecx, 0x30(%rax)
andq $0x0, 0x34(%rax)
testl %ecx, %ecx
cmoveq %rdi, %rax
movl %ecx, %r9d
addq %rdx, %r9
subl %ecx, %r8d
movq %rax, %rdi
movq %r9, %rdx
movl %r8d, %ecx
callq 0xb2b1
testl %eax, %eax
je 0xb6f4
movq %rsp, %rdi
movl 0x38(%rdi), %esi
callq 0xb71a
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
setne %al
jmp 0xb6f6
xorl %eax, %eax
addq $0x48, %rsp
retq
leaq 0x44ee4(%rip), %rdi     # 0x505e6
leaq 0x44e21(%rip), %rsi     # 0x5052a
leaq 0x44f15(%rip), %rcx     # 0x50625
movl $0x126, %edx            # imm = 0x126
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite.c
// Function: hpatchi_listener_extra_out
static hpi_BOOL _hpatchi_listener_extra_out(hpatchi_listener_extra_t* self,hpi_size_t out_size){
    assert(out_size<=self->cached_data_len);
    while (out_size){
        hpi_size_t cur_len=self->write_extra_size-self->cached_data_pos;
        cur_len=(cur_len<=out_size)?cur_len:out_size;
        if (!self->_wrap_listener->write_new(self->_wrap_listener,self->write_extra+self->cached_data_pos,cur_len))
            return _hpi_FALSE;
        self->cached_data_pos+=cur_len;
        self->cached_data_pos-=(self->cached_data_pos<self->write_extra_size)?0:self->write_extra_size;
        self->cached_data_len-=cur_len;
        out_size-=cur_len;
    }
    return hpi_TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpl %esi, 0x38(%rdi)
jb 0xb787
movl %esi, %ebp
movq %rdi, %r14
pushq $0x1
popq %rbx
xorl %r12d, %r12d
testl %ebp, %ebp
je 0xb77c
movl 0x30(%r14), %r15d
movl 0x34(%r14), %esi
subl %esi, %r15d
cmpl %ebp, %r15d
cmovael %ebp, %r15d
movq 0x20(%r14), %rdi
addq 0x28(%r14), %rsi
movl %r15d, %edx
callq *0x18(%rdi)
testl %eax, %eax
je 0xb77a
movl 0x34(%r14), %eax
addl %r15d, %eax
movl 0x30(%r14), %ecx
cmpl %ecx, %eax
cmovbl %r12d, %ecx
subl %ecx, %eax
movl %eax, 0x34(%r14)
subl %r15d, 0x38(%r14)
subl %r15d, %ebp
jmp 0xb732
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x44f82(%rip), %rdi     # 0x50710
leaq 0x44d95(%rip), %rsi     # 0x5052a
leaq 0x44f94(%rip), %rcx     # 0x50730
movl $0xed, %edx
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite.c
// Function: hpatchi_listener_extra_write_new
static hpi_BOOL _hpatchi_listener_extra_write_new(hpatchi_listener_t* listener,const hpi_byte* data,hpi_size_t data_size){
    hpatchi_listener_extra_t* self=(hpatchi_listener_extra_t*)listener;
    while (data_size){
        hpi_size_t posi;
        hpi_size_t cur_len=data_size+self->cached_data_len;
        if (cur_len>self->write_extra_size){//need out cached data by _wrap_listener->write_new()
            cur_len-=self->write_extra_size;
            cur_len=(cur_len<=self->cached_data_len)?cur_len:self->cached_data_len;
            if (!_hpatchi_listener_extra_out(self,cur_len)) return _hpi_FALSE;
        }
        assert(self->cached_data_len<self->write_extra_size);

        cur_len=self->write_extra_size-self->cached_data_len;
        cur_len=(cur_len<=data_size)?cur_len:data_size;
        data_size-=cur_len;
        posi=self->cached_data_pos+self->cached_data_len;
        self->cached_data_len+=cur_len;
        while (cur_len--){//save data to cache
            posi-=(posi<self->write_extra_size)?0:self->write_extra_size;
            self->write_extra[posi++]=*data++;
        }
    }
    return hpi_TRUE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %r12
pushq $0x1
popq %rbx
testl %r14d, %r14d
je 0xb846
movl 0x30(%r12), %eax
movl 0x38(%r12), %esi
leal (%rsi,%r14), %ecx
subl %eax, %ecx
jbe 0xb7f6
cmpl %esi, %ecx
cmovbl %ecx, %esi
movq %r12, %rdi
callq 0xb71a
testl %eax, %eax
je 0xb844
movl 0x30(%r12), %eax
movl 0x38(%r12), %esi
subl %esi, %eax
jbe 0xb854
cmpl %r14d, %eax
cmovael %r14d, %eax
leal (%rax,%rsi), %ecx
addl 0x34(%r12), %esi
movl %ecx, 0x38(%r12)
movl %eax, %ecx
subl $0x1, %ecx
jb 0xb83f
movl 0x30(%r12), %edi
xorl %edx, %edx
cmpl %edi, %esi
jb 0xb822
movl %edi, %edx
movb (%r15), %dil
incq %r15
movq 0x28(%r12), %r8
movl %esi, %r9d
subl %edx, %r9d
negl %edx
addl %edx, %esi
incl %esi
movb %dil, (%r8,%r9)
jmp 0xb810
subl %eax, %r14d
jmp 0xb7c4
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x44e29(%rip), %rdi     # 0x50684
leaq 0x44cc8(%rip), %rsi     # 0x5052a
leaq 0x44e48(%rip), %rcx     # 0x506b1
movl $0x105, %edx            # imm = 0x105
callq 0x4230
nop
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: create_compressed_diff(unsigned char const*, unsigned char const*, unsigned char const*, unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char>>&, hdiff_TCompress const*, int, bool, ICoverLinesListener*, unsigned long)
void create_compressed_diff(const TByte* newData,const TByte* newData_end,
                            const TByte* oldData,const TByte* oldData_end,
                            std::vector<TByte>& out_diff,const hdiff_TCompress* compressPlugin,
                            int kMinSingleMatchScore,bool isUseBigCacheMatch,
                            ICoverLinesListener* listener,size_t threadNum){
    TDiffData diff;
    std::vector<TOldCover> covers;
    get_diff(newData,newData_end,oldData,oldData_end,diff,covers,
             kMinSingleMatchScore,isUseBigCacheMatch,listener,0,threadNum);
    serialize_compressed_diff(diff,covers,out_diff,compressPlugin);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %r9, %rbx
movq %r8, %r14
movl 0x60(%rsp), %eax
movb 0x68(%rsp), %r8b
movq 0x70(%rsp), %r10
movq 0x78(%rsp), %r11
xorps %xmm0, %xmm0
movq %rsp, %r9
movaps %xmm0, (%r9)
andq $0x0, 0x10(%r9)
movzbl %r8b, %r15d
leaq 0x20(%rsp), %r8
pushq $0x1
pushq %r11
pushq $0x0
pushq %r10
pushq %r15
pushq %rax
callq 0xbbbd
addq $0x30, %rsp
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xc71b
movq %rsp, %rdi
callq 0xc678
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0xc678
movq %rbx, %rdi
callq 0x4600
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: create_compressed_diff(unsigned char const*, unsigned char const*, unsigned char const*, unsigned char const*, hpatch_TStreamOutput const*, hdiff_TCompress const*, int, bool, ICoverLinesListener*, unsigned long)
void create_compressed_diff(const TByte* newData,const TByte* newData_end,
                            const TByte* oldData,const TByte* oldData_end,
                            const hpatch_TStreamOutput* out_diff,const hdiff_TCompress* compressPlugin,
                            int kMinSingleMatchScore,bool isUseBigCacheMatch,
                            ICoverLinesListener* listener,size_t threadNum){
    std::vector<unsigned char> _out_diff;
    create_compressed_diff(newData,newData_end,oldData,oldData_end,_out_diff,
                           compressPlugin,kMinSingleMatchScore,isUseBigCacheMatch,listener,threadNum);
    checki(out_diff->write(out_diff,0,_out_diff.data(),_out_diff.data()+_out_diff.size()),"create_compressed_diff() out_diff->write");
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %r8, %rbx
movl 0x50(%rsp), %eax
movb 0x58(%rsp), %r10b
movaps 0x60(%rsp), %xmm0
xorps %xmm1, %xmm1
leaq 0x20(%rsp), %r8
movaps %xmm1, (%r8)
andq $0x0, 0x10(%r8)
movups %xmm0, 0x10(%rsp)
movzbl %r10b, %r10d
movl %r10d, 0x8(%rsp)
movl %eax, (%rsp)
callq 0xc695
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rcx
movq %rbx, %rdi
xorl %esi, %esi
callq *0x18(%rbx)
testl %eax, %eax
je 0xcc27
leaq 0x20(%rsp), %rdi
callq 0x8b88
addq $0x38, %rsp
popq %rbx
popq %r14
retq
pushq $0x10
popq %rdi
callq 0x41c0
movq %rax, %rbx
leaq 0x43b44(%rip), %rsi     # 0x5077d
movq %rax, %rdi
callq 0x4120
movq 0x683a0(%rip), %rsi     # 0x74fe8
movq 0x68369(%rip), %rdx     # 0x74fb8
movq %rbx, %rdi
callq 0x45b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x4290
jmp 0xcc67
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x8b88
movq %r14, %rdi
callq 0x4600
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: create_single_compressed_diff(unsigned char const*, unsigned char const*, unsigned char const*, unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char>>&, hdiff_TCompress const*, int, unsigned long, bool, ICoverLinesListener*, unsigned long)
void create_single_compressed_diff(const TByte* newData,const TByte* newData_end,
                                   const TByte* oldData,const TByte* oldData_end,
                                   std::vector<unsigned char>& out_diff,
                                   const hdiff_TCompress* compressPlugin,int kMinSingleMatchScore,
                                   size_t patchStepMemSize,bool isUseBigCacheMatch,
                                   ICoverLinesListener* listener,size_t threadNum){
    TVectorAsStreamOutput outDiffStream(out_diff);
    create_single_compressed_diff(newData,newData_end,oldData,oldData_end,&outDiffStream,
                                  compressPlugin,kMinSingleMatchScore,patchStepMemSize,
                                  isUseBigCacheMatch,listener,threadNum);
}

// Assembly:
pushq %rbx
subq $0x50, %rsp
movl 0x60(%rsp), %r10d
movq 0x68(%rsp), %r11
movb 0x70(%rsp), %bl
movups 0x78(%rsp), %xmm0
leaq 0x28(%rsp), %rax
movq %r8, 0x20(%rax)
movq %rax, (%rax)
orq $-0x1, 0x8(%rax)
leaq 0x54f7(%rip), %r8       # 0x121a0
movq %r8, 0x10(%rax)
leaq 0x5526(%rip), %r8       # 0x121da
movq %r8, 0x18(%rax)
movups %xmm0, 0x18(%rsp)
movzbl %bl, %r8d
movl %r8d, 0x10(%rsp)
movq %r11, 0x8(%rsp)
movl %r10d, (%rsp)
movq %rax, %r8
callq 0xccdd
addq $0x50, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: create_single_compressed_diff(unsigned char const*, unsigned char const*, unsigned char const*, unsigned char const*, hpatch_TStreamOutput const*, hdiff_TCompress const*, int, unsigned long, bool, ICoverLinesListener*, unsigned long)
void create_single_compressed_diff(const TByte* newData,const TByte* newData_end,
                                   const TByte* oldData,const TByte* oldData_end,
                                   const hpatch_TStreamOutput* out_diff,
                                   const hdiff_TCompress* compressPlugin,int kMinSingleMatchScore,
                                   size_t patchStepMemSize,bool isUseBigCacheMatch,
                                   ICoverLinesListener* listener,size_t threadNum){
    TDiffData diff;
    std::vector<TOldCover> covers;
    get_diff(newData,newData_end,oldData,oldData_end,diff,covers,
             kMinSingleMatchScore,isUseBigCacheMatch,listener,0,threadNum);

    hpatch_TStreamInput _newStream;
    hpatch_TStreamInput _oldStream;
    mem_as_hStreamInput(&_newStream,diff.newData,diff.newData_end);
    mem_as_hStreamInput(&_oldStream,diff.oldData,diff.oldData_end);
    const TCovers _covers((void*)covers.data(),covers.size(),
                          sizeof(*covers.data())==sizeof(hpatch_TCover32));
    serialize_single_compressed_diff(&_newStream,&_oldStream,false,_covers,
                                     out_diff,compressPlugin,patchStepMemSize);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq %r9, %rbx
movq %r8, %r14
movl 0xc0(%rsp), %eax
movb 0xd0(%rsp), %r8b
movq 0xd8(%rsp), %r10
movq 0xe0(%rsp), %r11
xorps %xmm0, %xmm0
movq %rsp, %r9
movaps %xmm0, (%r9)
andq $0x0, 0x10(%r9)
movzbl %r8b, %r15d
leaq 0x18(%rsp), %r8
pushq $0x1
pushq %r11
pushq $0x0
pushq %r10
pushq %r15
pushq %rax
callq 0xbbbd
addq $0x30, %rsp
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
leaq 0x58(%rsp), %rdi
callq 0x3a60a
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0x38(%rsp), %rdi
callq 0x3a60a
movq 0xc8(%rsp), %r10
movq (%rsp), %rsi
movq 0x8(%rsp), %rax
subq %rsi, %rax
pushq $0x18
popq %rcx
cqto
idivq %rcx
leaq 0x78(%rsp), %rcx
movq %rsi, 0x10(%rcx)
movq %rax, 0x18(%rcx)
movb $0x0, 0x20(%rcx)
andq $0x0, (%rcx)
subq $0x8, %rsp
leaq 0x60(%rsp), %rdi
leaq 0x40(%rsp), %rsi
xorl %edx, %edx
movq %r14, %r8
movq %rbx, %r9
pushq %r10
callq 0xcdde
popq %rax
popq %rcx
movq %rsp, %rdi
callq 0xc678
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0xcdcb
jmp 0xcdcb
movq %rax, %rbx
movq %rsp, %rdi
callq 0xc678
movq %rbx, %rdi
callq 0x4600
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: create_single_compressed_diff_stream(hpatch_TStreamInput const*, hpatch_TStreamInput const*, hpatch_TStreamOutput const*, hdiff_TCompress const*, unsigned long, unsigned long, hdiff_TMTSets_s const*)
void create_single_compressed_diff_stream(const hpatch_TStreamInput*  newData,
                                          const hpatch_TStreamInput*  oldData,
                                          const hpatch_TStreamOutput* out_diff,
                                          const hdiff_TCompress* compressPlugin,
                                          size_t kMatchBlockSize,size_t patchStepMemSize,
                                          const hdiff_TMTSets_s* mtsets){
    TCoversBuf covers(newData->streamSize,oldData->streamSize);
    get_match_covers_by_block(newData,oldData,&covers,kMatchBlockSize,mtsets);
    serialize_single_compressed_diff(newData,oldData,true,covers,
                                     out_diff,compressPlugin,patchStepMemSize);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %r9, %r15
movq %r8, %rax
movq %rcx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movq 0x8(%rsi), %rcx
orq 0x8(%rdi), %rcx
movq %rdx, %r13
shrq $0x20, %rcx
xorps %xmm0, %xmm0
leaq 0x8(%rsp), %rdx
movups %xmm0, 0x10(%rdx)
sete 0x20(%rdx)
movq 0x90(%rsp), %r8
movups %xmm0, 0x28(%rdx)
movups %xmm0, 0x38(%rdx)
movups %xmm0, 0x48(%rdx)
leaq 0x52a4(%rip), %rcx      # 0x122a6
movq %rcx, (%rdx)
leaq 0x5306(%rip), %rcx      # 0x12312
movq %rcx, 0x8(%rdx)
movq %rax, %rcx
callq 0xd062
movq %r15, (%rsp)
pushq $0x1
popq %rdx
leaq 0x8(%rsp), %rcx
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %r8
movq %rbx, %r9
callq 0xcdde
leaq 0x8(%rsp), %rdi
callq 0x11e7a
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x11e7a
movq %rbx, %rdi
callq 0x4600
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: get_match_covers_by_block(hpatch_TStreamInput const*, hpatch_TStreamInput const*, hpatch_TOutputCovers*, unsigned long, hdiff_TMTSets_s const*)
void get_match_covers_by_block(const hpatch_TStreamInput* newData,const hpatch_TStreamInput* oldData,
                               hpatch_TOutputCovers* out_covers,size_t kMatchBlockSize,const hdiff_TMTSets_s* mtsets){
    assert(out_covers->push_cover!=0);
    TDigestMatcher matcher(oldData,newData,kMatchBlockSize,mtsets?*mtsets:hdiff_TMTSets_s_kEmpty);
    matcher.search_cover(out_covers);
    //todo: + extend_cover_stream ?
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdx, %rbx
cmpq $0x0, (%rdx)
je 0xd0b6
movq %rdi, %rdx
testq %r8, %r8
leaq 0x44546(%rip), %rax     # 0x515c8
cmovneq %r8, %rax
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rax, %r8
callq 0x19908
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1ae92
leaq 0x8(%rsp), %rdi
callq 0x19888
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
leaq 0x43860(%rip), %rdi     # 0x5091d
leaq 0x43873(%rip), %rsi     # 0x50937
leaq 0x43894(%rip), %rcx     # 0x5095f
movl $0x4e9, %edx            # imm = 0x4E9
callq 0x4230
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x19888
movq %rbx, %rdi
callq 0x4600
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: check_diff(unsigned char const*, unsigned char const*, unsigned char const*, unsigned char const*, unsigned char const*, unsigned char const*)
bool check_diff(const TByte* newData,const TByte* newData_end,
                const TByte* oldData,const TByte* oldData_end,
                const TByte* diff,const TByte* diff_end){
    hpatch_TStreamInput  newStream;
    hpatch_TStreamInput  oldStream;
    hpatch_TStreamInput  diffStream;
    mem_as_hStreamInput(&newStream,newData,newData_end);
    mem_as_hStreamInput(&oldStream,oldData,oldData_end);
    mem_as_hStreamInput(&diffStream,diff,diff_end);
    return check_diff(&newStream,&oldStream,&diffStream);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %rdx
movq %rdi, %rsi
leaq 0x48(%rsp), %r13
movq %r13, %rdi
callq 0x3a60a
leaq 0x28(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x3a60a
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3a60a
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0xd15a
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: check_diff(hpatch_TStreamInput const*, hpatch_TStreamInput const*, hpatch_TStreamInput const*)
bool check_diff(const hpatch_TStreamInput*  newData,
                const hpatch_TStreamInput*  oldData,
                const hpatch_TStreamInput*  diff){
    const size_t kACacheBufSize=hdiff_kFileIOBufBestSize;
    TAutoMem _cache(kACacheBufSize*(1+8));
    _TCheckOutNewDataStream out_newData(newData,_cache.data(),kACacheBufSize);
    _test_rt(patch_stream_with_cache(&out_newData,oldData,diff,
                                     _cache.data()+kACacheBufSize,_cache.data_end()));
    _test_rt(out_newData.isWriteFinish());
    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movq %rsp, %r15
movl $0x480000, %esi         # imm = 0x480000
movq %r15, %rdi
callq 0x11e94
movq (%r15), %rdx
leaq 0x18(%rsp), %rdi
movl $0x80000, %r15d         # imm = 0x80000
movl $0x80000, %ecx          # imm = 0x80000
movq %r12, %rsi
callq 0x20e70
addq (%rsp), %r15
movq 0x8(%rsp), %r8
leaq 0x18(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x3b908
testl %eax, %eax
je 0xd1e1
movq 0x38(%rsp), %rax
movq 0x40(%rsp), %rcx
movb $0x1, %bl
cmpq 0x8(%rax), %rcx
jne 0xd1f6
movq %rsp, %rdi
callq 0x13a5c
movl %ebx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x67de0(%rip), %rax     # 0x74fc8
movq (%rax), %rcx
leaq 0x435b4(%rip), %rdi     # 0x507a6
pushq $0x70
jmp 0xd209
movq 0x67dcb(%rip), %rax     # 0x74fc8
movq (%rax), %rcx
leaq 0x43610(%rip), %rdi     # 0x50817
pushq $0x29
popq %rsi
pushq $0x1
popq %rdx
callq 0x4680
xorl %ebx, %ebx
jmp 0xd1cb
movq %rax, %rbx
movq %rsp, %rdi
callq 0x13a5c
movq %rbx, %rdi
callq 0x4600
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: check_compressed_diff(unsigned char const*, unsigned char const*, unsigned char const*, unsigned char const*, unsigned char const*, unsigned char const*, hpatch_TDecompress*)
bool check_compressed_diff(const TByte* newData,const TByte* newData_end,
                           const TByte* oldData,const TByte* oldData_end,
                           const TByte* diff,const TByte* diff_end,
                           hpatch_TDecompress* decompressPlugin){
    hpatch_TStreamInput  newStream;
    hpatch_TStreamInput  oldStream;
    hpatch_TStreamInput  diffStream;
    mem_as_hStreamInput(&newStream,newData,newData_end);
    mem_as_hStreamInput(&oldStream,oldData,oldData_end);
    mem_as_hStreamInput(&diffStream,diff,diff_end);
    return check_compressed_diff(&newStream,&oldStream,&diffStream,decompressPlugin);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %rdx
movq %rdi, %rsi
leaq 0x48(%rsp), %rbp
movq %rbp, %rdi
callq 0x3a60a
leaq 0x28(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x3a60a
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3a60a
movq %rbp, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq 0xa0(%rsp), %rcx
callq 0xd2a1
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: check_compressed_diff(hpatch_TStreamInput const*, hpatch_TStreamInput const*, hpatch_TStreamInput const*, hpatch_TDecompress*)
bool check_compressed_diff(const hpatch_TStreamInput*  newData,
                           const hpatch_TStreamInput*  oldData,
                           const hpatch_TStreamInput*  compressed_diff,
                           hpatch_TDecompress* decompressPlugin){
    const size_t kACacheBufSize=hdiff_kFileIOBufBestSize;
    TAutoMem _cache(kACacheBufSize*(1+6));
    _TCheckOutNewDataStream out_newData(newData,_cache.data(),kACacheBufSize);
    _test_rt(patch_decompress_with_cache(&out_newData,oldData,compressed_diff,decompressPlugin,
                                         _cache.data()+kACacheBufSize,_cache.data_end()));
    _test_rt(out_newData.isWriteFinish());
    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r13
leaq 0x8(%rsp), %r12
movl $0x380000, %esi         # imm = 0x380000
movq %r12, %rdi
callq 0x11e94
movq (%r12), %rdx
leaq 0x20(%rsp), %rdi
movl $0x80000, %r12d         # imm = 0x80000
movl $0x80000, %ecx          # imm = 0x80000
movq %r13, %rsi
callq 0x20e70
addq 0x8(%rsp), %r12
movq 0x10(%rsp), %r9
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movq %r12, %r8
callq 0x3c5aa
testl %eax, %eax
je 0xd338
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rcx
movb $0x1, %bl
cmpq 0x8(%rax), %rcx
jne 0xd353
leaq 0x8(%rsp), %rdi
callq 0x13a5c
movl %ebx, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x67c89(%rip), %rax     # 0x74fc8
movq (%rax), %rcx
leaq 0x434f8(%rip), %rdi     # 0x50841
pushq $0x1
popq %rdx
movl $0x90, %esi
jmp 0xd36a
movq 0x67c6e(%rip), %rax     # 0x74fc8
movq (%rax), %rcx
leaq 0x434b3(%rip), %rdi     # 0x50817
pushq $0x29
popq %rsi
pushq $0x1
popq %rdx
callq 0x4680
xorl %ebx, %ebx
jmp 0xd31e
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x13a5c
movq %rbx, %rdi
callq 0x4600
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: check_single_compressed_diff(hpatch_TStreamInput const*, hpatch_TStreamInput const*, hpatch_TStreamInput const*, hpatch_TDecompress*)
bool check_single_compressed_diff(const hpatch_TStreamInput* newData,
                                  const hpatch_TStreamInput* oldData,
                                  const hpatch_TStreamInput* diff,
                                  hpatch_TDecompress* decompressPlugin){
    sspatch_listener_t listener={0};
    listener.import=decompressPlugin;
    listener.onDiffInfo=_check_single_onDiffInfo;
    listener.onPatchFinish=_check_single_onPatchFinish;
        
    const size_t kACacheBufSize=hdiff_kFileIOBufBestSize;
    TAutoMem _cache(kACacheBufSize*1);
    _TCheckOutNewDataStream out_newData(newData,_cache.data(),kACacheBufSize);

    _test_rt(patch_single_stream(&listener,&out_newData,oldData,diff,0,0));
    _test_rt(out_newData.isWriteFinish());
    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rcx, 0x8(%rsp)
leaq 0x10a(%rip), %rax       # 0xd52a
movq %rax, 0x10(%rsp)
leaq 0x15b(%rip), %rax       # 0xd587
movq %rax, 0x18(%rsp)
leaq 0x20(%rsp), %r12
movl $0x80000, %esi          # imm = 0x80000
movq %r12, %rdi
callq 0x11e94
movq (%r12), %rdx
leaq 0x38(%rsp), %rdi
movl $0x80000, %ecx          # imm = 0x80000
movq %r15, %rsi
callq 0x20e70
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
movq %r14, %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x3d85f
testl %eax, %eax
je 0xd4a2
movq 0x58(%rsp), %rax
movq 0x60(%rsp), %rcx
movb $0x1, %bl
cmpq 0x8(%rax), %rcx
jne 0xd4b7
leaq 0x20(%rsp), %rdi
callq 0x13a5c
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x67b1f(%rip), %rax     # 0x74fc8
movq (%rax), %rcx
leaq 0x4341f(%rip), %rdi     # 0x508d2
pushq $0x4a
jmp 0xd4ca
movq 0x67b0a(%rip), %rax     # 0x74fc8
movq (%rax), %rcx
leaq 0x4334f(%rip), %rdi     # 0x50817
pushq $0x29
popq %rsi
pushq $0x1
popq %rdx
callq 0x4680
xorl %ebx, %ebx
jmp 0xd48a
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x13a5c
movq %rbx, %rdi
callq 0x4600
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: check_single_onDiffInfo(sspatch_listener_t*, hpatch_singleCompressedDiffInfo const*, hpatch_TDecompress**, unsigned char**, unsigned char**)
static hpatch_BOOL _check_single_onDiffInfo(struct sspatch_listener_t* listener,
                                                const hpatch_singleCompressedDiffInfo* info,
                                                hpatch_TDecompress** out_decompressPlugin,
                                                unsigned char** out_temp_cache,
                                                unsigned char** out_temp_cacheEnd){
        size_t memSize=(size_t)(info->stepMemSize+hdiff_kFileIOBufBestSize*3);
        *out_temp_cache=(unsigned char*)malloc(memSize);
        *out_temp_cacheEnd=(*out_temp_cache)+memSize;   
        *out_decompressPlugin=(info->compressType[0]=='\0')?0:(hpatch_TDecompress*)listener->import;
        return hpatch_TRUE;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r14
movq 0x30(%rsi), %rbp
leaq 0x180000(%rbp), %rdi
callq 0x4430
movq %rax, (%r12)
addq %rbp, %rax
addq $0x180000, %rax         # imm = 0x180000
movq %rax, (%r15)
cmpb $0x0, 0x38(%r13)
je 0xd570
movq (%r14), %rax
jmp 0xd572
xorl %eax, %eax
movq %rax, (%rbx)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: _hdiff_private__create_compressed_diff(unsigned char const*, unsigned char const*, unsigned char const*, unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char>>&, hdiff_TCompress const*, int, hdiff_private::TSuffixString const*)
void __hdiff_private__create_compressed_diff(const TByte* newData,const TByte* newData_end,
                                             const TByte* oldData,const TByte* oldData_end,
                                             std::vector<TByte>& out_diff,
                                             const hdiff_TCompress* compressPlugin,int kMinSingleMatchScore,
                                             const TSuffixString* sstring){
    TDiffData diff;
    std::vector<TOldCover> covers;
    get_diff(newData,newData_end,oldData,oldData_end,diff,covers,
             kMinSingleMatchScore,false,0,sstring,1);
    serialize_compressed_diff(diff,covers,out_diff,compressPlugin);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %r9, %rbx
movq %r8, %r14
movl 0x50(%rsp), %eax
movq 0x58(%rsp), %r10
xorps %xmm0, %xmm0
movq %rsp, %r9
movaps %xmm0, (%r9)
andq $0x0, 0x10(%r9)
leaq 0x18(%rsp), %r8
pushq $0x1
pushq $0x1
pushq %r10
pushq $0x0
pushq $0x0
pushq %rax
callq 0xbbbd
addq $0x30, %rsp
leaq 0x18(%rsp), %rdi
movq %rsp, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xc71b
movq %rsp, %rdi
callq 0xc678
addq $0x38, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0xc678
movq %rbx, %rdi
callq 0x4600
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: get_match_covers_by_block(unsigned char const*, unsigned char const*, unsigned char const*, unsigned char const*, hpatch_TOutputCovers*, unsigned long, unsigned long)
void get_match_covers_by_block(const unsigned char* newData,const unsigned char* newData_end,
                               const unsigned char* oldData,const unsigned char* oldData_end,
                               hpatch_TOutputCovers* out_covers,size_t kMatchBlockSize,size_t threadNum){
    hdiff_TStreamInput oldData_stream;
    mem_as_hStreamInput(&oldData_stream,oldData,oldData_end);
    hdiff_TStreamInput newData_stream;
    mem_as_hStreamInput(&newData_stream,newData,newData_end);
    hdiff_TMTSets_s mtsets={threadNum,threadNum,true,true,false};
    get_match_covers_by_block(&newData_stream,&oldData_stream,out_covers,kMatchBlockSize,&mtsets);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rsi, %r15
movq %rdi, %r12
movq 0x90(%rsp), %r13
movq %rsp, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
callq 0x3a60a
leaq 0x38(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x3a60a
leaq 0x20(%rsp), %r8
movq %r13, (%r8)
movq %r13, 0x8(%r8)
movw $0x101, 0x10(%r8)       # imm = 0x101
movb $0x0, 0x12(%r8)
movq %rbp, %rdi
movq %rsp, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xd062
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: get_match_covers_by_sstring(unsigned char const*, unsigned char const*, unsigned char const*, unsigned char const*, std::vector<hpatch_TCover_sz, std::allocator<hpatch_TCover_sz>>&, int, bool, ICoverLinesListener*, unsigned long, bool)
void get_match_covers_by_sstring(const unsigned char* newData,const unsigned char* newData_end,
                                 const unsigned char* oldData,const unsigned char* oldData_end,
                                 std::vector<hpatch_TCover_sz>& out_covers,int kMinSingleMatchScore,
                                 bool isUseBigCacheMatch,ICoverLinesListener* listener,
                                 size_t threadNum,bool isCanExtendCover){
    TDiffData diff;
    std::vector<TOldCover> covers;
    assert(sizeof(TOldCover)==sizeof(hpatch_TCover_sz));
    { std::vector<hpatch_TCover_sz> tmp; tmp.swap(out_covers); }
    get_diff(newData,newData_end,oldData,oldData_end,diff,covers,
             kMinSingleMatchScore,isUseBigCacheMatch,listener,0,threadNum,isCanExtendCover);
    void* pcovers=&covers;
    out_covers.swap(*(std::vector<hpatch_TCover_sz>*)pcovers);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r9, 0x8(%rsp)
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movaps %xmm0, (%r14)
andq $0x0, 0x10(%r14)
movups (%r8), %xmm1
leaq 0x30(%rsp), %rdi
movaps %xmm1, (%rdi)
movq 0x10(%r8), %rax
movq %rax, 0x10(%rdi)
movups %xmm0, (%r8)
andq $0x0, 0x10(%r8)
callq 0x13ba4
movzbl 0xb8(%rsp), %eax
movzbl 0xa0(%rsp), %r10d
leaq 0x48(%rsp), %r8
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r9
pushq %rax
pushq 0xb8(%rsp)
pushq $0x0
pushq 0xc0(%rsp)
pushq %r10
pushq 0x30(%rsp)
callq 0xbbbd
addq $0x30, %rsp
movq 0x10(%rbx), %rax
leaq 0x10(%rsp), %rdi
movaps (%rdi), %xmm0
movq 0x10(%rdi), %rcx
movq %rcx, 0x10(%rbx)
movups (%rbx), %xmm1
movups %xmm0, (%rbx)
movaps %xmm1, (%rdi)
movq %rax, 0x10(%rdi)
callq 0xc678
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xc678
movq %rbx, %rdi
callq 0x4600
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/diff.cpp
// Function: get_match_covers_by_sstring(unsigned char const*, unsigned char const*, unsigned char const*, unsigned char const*, hpatch_TOutputCovers*, int, bool, ICoverLinesListener*, unsigned long, bool)
void get_match_covers_by_sstring(const unsigned char* newData,const unsigned char* newData_end,
                                 const unsigned char* oldData,const unsigned char* oldData_end,
                                 hpatch_TOutputCovers* out_covers,int kMinSingleMatchScore,
                                 bool isUseBigCacheMatch,ICoverLinesListener* listener,
                                 size_t threadNum,bool isCanExtendCover){
    std::vector<hpatch_TCover_sz> covers;
    get_match_covers_by_sstring(newData,newData_end,oldData,oldData_end,covers,
                                kMinSingleMatchScore,isUseBigCacheMatch,listener,threadNum,isCanExtendCover);
    const hpatch_TCover_sz* pcovers=covers.data();
    for (size_t i=0;i<covers.size();++i,++pcovers){
        if (sizeof(*pcovers)==sizeof(hpatch_TCover)){
            out_covers->push_cover(out_covers,(const hpatch_TCover*)pcovers);
        }else{
            hpatch_TCover cover; 
            cover.oldPos=pcovers->oldPos;
            cover.newPos=pcovers->newPos;
            cover.length=pcovers->length;
            out_covers->push_cover(out_covers,&cover);
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %rbx
movb 0x60(%rsp), %al
movups 0x68(%rsp), %xmm0
movb 0x78(%rsp), %r10b
xorps %xmm1, %xmm1
leaq 0x20(%rsp), %r8
movaps %xmm1, (%r8)
andq $0x0, 0x10(%r8)
movzbl %r10b, %r10d
movl %r10d, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
movzbl %al, %eax
movl %eax, (%rsp)
callq 0xd67e
movq 0x20(%rsp), %rcx
xorl %r15d, %r15d
pushq $0x18
popq %r12
movq %rcx, %r14
movq 0x28(%rsp), %rax
subq %rcx, %rax
cqto
idivq %r12
cmpq %rax, %r15
jae 0xd7df
movq %rbx, %rdi
movq %r14, %rsi
callq *(%rbx)
incq %r15
addq $0x18, %r14
movq 0x20(%rsp), %rcx
jmp 0xd7b7
leaq 0x20(%rsp), %rdi
callq 0x13ba4
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0xd7f7
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x13ba4
movq %rbx, %rdi
callq 0x4600