LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: patch_stream_with_cache
hpatch_BOOL patch_stream_with_cache(const struct hpatch_TStreamOutput* out_newData,
                                    const struct hpatch_TStreamInput*  oldData,
                                    const struct hpatch_TStreamInput*  serializedDiff,
                                    TByte*   temp_cache,TByte* temp_cache_end){
    hpatch_BOOL     result;
    hpatch_TCovers* covers=0;//not need close before return
    hpatch_BOOL    isReadError=hpatch_FALSE;
    _patch_cache(&covers,&oldData,out_newData->streamSize,serializedDiff,hpatch_FALSE,0,
                _kCachePatCount,&temp_cache,&temp_cache_end,&isReadError);
    if (isReadError) return _hpatch_FALSE;
    result=_patch_stream_with_cache(out_newData,oldData,serializedDiff,covers,
                                    temp_cache,temp_cache_end);
    //if ((covers!=0)&&(!covers->close(covers))) result=_hpatch_FALSE;
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdx, %rbx
movq %rdi, %r14
leaq 0x20(%rsp), %rax
movq %rsi, (%rax)
leaq 0x18(%rsp), %r10
movq %rcx, (%r10)
leaq 0x10(%rsp), %r11
movq %r8, (%r11)
leaq 0x8(%rsp), %rdi
andq $0x0, (%rdi)
leaq 0x2c(%rsp), %r15
andl $0x0, (%r15)
movq 0x8(%r14), %rdx
movq %rax, %rsi
movq %rbx, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %r15
pushq %r11
pushq %r10
pushq $0x8
callq 0x3b99c
addq $0x20, %rsp
cmpl $0x0, (%r15)
je 0x3b974
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x20(%rsp), %rsi
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %r8
movq 0x10(%rsp), %r9
movq %r14, %rdi
movq %rbx, %rdx
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x3c2cb
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: patch_decompress_with_cache
hpatch_BOOL patch_decompress_with_cache(const hpatch_TStreamOutput* out_newData,
                                        const hpatch_TStreamInput*  oldData,
                                        const hpatch_TStreamInput*  compressedDiff,
                                        hpatch_TDecompress* decompressPlugin,
                                        TByte* temp_cache,TByte* temp_cache_end){
    hpatch_BOOL     result;
    hpatch_TCovers* covers=0; //need close before return
    hpatch_BOOL    isReadError=hpatch_FALSE;
    _patch_cache(&covers,&oldData,out_newData->streamSize,compressedDiff,hpatch_TRUE,
                 decompressPlugin,_kCacheDecCount,&temp_cache,&temp_cache_end,&isReadError);
    if (isReadError) return _hpatch_FALSE;
    result=_patch_decompress_cache(out_newData,0,oldData,compressedDiff,decompressPlugin,
                                   covers,temp_cache,temp_cache_end);
    if ((covers!=0)&&(!covers->close(covers))) result=_hpatch_FALSE;
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
leaq 0x20(%rsp), %rax
movq %rsi, (%rax)
leaq 0x18(%rsp), %r10
movq %r8, (%r10)
leaq 0x10(%rsp), %r11
movq %r9, (%r11)
leaq 0x8(%rsp), %rdi
andq $0x0, (%rdi)
leaq 0x2c(%rsp), %r12
andl $0x0, (%r12)
movq 0x8(%r15), %rdx
pushq $0x1
popq %r8
movq %rax, %rsi
movq %r14, %rcx
movq %rbx, %r9
pushq %r12
pushq %r11
pushq %r10
pushq $0x6
callq 0x3b99c
addq $0x20, %rsp
xorl %ebp, %ebp
cmpl $0x0, (%r12)
jne 0x3c653
movq 0x20(%rsp), %rsi
movq 0x8(%rsp), %r12
movq 0x18(%rsp), %r9
subq $0x8, %rsp
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
movq %r12, %r8
pushq 0x18(%rsp)
callq 0x3c662
popq %rcx
popq %rdx
movl %eax, %ebp
testq %r12, %r12
je 0x3c653
movq %r12, %rdi
callq *0x18(%r12)
testl %eax, %eax
cmovel %eax, %ebp
movl %ebp, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: hpatch_coverList_open_serializedDiff
hpatch_BOOL hpatch_coverList_open_serializedDiff(hpatch_TCoverList* out_coverList,
                                                 const hpatch_TStreamInput*  serializedDiff){
    TByte* temp_cache;
    TByte* temp_cache_end;
    _TPackedCovers* packedCovers=0;
    _THDiffHead     diffHead;
    assert((out_coverList!=0)&&(out_coverList->ICovers==0));
    temp_cache=out_coverList->_buf;
    temp_cache_end=temp_cache+sizeof(out_coverList->_buf);
    if (!_packedCovers_open(&packedCovers,&diffHead,serializedDiff,
                            temp_cache,temp_cache_end))
        return _hpatch_FALSE;
    out_coverList->ICovers=&packedCovers->base.ICovers;
    return hpatch_TRUE;
}

// Assembly:
pushq %rbx
subq $0x40, %rsp
andq $0x0, (%rsp)
testq %rdi, %rdi
je 0x3cb24
movq %rdi, %rbx
cmpq $0x0, (%rdi)
jne 0x3cb24
movq %rsi, %rdx
leaq 0x8(%rbx), %rcx
leaq 0x4008(%rbx), %r8
movq %rsp, %rdi
leaq 0x8(%rsp), %rsi
callq 0x3cb43
testl %eax, %eax
je 0x3cb1c
movq (%rsp), %rax
movq %rax, (%rbx)
pushq $0x1
popq %rax
jmp 0x3cb1e
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
retq
leaq 0x19c80(%rip), %rdi     # 0x567ab
leaq 0x198fc(%rip), %rsi     # 0x5642e
leaq 0x19ca2(%rip), %rcx     # 0x567db
movl $0x7ae, %edx            # imm = 0x7AE
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: hpatch_coverList_open_compressedDiff
hpatch_BOOL hpatch_coverList_open_compressedDiff(hpatch_TCoverList* out_coverList,
                                                 const hpatch_TStreamInput*  compressedDiff,
                                                 hpatch_TDecompress*         decompressPlugin){
    TByte* temp_cache;
    TByte* temp_cache_end;
    _TCompressedCovers* compressedCovers=0;
    hpatch_compressedDiffInfo diffInfo;
    assert((out_coverList!=0)&&(out_coverList->ICovers==0));
    temp_cache=out_coverList->_buf;
    temp_cache_end=temp_cache+sizeof(out_coverList->_buf);
    if (!_compressedCovers_open(&compressedCovers,&diffInfo,compressedDiff,decompressPlugin,
                                temp_cache,temp_cache_end))
        return _hpatch_FALSE;
    out_coverList->ICovers=&compressedCovers->base.ICovers;
    return hpatch_TRUE;
}

// Assembly:
pushq %rbx
subq $0x120, %rsp            # imm = 0x120
andq $0x0, (%rsp)
testq %rdi, %rdi
je 0x3ccf4
movq %rdi, %rbx
cmpq $0x0, (%rdi)
jne 0x3ccf4
movq %rdx, %rcx
movq %rsi, %rdx
leaq 0x8(%rbx), %r8
leaq 0x4008(%rbx), %r9
movq %rsp, %rdi
leaq 0x8(%rsp), %rsi
callq 0x3cd13
testl %eax, %eax
je 0x3cce9
movq (%rsp), %rax
movq %rax, (%rbx)
pushq $0x1
popq %rax
jmp 0x3cceb
xorl %eax, %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbx
retq
leaq 0x19ab0(%rip), %rdi     # 0x567ab
leaq 0x1972c(%rip), %rsi     # 0x5642e
leaq 0x19b35(%rip), %rcx     # 0x5683e
movl $0x7bf, %edx            # imm = 0x7BF
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: compressedCovers_open
static hpatch_BOOL _compressedCovers_open(_TCompressedCovers** out_self,
                                          hpatch_compressedDiffInfo* out_diffInfo,
                                          const hpatch_TStreamInput* compressedDiff,
                                          hpatch_TDecompress* decompressPlugin,
                                          TByte* temp_cache,TByte* temp_cache_end){
    _THDiffzHead    head;
    hpatch_StreamPos_t  diffPos0=0;
    _TCompressedCovers* self=0;
    _cache_alloc(self,_TCompressedCovers,sizeof(_TCompressedCovers),temp_cache,temp_cache_end);
    if (!read_diffz_head(out_diffInfo,&head,compressedDiff)) return _hpatch_FALSE;
    diffPos0=head.headEndPos;
    if (head.compress_cover_buf_size>0){
        if (decompressPlugin==0) return _hpatch_FALSE;
        if (!decompressPlugin->is_can_open(out_diffInfo->compressType)) return _hpatch_FALSE;
    }
    
    _covers_init(&self->base,head.coverCount,&self->coverClip,
                 &self->coverClip,&self->coverClip,hpatch_TRUE);
    self->base.ICovers.close=_compressedCovers_close;
    memset(&self->decompresser,0, sizeof(self->decompresser));
    if (!getStreamClip(&self->coverClip,&self->decompresser,
                       head.cover_buf_size,head.compress_cover_buf_size,
                       compressedDiff,&diffPos0,decompressPlugin,
                       temp_cache,temp_cache_end-temp_cache)) {
        return _hpatch_FALSE;
    };
    *out_self=self;
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r9, %rax
subq %r8, %rax
xorl %ebx, %ebx
cmpq $0xc0, %rax
jb 0x3ce45
movq %r9, %r13
movq %r8, %r14
movq %rcx, %r12
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, (%rsp)
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0x3b682
testl %eax, %eax
je 0x3ce45
movq 0x20(%rsp), %rcx
movq 0x68(%rsp), %rax
movq %rax, 0x8(%rsp)
testq %rcx, %rcx
je 0x3cd93
testq %r12, %r12
je 0x3ce45
addq $0x14, %r15
movq %r15, %rdi
movq %rcx, %r15
callq *(%r12)
movq %r15, %rcx
testl %eax, %eax
je 0x3ce45
addq $0x7, %r14
andq $-0x8, %r14
leaq 0xb8(%r14), %rax
movq 0x10(%rsp), %rsi
leaq 0x58(%r14), %rdi
leaq 0x13db(%rip), %rdx      # 0x3e18d
movq %rdx, (%r14)
leaq 0x13d6(%rip), %rdx      # 0x3e192
movq %rdx, 0x8(%r14)
leaq 0x14af(%rip), %rdx      # 0x3e276
movq %rdx, 0x10(%r14)
movq %rsi, 0x20(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%r14)
movq %rdi, 0x38(%r14)
movq %rdi, 0x40(%r14)
movq %rdi, 0x48(%r14)
movl $0x1, 0x50(%r14)
leaq 0x14d2(%rip), %rdx      # 0x3e2c4
movq %rdx, 0x18(%r14)
leaq 0x88(%r14), %rsi
movups %xmm0, 0x88(%r14)
movups %xmm0, 0x98(%r14)
movups %xmm0, 0xa8(%r14)
movq 0x18(%rsp), %rdx
subq %rax, %r13
subq $0x8, %rsp
leaq 0x10(%rsp), %r9
movq %rbp, %r8
pushq %r13
pushq %rax
pushq %r12
callq 0x3b0f6
addq $0x20, %rsp
testl %eax, %eax
je 0x3ce45
movq (%rsp), %rax
movq %r14, (%rax)
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x78, %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/HPatch/patch.c
// Function: compressed_stream_as_uncompressed
hpatch_BOOL compressed_stream_as_uncompressed(hpatch_TUncompresser_t* uncompressedStream,hpatch_StreamPos_t uncompressedSize,
                                              hpatch_TDecompress* decompressPlugin,const hpatch_TStreamInput* compressedStream,
                                              hpatch_StreamPos_t compressed_pos,hpatch_StreamPos_t compressed_end){
    hpatch_TUncompresser_t* self=uncompressedStream;
    assert(decompressPlugin!=0);
    assert(self->_decompressHandle==0);
    self->_decompressHandle=decompressPlugin->open(decompressPlugin,uncompressedSize,compressedStream,
                                                   compressed_pos,compressed_end);
    if (self->_decompressHandle==0) return _hpatch_FALSE;
    self->_decompressPlugin=decompressPlugin;
    
    self->base.streamImport=self;
    self->base.streamSize=uncompressedSize;
    self->base.read=_TUncompresser_read;
    return hpatch_TRUE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdx, %rdx
je 0x3cf8d
movq %rdi, %rbx
cmpq $0x0, 0x28(%rdi)
jne 0x3cfac
movq %rdx, %r15
movq %rsi, %r14
movq %rdx, %rdi
movq %rcx, %rdx
movq %r8, %rcx
movq %r9, %r8
callq *0x8(%r15)
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x3cf85
movq %r15, 0x20(%rbx)
movq %rbx, (%rbx)
movq %r14, 0x8(%rbx)
leaq 0x6a9(%rip), %rax       # 0x3d625
movq %rax, 0x10(%rbx)
pushq $0x1
popq %rax
jmp 0x3cf87
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x15fc2(%rip), %rdi     # 0x52f56
leaq 0x19493(%rip), %rsi     # 0x5642e
leaq 0x19915(%rip), %rcx     # 0x568b7
movl $0x81d, %edx            # imm = 0x81D
callq 0x4230
leaq 0x199bb(%rip), %rdi     # 0x5696e
leaq 0x19474(%rip), %rsi     # 0x5642e
leaq 0x198f6(%rip), %rcx     # 0x568b7
movl $0x81e, %edx            # imm = 0x81E
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: close_compressed_stream_as_uncompressed
void close_compressed_stream_as_uncompressed(hpatch_TUncompresser_t* uncompressedStream){
    hpatch_TUncompresser_t* self=uncompressedStream;
    if (self==0) return;
    if (self->_decompressHandle==0) return;
    self->_decompressPlugin->close(self->_decompressPlugin,self->_decompressHandle);
    self->_decompressHandle=0;
}

// Assembly:
testq %rdi, %rdi
je 0x3d4d5
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rsi
testq %rsi, %rsi
je 0x3d4d4
movq 0x20(%rbx), %rdi
callq *0x10(%rdi)
andq $0x0, 0x28(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: sspatch_covers_nextCover
hpatch_BOOL sspatch_covers_nextCover(sspatch_covers_t* self){
    hpatch_BOOL inc_oldPos_sign=(*(self->covers_cache))>>(8-1);
    self->lastOldEnd=self->cover.oldPos+self->cover.length;
    self->lastNewEnd=self->cover.newPos+self->cover.length;
    if (!hpatch_unpackUIntWithTag(&self->covers_cache,self->covers_cacheEnd,&self->cover.oldPos,1)) return _hpatch_FALSE;
    if (inc_oldPos_sign==0)
        self->cover.oldPos+=self->lastOldEnd;
    else
        self->cover.oldPos=self->lastOldEnd-self->cover.oldPos;
    if (!hpatch_unpackUInt(&self->covers_cache,self->covers_cacheEnd,&self->cover.newPos)) return _hpatch_FALSE;
    self->cover.newPos+=self->lastNewEnd;
    if (!hpatch_unpackUInt(&self->covers_cache,self->covers_cacheEnd,&self->cover.length)) return _hpatch_FALSE;
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x8(%rdi), %rsi
movb (%rax), %bpl
leaq 0x20(%rdi), %rdx
movdqu 0x20(%rdi), %xmm0
movq 0x30(%rdi), %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
paddq %xmm0, %xmm1
movdqu %xmm1, 0x10(%rdi)
pushq $0x1
popq %rcx
callq 0x3a5a8
testl %eax, %eax
je 0x3d6c3
leaq 0x28(%rbx), %rdx
movq 0x20(%rbx), %rax
movq %rax, %rcx
negq %rcx
testb %bpl, %bpl
cmovnsq %rax, %rcx
movq 0x8(%rbx), %rsi
addq 0x10(%rbx), %rcx
movq %rcx, 0x20(%rbx)
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x3a5a8
testl %eax, %eax
je 0x3d6c3
leaq 0x30(%rbx), %rdx
movq 0x8(%rbx), %rsi
movq 0x18(%rbx), %rax
addq %rax, 0x28(%rbx)
movq %rbx, %rdi
xorl %ecx, %ecx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x3a5a8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: TDiffToSingleStream_init
void TDiffToSingleStream_init(TDiffToSingleStream* self,const hpatch_TStreamInput* diffStream){
    self->base.streamImport=self;
    self->base.streamSize=diffStream->streamSize;
    self->base.read=_TDiffToSingleStream_read;
    self->base._private_reserved=0;
    self->diffStream=diffStream;
    self->readedSize=0;
    self->cachedBufBegin=_TDiffToSingleStream_kBufSize;
    self->isInSingleStream=hpatch_FALSE;
}

// Assembly:
movq %rdi, (%rdi)
movq 0x8(%rsi), %rax
movq %rax, 0x8(%rdi)
leaq 0x1f(%rip), %rax        # 0x3d6fd
movq %rax, 0x10(%rdi)
andq $0x0, 0x18(%rdi)
movq %rsi, 0x20(%rdi)
andq $0x0, 0x28(%rdi)
movq $0x1000, 0x30(%rdi)     # imm = 0x1000
andl $0x0, 0x38(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: arrayCovers_read_cover
static hpatch_BOOL _arrayCovers_read_cover(struct hpatch_TCovers* covers,hpatch_TCover* out_cover){
    _TArrayCovers* self=(_TArrayCovers*)covers;
    hpatch_size_t i=self->cur_index;
    if (i<self->coverCount){
        if (self->is32){
            const hpatch_TCCover32* pCover=((const hpatch_TCCover32*)self->pCCovers)+i;
            out_cover->oldPos=pCover->oldPos;
            out_cover->newPos=pCover->newPos;
            out_cover->length=pCover->length;
        }else{
            const hpatch_TCCover64* pCover=((const hpatch_TCCover64*)self->pCCovers)+i;
            out_cover->oldPos=pCover->oldPos;
            out_cover->newPos=pCover->newPos;
            out_cover->length=pCover->length;
        }
        self->cur_index=i+1;
        return hpatch_TRUE;
    }else{
        return _hpatch_FALSE;
    }
}

// Assembly:
movq 0x30(%rdi), %rcx
xorl %eax, %eax
cmpq 0x28(%rdi), %rcx
jae 0x3da68
cmpl $0x0, 0x38(%rdi)
movq 0x20(%rdi), %rax
movq %rcx, %rdx
je 0x3da4a
shlq $0x4, %rdx
movsd (%rax,%rdx), %xmm0
xorps %xmm1, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movl 0x8(%rax,%rdx), %eax
jmp 0x3da57
shlq $0x5, %rdx
movups (%rax,%rdx), %xmm0
movq 0x10(%rax,%rdx), %rax
movups %xmm0, (%rsi)
movq %rax, 0x10(%rsi)
incq %rcx
movq %rcx, 0x30(%rdi)
pushq $0x1
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: cache_old_StreamInput_read
static hpatch_BOOL _cache_old_StreamInput_read(const hpatch_TStreamInput* stream,
                                               hpatch_StreamPos_t readFromPos,
                                               unsigned char* out_data,unsigned char* out_data_end){
    _cache_old_TStreamInput* self=(_cache_old_TStreamInput*)stream->streamImport;
    hpatch_StreamPos_t dataLen=(hpatch_size_t)(self->readFromPosEnd-self->readFromPos);
    hpatch_size_t readLen;
    if (dataLen==0){//next cover
        hpatch_StreamPos_t oldPos;
        hpatch_size_t i=self->arrayCovers.cur_index++;
        if (i>=self->arrayCovers.coverCount) return _hpatch_FALSE;//error;
        oldPos=_arrayCovers_get_oldPos(&self->arrayCovers,i);
        dataLen=_arrayCovers_get_len(&self->arrayCovers,i);
        self->isInHitCache=(dataLen<=self->maxCachedLen);
        self->readFromPos=oldPos;
        self->readFromPosEnd=oldPos+dataLen;
    }
    readLen=out_data_end-out_data;
    if ((readLen>dataLen)||(self->readFromPos!=readFromPos)) return _hpatch_FALSE; //error
    self->readFromPos=readFromPos+readLen;
    if (self->isInHitCache){
        assert(readLen<=(hpatch_size_t)(self->cachesEnd-self->caches));
        memcpy(out_data,self->caches,readLen);
        self->caches+=readLen;
        return hpatch_TRUE;
    }else{
        return self->oldData->read(self->oldData,readFromPos,out_data,out_data_end);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %r14
movq 0x50(%r14), %rdi
movq 0x58(%r14), %r8
subq %rdi, %r8
jne 0x3dad5
movq 0x30(%r14), %r8
leaq 0x1(%r8), %rax
movq %rax, 0x30(%r14)
xorl %eax, %eax
cmpq 0x28(%r14), %r8
jae 0x3db18
cmpl $0x0, 0x38(%r14)
movq 0x20(%r14), %rax
je 0x3daaf
shlq $0x4, %r8
movl (%rax,%r8), %edi
movl 0x8(%rax,%r8), %r8d
jmp 0x3dabc
shlq $0x5, %r8
movq (%rax,%r8), %rdi
movq 0x10(%rax,%r8), %r8
xorl %eax, %eax
cmpq 0x48(%r14), %r8
setbe %al
movl %eax, 0x40(%r14)
movq %rdi, 0x50(%r14)
leaq (%r8,%rdi), %rax
movq %rax, 0x58(%r14)
movq %rcx, %rbx
subq %rdx, %rbx
xorl %eax, %eax
cmpq %r8, %rbx
ja 0x3db18
cmpq %rsi, %rdi
jne 0x3db18
leaq (%rbx,%rsi), %rax
movq %rax, 0x50(%r14)
cmpl $0x0, 0x40(%r14)
je 0x3db20
movq 0x60(%r14), %rsi
movq 0x68(%r14), %rax
subq %rsi, %rax
cmpq %rax, %rbx
ja 0x3db31
movq %rdx, %rdi
movq %rbx, %rdx
callq 0x42c0
addq %rbx, 0x60(%r14)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x70(%r14), %rdi
movq 0x10(%rdi), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
leaq 0x193c6(%rip), %rdi     # 0x56efe
leaq 0x188ef(%rip), %rsi     # 0x5642e
leaq 0x193ef(%rip), %rcx     # 0x56f35
movl $0x6cc, %edx            # imm = 0x6CC
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: rle_decode_skip
static hpatch_BOOL _rle_decode_skip(struct _TBytesRle_load_stream* rle_loader,hpatch_StreamPos_t copyLength){
    while (copyLength>0) {
        hpatch_size_t len=(~(hpatch_size_t)0);
        if (len>copyLength)
            len=(hpatch_size_t)copyLength;
        if (!_TBytesRle_load_stream_decode_skip(rle_loader,len)) return _hpatch_FALSE;
        copyLength-=len;
    }
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rdx
movq %rdi, %rbx
pushq $0x1
popq %rbp
testq %rdx, %rdx
je 0x3df8a
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3df95
movl $0x0, %edx
testl %eax, %eax
jne 0x3df6d
jmp 0x3df8d
movl %ebp, %r14d
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: TBytesRle_load_stream_mem_add
static hpatch_BOOL _TBytesRle_load_stream_mem_add(_TBytesRle_load_stream* loader,
                                                  hpatch_size_t* _decodeSize,TByte** _out_data){
    hpatch_size_t  decodeSize=*_decodeSize;
    TByte* out_data=*_out_data;
    TStreamCacheClip* rleCodeClip=&loader->rleCodeClip;
    
    hpatch_StreamPos_t memSetLength=loader->memSetLength;
    if (memSetLength!=0){
        hpatch_size_t memSetStep=((memSetLength<=decodeSize)?(hpatch_size_t)memSetLength:decodeSize);
        const TByte byteSetValue=loader->memSetValue;
        if (out_data!=0){
            if (byteSetValue!=0)
                memSet_add(out_data,byteSetValue,memSetStep);
            out_data+=memSetStep;
        }
        decodeSize-=memSetStep;
        loader->memSetLength=memSetLength-memSetStep;
    }
    while ((loader->memCopyLength>0)&&(decodeSize>0)) {
        TByte* rleData;
        hpatch_size_t decodeStep=rleCodeClip->cacheEnd;
        if (decodeStep>loader->memCopyLength)
            decodeStep=(hpatch_size_t)loader->memCopyLength;
        if (decodeStep>decodeSize)
            decodeStep=decodeSize;
        rleData=_TStreamCacheClip_readData(rleCodeClip,decodeStep);
        if (rleData==0) return _hpatch_FALSE;
        if (out_data){
            addData(out_data,rleData,decodeStep);
            out_data+=decodeStep;
        }
        decodeSize-=decodeStep;
        loader->memCopyLength-=decodeStep;
    }
    *_decodeSize=decodeSize;
    *_out_data=out_data;
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %rbx
movq %rdx, (%rsp)
movq (%rdx), %r12
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x3e10e
cmpq %rbx, %rax
movq %rbx, %rcx
cmovbq %rax, %rcx
testq %r12, %r12
je 0x3e101
movb 0x10(%r15), %dl
testb %dl, %dl
je 0x3e0fc
xorl %esi, %esi
cmpq %rsi, %rcx
je 0x3e0fc
addb %dl, (%r12,%rsi)
incq %rsi
jmp 0x3e0ee
addq %rcx, %r12
jmp 0x3e104
xorl %r12d, %r12d
subq %rcx, %rbx
subq %rcx, %rax
movq %rax, 0x8(%r15)
leaq 0x48(%r15), %r13
movq (%r15), %rbp
testq %rbp, %rbp
je 0x3e16d
testq %rbx, %rbx
je 0x3e16d
movq 0x70(%r15), %rax
cmpq %rbp, %rax
cmovbq %rax, %rbp
cmpq %rbx, %rbp
cmovaeq %rbx, %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x3b0db
testq %rax, %rax
je 0x3e17c
testq %r12, %r12
je 0x3e159
movq %r12, %rdi
movq %rax, %rsi
movq %rbp, %rdx
callq 0x3ac1f
addq %rbp, %r12
jmp 0x3e15c
xorl %r12d, %r12d
subq %rbp, %rbx
movq (%r15), %rax
subq %rbp, %rax
movq %rax, (%r15)
movq %rax, %rbp
jmp 0x3e115
movq %rbx, (%r14)
movq (%rsp), %rax
movq %r12, (%rax)
pushq $0x1
popq %rax
jmp 0x3e17e
xorl %eax, %eax
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/HPatch/patch.c
// Function: covers_read_cover
static  hpatch_BOOL _covers_read_cover(hpatch_TCovers* covers,hpatch_TCover* out_cover){
    _TCovers* self=(_TCovers*)covers;
    hpatch_StreamPos_t oldPosBack=self->oldPosBack;
    hpatch_StreamPos_t newPosBack=self->newPosBack;
    hpatch_StreamPos_t coverCount=self->coverCount;
    if (coverCount>0)
        self->coverCount=coverCount-1;
    else
        return _hpatch_FALSE;
    
    {
        hpatch_StreamPos_t copyLength,coverLength, oldPos,inc_oldPos;
        TByte inc_oldPos_sign;
        const TByte* pSign=_TStreamCacheClip_accessData(self->code_inc_oldPosClip,1);
        if (pSign)
            inc_oldPos_sign=(*pSign)>>(8-kSignTagBit);
        else
            return _hpatch_FALSE;
        _clip_unpackUIntWithTagTo(&inc_oldPos,self->code_inc_oldPosClip,kSignTagBit);
        oldPos=(inc_oldPos_sign==0)?(oldPosBack+inc_oldPos):(oldPosBack-inc_oldPos);
        _clip_unpackUIntTo(&copyLength,self->code_inc_newPosClip);
        _clip_unpackUIntTo(&coverLength,self->code_lengthsClip);
        newPosBack+=copyLength;
        oldPosBack=oldPos;
        oldPosBack+=(self->isOldPosBackNeedAddLength)?coverLength:0;
        
        out_cover->oldPos=oldPos;
        out_cover->newPos=newPosBack;
        out_cover->length=coverLength;
        newPosBack+=coverLength;
    }
    self->oldPosBack=oldPosBack;
    self->newPosBack=newPosBack;
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x20(%rdi), %rax
xorl %ebp, %ebp
testq %rax, %rax
je 0x3e265
movq %rsi, %r14
movq %rdi, %rbx
movq 0x28(%rdi), %rcx
movq %rcx, 0x8(%rsp)
movq 0x30(%rdi), %r12
decq %rax
movq %rax, 0x20(%rdi)
movq 0x38(%rdi), %rdi
pushq $0x1
popq %rsi
callq 0x3ae6c
testq %rax, %rax
je 0x3e265
movb (%rax), %r13b
movq 0x38(%rbx), %rdi
leaq 0x10(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x3af7d
testl %eax, %eax
je 0x3e265
movq 0x10(%rsp), %rax
movq %rax, %r15
negq %r15
testb %r13b, %r13b
cmovnsq %rax, %r15
movq 0x40(%rbx), %rdi
leaq 0x20(%rsp), %rsi
xorl %edx, %edx
callq 0x3af7d
testl %eax, %eax
je 0x3e265
movq 0x48(%rbx), %rdi
leaq 0x18(%rsp), %rsi
xorl %edx, %edx
callq 0x3af7d
testl %eax, %eax
je 0x3e265
addq 0x20(%rsp), %r12
addq 0x8(%rsp), %r15
xorl %eax, %eax
cmpl $0x0, 0x50(%rbx)
movq 0x18(%rsp), %rcx
cmovneq %rcx, %rax
addq %r15, %rax
movq %r15, (%r14)
movq %r12, 0x8(%r14)
movq %rcx, 0x10(%r14)
addq %rcx, %r12
movq %rax, 0x28(%rbx)
movq %r12, 0x30(%rbx)
pushq $0x1
popq %rbp
movl %ebp, %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/HPatch/patch.c
// Function: covers_is_finish
static  hpatch_BOOL _covers_is_finish(const struct hpatch_TCovers* covers){
    _TCovers* self=(_TCovers*)covers;
    return _TStreamCacheClip_isFinish(self->code_lengthsClip)
        && _TStreamCacheClip_isFinish(self->code_inc_newPosClip)
        && _TStreamCacheClip_isFinish(self->code_inc_oldPosClip);
}

// Assembly:
movq 0x48(%rdi), %rax
movq 0x8(%rax), %rcx
movq 0x20(%rax), %rdx
subq (%rax), %rcx
subq 0x28(%rax), %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
jne 0x3e2c3
movq 0x40(%rdi), %rcx
movq 0x8(%rcx), %rdx
subq (%rcx), %rdx
movq 0x20(%rcx), %rsi
subq 0x28(%rcx), %rsi
cmpq %rsi, %rdx
jne 0x3e2c3
movq 0x38(%rdi), %rax
movq 0x8(%rax), %rcx
movq 0x20(%rax), %rdx
subq (%rax), %rcx
subq 0x28(%rax), %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
sete %al
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: compressedCovers_close
static hpatch_BOOL _compressedCovers_close(hpatch_TCovers* covers){
    hpatch_BOOL result=hpatch_TRUE;
    _TCompressedCovers* self=(_TCompressedCovers*)covers;
    if (self){
        if (self->decompresser.decompressHandle){
            result=self->decompresser.decompressPlugin->close(self->decompresser.decompressPlugin,
                                                              self->decompresser.decompressHandle);
            self->decompresser.decompressHandle=0;
        }
    }
    return result;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x3e2ed
movq %rdi, %rbx
movq 0xb0(%rdi), %rsi
testq %rsi, %rsi
je 0x3e2ed
movq 0xa8(%rbx), %rdi
callq *0x10(%rdi)
andq $0x0, 0xb0(%rbx)
jmp 0x3e2f0
pushq $0x1
popq %rax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: hpatch_getTempPathName
hpatch_BOOL hpatch_getTempPathName(const char* path_utf8,char* out_tempPath_utf8,char* out_tempPath_end){
    //use tmpnam()?
#define _AddingLen 8
    size_t i;
    size_t len=strlen(path_utf8);
    if ((len>0)&&(path_utf8[len-1]==kPatch_dirSeparator)) --len; //without '/'
    if (len+(4+_AddingLen)>(size_t)(out_tempPath_end-out_tempPath_utf8)) { _set_errno_new(ENAMETOOLONG); return hpatch_FALSE; }
    memcpy(out_tempPath_utf8,path_utf8,len);
    out_tempPath_utf8+=len;
    for (i=1; i<1000; ++i) {
        hpatch_TPathType tmpPathType;
        char adding[_AddingLen]={'0','0','0','.','t','m','p','\0'};
        adding[2]+=i%10;    adding[1]+=(i/10)%10;   adding[0]+=(i/100)%10;
        memcpy(out_tempPath_utf8,adding,sizeof(adding));
        if (!_hpatch_getPathStat_noEndDirSeparator(out_tempPath_utf8,&tmpPathType,0,0)) return hpatch_FALSE;
        if (tmpPathType==kPathType_notExist)
            return hpatch_TRUE; //ok
    }
    return hpatch_FALSE;
#undef _AddingLen
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4150
testq %rax, %rax
je 0x3e4ef
movq %rax, %r15
xorl %eax, %eax
cmpb $0x2f, -0x1(%r14,%r15)
sete %al
subq %rax, %r15
jmp 0x3e4f2
xorl %r15d, %r15d
leaq 0xc(%r15), %rax
subq %rbx, %r12
cmpq %r12, %rax
jbe 0x3e51a
callq 0x4050
movl $0x24, (%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x42c0
leaq (%rbx,%r15), %r14
leaq (%rbx,%r15), %r12
addq $0x3, %r12
movw $0x1, %bp
movw $0xa, %r13w
leaq 0x4(%rsp), %r15
xorl %ebx, %ebx
movl %ebp, %eax
xorl %edx, %edx
divw %r13w
cmpq $0x3e7, %rbx            # imm = 0x3E7
je 0x3e509
imull $0xa, %eax, %eax
movb $0x30, %cl
subb %al, %cl
movzbl %cl, %esi
incq %rsi
addl %ebx, %esi
leal 0x1(%rbx), %ecx
movl %ecx, %eax
xorl %edx, %edx
divw %r13w
movzbl %al, %eax
movb $0xa, %dl
divb %dl
movzbl %ah, %edi
orb $0x30, %dil
movl %ecx, %eax
xorl %edx, %edx
movw $0x64, %cx
divw %cx
orb $0x30, %al
movb %al, (%r14)
movb %dil, 0x1(%r14)
movb %sil, 0x2(%r14)
movb $0x0, 0x4(%r12)
movl $0x706d742e, (%r12)     # imm = 0x706D742E
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3e320
testl %eax, %eax
je 0x3e509
incq %rbx
incl %ebp
cmpl $0x0, 0x4(%rsp)
jne 0x3e544
pushq $0x1
popq %rax
jmp 0x3e50b
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: hpatch_renamePath
hpatch_BOOL hpatch_renamePath(const char* oldPath_utf8,const char* newPath_utf8){
    _path_noEndDirSeparator(oldPath,oldPath_utf8); {
        _path_noEndDirSeparator(newPath,newPath_utf8); {
#if (_IS_USED_WIN32_UTF8_WAPI)
            int     wsize;
            wchar_t oldPath_w[hpatch_kPathMaxSize];
            wchar_t newPath_w[hpatch_kPathMaxSize];
            wsize=_utf8FileName_to_w(oldPath,oldPath_w,hpatch_kPathMaxSize);
            if (wsize<=0) return hpatch_FALSE;
            wsize=_utf8FileName_to_w(newPath,newPath_w,hpatch_kPathMaxSize);
            if (wsize<=0) return hpatch_FALSE;
            return 0==_wrename(oldPath_w,newPath_w);
#else
            return 0==rename(oldPath,newPath);
#endif
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x2000, %rsp           # imm = 0x2000
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4150
cmpq $0xfff, %rax            # imm = 0xFFF
ja 0x3e647
movq %rax, %r15
testq %rax, %rax
je 0x3e609
xorl %eax, %eax
cmpb $0x2f, -0x1(%r14,%r15)
sete %al
subq %rax, %r15
jmp 0x3e60c
xorl %r15d, %r15d
movq %rsp, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x42c0
movb $0x0, (%rsp,%r15)
movq %rbx, %rdi
callq 0x4150
cmpq $0xfff, %rax            # imm = 0xFFF
ja 0x3e647
movq %rax, %r14
testq %rax, %rax
je 0x3e656
xorl %eax, %eax
cmpb $0x2f, -0x1(%rbx,%r14)
sete %al
subq %rax, %r14
jmp 0x3e659
callq 0x4050
movl $0x24, (%rax)
xorl %eax, %eax
jmp 0x3e68c
xorl %r14d, %r14d
leaq 0x1000(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x42c0
movb $0x0, 0x1000(%rsp,%r14)
movq %rsp, %rdi
movq %r15, %rsi
callq 0x4220
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
sete %al
addq $0x2000, %rsp           # imm = 0x2000
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: hpatch_removeFile
hpatch_BOOL hpatch_removeFile(const char* fileName_utf8){
    _path_noEndDirSeparator(fileName,fileName_utf8);{
#if (_IS_USED_WIN32_UTF8_WAPI)
        int     wsize;
        wchar_t path_w[hpatch_kPathMaxSize];
        wsize=_utf8FileName_to_w(fileName,path_w,hpatch_kPathMaxSize);
        if (wsize<=0) return hpatch_FALSE;
        return 0==_wremove(path_w);
#else
        return 0==remove(fileName);
#endif
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rdi, %rbx
callq 0x4150
cmpq $0xfff, %rax            # imm = 0xFFF
ja 0x3e6cd
movq %rax, %r14
testq %rax, %rax
je 0x3e6dc
xorl %eax, %eax
cmpb $0x2f, -0x1(%rbx,%r14)
sete %al
subq %rax, %r14
jmp 0x3e6df
callq 0x4050
movl $0x24, (%rax)
xorl %eax, %eax
jmp 0x3e706
xorl %r14d, %r14d
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x42c0
movb $0x0, (%rsp,%r14)
movq %r15, %rdi
callq 0x4620
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
sete %al
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: hpatch_removeDir
hpatch_BOOL hpatch_removeDir(const char* dirName_utf8){
    _path_noEndDirSeparator(dirName,dirName_utf8);{
#if (_IS_USED_WIN32_UTF8_WAPI)
        int     wsize;
        wchar_t path_w[hpatch_kPathMaxSize];
        wsize=_utf8FileName_to_w(dirName,path_w,hpatch_kPathMaxSize);
        if (wsize<=0) return hpatch_FALSE;
        return 0==_wrmdir(path_w);
#else
#   ifdef _MSC_VER
        return 0==_rmdir(dirName);
#   else
        return 0==rmdir(dirName);
#   endif
#endif
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rdi, %rbx
callq 0x4150
cmpq $0xfff, %rax            # imm = 0xFFF
ja 0x3e747
movq %rax, %r14
testq %rax, %rax
je 0x3e756
xorl %eax, %eax
cmpb $0x2f, -0x1(%rbx,%r14)
sete %al
subq %rax, %r14
jmp 0x3e759
callq 0x4050
movl $0x24, (%rax)
xorl %eax, %eax
jmp 0x3e780
xorl %r14d, %r14d
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x42c0
movb $0x0, (%rsp,%r14)
movq %r15, %rdi
callq 0x4140
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
sete %al
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: hpatch_makeNewDir
hpatch_BOOL hpatch_makeNewDir(const char* dirName_utf8){
    hpatch_TPathType type;
    _path_noEndDirSeparator(path,dirName_utf8);
    if (!_hpatch_getPathStat_noEndDirSeparator(path,&type,0,0)) return hpatch_FALSE; //error
    switch (type) {
        case kPathType_dir :{ return hpatch_TRUE; } break; //exist
        case kPathType_file:{ _set_errno_new(EPERM); return hpatch_FALSE; } break; //error, not overwite
        case kPathType_notExist:{
#if (_IS_USED_WIN32_UTF8_WAPI)
            int     wsize;
            wchar_t path_w[hpatch_kPathMaxSize];
            wsize=_utf8FileName_to_w(path,path_w,hpatch_kPathMaxSize);
            if (wsize<=0) return hpatch_FALSE;
            return 0==_wmkdir(path_w);
#else
#   ifdef _MSC_VER
            return 0==_mkdir(path);
#   else
#       if defined(__MINGW32__) && defined(_WIN32)
            return 0==mkdir(path);
#       else
            const mode_t kDefalutMode=S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH;//0755
            return 0==mkdir(path,kDefalutMode);
#       endif
#   endif
#endif
        } break;
    }
    return hpatch_FALSE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1018, %rsp           # imm = 0x1018
movq %rdi, %r14
callq 0x4150
cmpq $0xfff, %rax            # imm = 0xFFF
ja 0x3e7ca
movq %rax, %r15
xorl %ebx, %ebx
testq %rax, %rax
je 0x3e7d9
xorl %eax, %eax
cmpb $0x2f, -0x1(%r14,%r15)
sete %al
subq %rax, %r15
jmp 0x3e7dc
callq 0x4050
movl $0x24, (%rax)
xorl %ebx, %ebx
jmp 0x3e844
xorl %r15d, %r15d
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x42c0
movb $0x0, 0x10(%rsp,%r15)
leaq 0xc(%rsp), %rsi
movq %r12, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3e320
testl %eax, %eax
je 0x3e844
movl 0xc(%rsp), %eax
testl %eax, %eax
je 0x3e82e
cmpl $0x2, %eax
je 0x3e829
cmpl $0x1, %eax
jne 0x3e844
callq 0x4050
movl $0x1, (%rax)
jmp 0x3e844
pushq $0x1
popq %rbx
jmp 0x3e844
leaq 0x10(%rsp), %rdi
movl $0x1ed, %esi            # imm = 0x1ED
callq 0x4190
xorl %ebx, %ebx
testl %eax, %eax
sete %bl
movl %ebx, %eax
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: hpatch_setIsExecuteFile
hpatch_BOOL hpatch_setIsExecuteFile(const char* fileName){
#ifdef _WIN32
    return hpatch_TRUE; // now, not need execute info
#else
    hpatch_TPathType type;
    size_t           st_mode=0;
    if (!_hpatch_getPathStat_noEndDirSeparator(fileName,&type,0,&st_mode)) return hpatch_FALSE;
    return 0==chmod(fileName,(mode_t)st_mode|S_IXUSR|S_IXGRP|S_IXOTH);
#endif
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rcx
andq $0x0, (%rcx)
xorl %r14d, %r14d
leaq 0x14(%rsp), %rsi
xorl %edx, %edx
callq 0x3e320
testl %eax, %eax
je 0x3e8d5
movl 0x8(%rsp), %esi
orl $0x49, %esi
movq %rbx, %rdi
callq 0x4300
xorl %r14d, %r14d
testl %eax, %eax
sete %r14b
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: import_fileRead
hpatch_BOOL _import_fileRead(hpatch_FileHandle file,TByte* buf,TByte* buf_end){
    while (buf<buf_end) {
        size_t readLen=(size_t)(buf_end-buf);
        if (readLen>hpatch_kFileIOBestMaxSize) readLen=hpatch_kFileIOBestMaxSize;
        if (readLen!=fread(buf,1,readLen,file)) return hpatch_FALSE;
        buf+=readLen;
    }
    return buf==buf_end;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x100000, %ebp         # imm = 0x100000
pushq $0x1
popq %r12
cmpq %rbx, %r14
jae 0x3e92c
movq %rbx, %r13
subq %r14, %r13
cmpq %rbp, %r13
cmovaeq %rbp, %r13
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0x44d0
addq %r13, %r14
cmpq %rax, %r13
je 0x3e8fd
xorl %eax, %eax
jmp 0x3e932
sete %al
movzbl %al, %eax
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/file_for_patch.c
// Function: import_fileWrite
hpatch_BOOL _import_fileWrite(hpatch_FileHandle file,const TByte* data,const TByte* data_end){
    while (data<data_end) {
        size_t writeLen=(size_t)(data_end-data);
        if (writeLen>hpatch_kFileIOBestMaxSize) writeLen=hpatch_kFileIOBestMaxSize;
        if (writeLen!=fwrite(data,1,writeLen,file)) return hpatch_FALSE;
        data+=writeLen;
    }
    return data==data_end;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x100000, %ebp         # imm = 0x100000
pushq $0x1
popq %r12
cmpq %rbx, %r14
jae 0x3e98d
movq %rbx, %r13
subq %r14, %r13
cmpq %rbp, %r13
cmovaeq %rbp, %r13
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0x4680
addq %r13, %r14
cmpq %rax, %r13
je 0x3e95e
xorl %eax, %eax
jmp 0x3e993
sete %al
movzbl %al, %eax
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/file_for_patch.c
// Function: import_fileTruncate
hpatch_BOOL _import_fileTruncate(hpatch_FileHandle file,hpatch_StreamPos_t new_file_length){
#ifdef _MSC_VER
    int fno=_fileno(file);
    if (fno==-1) return hpatch_FALSE;
    if (_chsize_s(fno,new_file_length)!=0) return hpatch_FALSE;
#else
    int fno=fileno(file);
    if (fno==-1) return hpatch_FALSE;
    if (ftruncate(fno,new_file_length)!=0) return hpatch_FALSE;
#endif
    return hpatch_TRUE;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
callq 0x4370
cmpl $-0x1, %eax
je 0x3e9c5
movl %eax, %edi
movq %rbx, %rsi
callq 0x41a0
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
sete %al
jmp 0x3e9c7
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: hpatch_TFileStreamInput_open
hpatch_BOOL hpatch_TFileStreamInput_open(hpatch_TFileStreamInput* self,const char* fileName_utf8){
    assert(self->m_file==0);
    self->fileError=hpatch_FALSE;
    if (self->m_file) _ferr_returnv(EINVAL);
    if (!_import_fileOpenRead(fileName_utf8,&self->m_file,&self->base.streamSize))
        _ferr_return();
    
    self->base.streamImport=self;
    self->base.read=_TFileStreamInput_read_file;
    self->m_fpos=0;
    self->m_offset=0;
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpq $0x0, 0x20(%rdi)
jne 0x3ea6f
movq %rdi, %rbx
andl $0x0, 0x38(%rdi)
leaq 0x8(%rdi), %rdx
leaq 0x18b12(%rip), %rax     # 0x574fc
movq %rsi, %rdi
movq %rax, %rsi
callq 0x3f2ea
testq %rax, %rax
je 0x3ea19
movq %rax, 0x20(%rbx)
movq %rbx, (%rbx)
leaq 0x86(%rip), %rax        # 0x3ea8e
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
pushq $0x1
popq %r14
jmp 0x3ea34
callq 0x4050
movl (%rax), %ebp
movl 0x38(%rbx), %eax
cmpl %ebp, %eax
sete %cl
testl %ebp, %ebp
sete %dl
xorl %r14d, %r14d
orb %cl, %dl
je 0x3ea3c
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
testl %eax, %eax
jne 0x3ea43
movl %ebp, 0x38(%rbx)
movq 0x3657e(%rip), %rax     # 0x74fc8
movq (%rax), %rbx
movl %ebp, %edi
callq 0x40e0
leaq 0xf89b(%rip), %rsi      # 0x4e2f6
xorl %r14d, %r14d
movq %rbx, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x4480
jmp 0x3ea34
leaq 0x188cc(%rip), %rdi     # 0x57342
leaq 0x1882d(%rip), %rsi     # 0x572aa
leaq 0x188ce(%rip), %rcx     # 0x57352
movl $0x24b, %edx            # imm = 0x24B
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: TFileStreamInput_read_file
static hpatch_BOOL _TFileStreamInput_read_file(const hpatch_TStreamInput* stream,hpatch_StreamPos_t readFromPos,
                                                   TByte* out_data,TByte* out_data_end){
        size_t readLen;
        hpatch_TFileStreamInput* self=(hpatch_TFileStreamInput*)stream->streamImport;
        assert(out_data<=out_data_end);
        readLen=(size_t)(out_data_end-out_data);
        if (readLen==0) return hpatch_TRUE;
        if ((readLen>self->base.streamSize)
            ||(readFromPos>self->base.streamSize-readLen)) _ferr_returnv(EFBIG);
        if (self->m_fpos!=readFromPos+self->m_offset){
            if (!_import_fileSeek64To(self->m_file,readFromPos+self->m_offset)) _rw_ferr_return();
        }
        if (!_import_fileRead(self->m_file,out_data,out_data+readLen)) _rw_ferr_return();
        self->m_fpos=readFromPos+self->m_offset+readLen;
        return hpatch_TRUE;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpq %rcx, %rdx
ja 0x3eb9e
movq %rcx, %r14
movq %rdx, %r12
pushq $0x1
popq %rbx
subq %rdx, %r14
je 0x3eb5a
movq %rsi, %r15
movq (%rdi), %r13
movq 0x8(%r13), %rax
subq %r14, %rax
setb %cl
notb %cl
cmpq %rsi, %rax
setae %al
testb %al, %cl
jne 0x3eaff
callq 0x4050
movl $0x1b, (%rax)
movl 0x38(%r13), %eax
cmpl $0x1b, %eax
je 0x3eb58
testl %eax, %eax
jne 0x3eaf0
movl $0x1b, 0x38(%r13)
movq 0x364d1(%rip), %rax     # 0x74fc8
movq (%rax), %r14
pushq $0x1b
popq %rbp
jmp 0x3eb7d
movq 0x30(%r13), %rsi
addq %r15, %rsi
cmpq %rsi, 0x28(%r13)
je 0x3eb19
movq 0x20(%r13), %rdi
callq 0x3f364
testl %eax, %eax
je 0x3eb3a
movq 0x20(%r13), %rdi
leaq (%r12,%r14), %rdx
movq %r12, %rsi
callq 0x3e8e0
testl %eax, %eax
je 0x3eb3a
addq %r15, %r14
addq 0x30(%r13), %r14
movq %r14, 0x28(%r13)
jmp 0x3eb5a
orq $-0x1, 0x28(%r13)
callq 0x4050
movl (%rax), %ebp
movl 0x38(%r13), %eax
cmpl %ebp, %eax
sete %cl
testl %ebp, %ebp
sete %dl
orb %cl, %dl
je 0x3eb6b
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %eax, %eax
jne 0x3eb73
movl %ebp, 0x38(%r13)
movq 0x3644e(%rip), %rax     # 0x74fc8
movq (%rax), %r14
movl %ebp, %edi
callq 0x40e0
leaq 0xf76b(%rip), %rsi      # 0x4e2f6
xorl %ebx, %ebx
movq %r14, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x4480
jmp 0x3eb5a
leaq 0x1895a(%rip), %rdi     # 0x574ff
leaq 0x186fe(%rip), %rsi     # 0x572aa
leaq 0x18963(%rip), %rcx     # 0x57516
movl $0x23d, %edx            # imm = 0x23D
callq 0x4230
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: hpatch_TFileStreamInput_setOffset
hpatch_BOOL hpatch_TFileStreamInput_setOffset(hpatch_TFileStreamInput* self,hpatch_StreamPos_t offset){
    if (self->base.streamSize<offset)
        _ferr_returnv(EFBIG);
    self->m_offset+=offset;
    self->base.streamSize-=offset;
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
subq %rsi, %rax
jae 0x3ec1e
callq 0x4050
movl $0x1b, (%rax)
movl 0x38(%rbx), %eax
xorl %ebp, %ebp
cmpl $0x1b, %eax
je 0x3ec29
testl %eax, %eax
jne 0x3ebed
movl $0x1b, 0x38(%rbx)
movq 0x363d4(%rip), %rax     # 0x74fc8
movq (%rax), %rbx
pushq $0x1b
popq %r14
movl %r14d, %edi
callq 0x40e0
leaq 0xf6ec(%rip), %rsi      # 0x4e2f6
xorl %ebp, %ebp
movq %rbx, %rdi
movl %r14d, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x4480
jmp 0x3ec29
addq %rsi, 0x30(%rbx)
movq %rax, 0x8(%rbx)
pushq $0x1
popq %rbp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: import_fileClose
hpatch_inline static
hpatch_BOOL _import_fileClose(hpatch_FileHandle* pfile){
    hpatch_FileHandle file=*pfile;
    if (file){
        *pfile=0;
        if (0!=fclose(file))
            return hpatch_FALSE;
    }
    return hpatch_TRUE;
}

// Assembly:
movq %rdi, %rax
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x3ecc1
pushq %rax
andq $0x0, (%rax)
callq 0x4320
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
leaq 0x8(%rsp), %rsp
je 0x3ecc1
retq
pushq $0x1
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: hpatch_TFileStreamOutput_open
hpatch_BOOL hpatch_TFileStreamOutput_open(hpatch_TFileStreamOutput* self,const char* fileName_utf8,
                                          hpatch_StreamPos_t max_file_length){
    assert(self->m_file==0);
    self->fileError=hpatch_FALSE;
    if (self->m_file) _ferr_returnv(EINVAL);
    if (!_import_fileOpenCreateOrReWrite(fileName_utf8,&self->m_file))
        _ferr_return();
    
    self->base.streamImport=self;
    self->base.streamSize=max_file_length;
    self->base.read_writed=_hpatch_TFileStreamOutput_read_file;
    self->base.write=_TFileStreamOutput_write_file;
    self->m_fpos=0;
    self->m_offset=0;
    self->is_in_readModel=hpatch_FALSE;
    self->is_random_out=hpatch_FALSE;
    self->out_length=0;
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpq $0x0, 0x20(%rdi)
jne 0x3ed83
movq %rdx, %r14
movq %rdi, %rbx
andl $0x0, 0x38(%rdi)
leaq 0x1889c(%rip), %rax     # 0x57581
movq %rsi, %rdi
movq %rax, %rsi
callq 0x4380
testq %rax, %rax
je 0x3ed2d
movq %rax, 0x20(%rbx)
movq %rbx, (%rbx)
movq %r14, 0x8(%rbx)
leaq 0x9b(%rip), %rax        # 0x3eda2
movq %rax, 0x10(%rbx)
leaq 0x145(%rip), %rax       # 0x3ee57
movq %rax, 0x18(%rbx)
andq $0x0, 0x3c(%rbx)
andq $0x0, 0x48(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
pushq $0x1
popq %r14
jmp 0x3ed48
callq 0x4050
movl (%rax), %ebp
movl 0x38(%rbx), %eax
cmpl %ebp, %eax
sete %cl
testl %ebp, %ebp
sete %dl
xorl %r14d, %r14d
orb %cl, %dl
je 0x3ed50
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
testl %eax, %eax
jne 0x3ed57
movl %ebp, 0x38(%rbx)
movq 0x3626a(%rip), %rax     # 0x74fc8
movq (%rax), %rbx
movl %ebp, %edi
callq 0x40e0
leaq 0xf587(%rip), %rsi      # 0x4e2f6
xorl %r14d, %r14d
movq %rbx, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x4480
jmp 0x3ed48
leaq 0x185b8(%rip), %rdi     # 0x57342
leaq 0x18519(%rip), %rsi     # 0x572aa
leaq 0x1860c(%rip), %rcx     # 0x573a4
movl $0x291, %edx            # imm = 0x291
callq 0x4230