// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: patch_single_stream
hpatch_BOOL patch_single_stream(sspatch_listener_t* listener,
                                const hpatch_TStreamOutput* __out_newData,
                                const hpatch_TStreamInput*  oldData,
                                const hpatch_TStreamInput*  singleCompressedDiff, 
                                hpatch_StreamPos_t  diffInfo_pos,
                                sspatch_coversListener_t* coversListener){
    hpatch_BOOL result=hpatch_TRUE;
    hpatch_TDecompress*     decompressPlugin=0;
    unsigned char*          temp_cache=0;
    unsigned char*          temp_cacheEnd=0;
    hpatch_singleCompressedDiffInfo diffInfo;
    hpatch_TStreamOutput    _out_newData=*__out_newData;
    hpatch_TStreamOutput*   out_newData=&_out_newData;
    TDiffToSingleStream     _toSStream;
    assert((listener)&&(listener->onDiffInfo));
    TDiffToSingleStream_init(&_toSStream,singleCompressedDiff);
    singleCompressedDiff=&_toSStream.base;

    if (!getSingleCompressedDiffInfo(&diffInfo,singleCompressedDiff,diffInfo_pos))
        return _hpatch_FALSE;
    if (diffInfo.newDataSize>out_newData->streamSize)
        return _hpatch_FALSE;
    out_newData->streamSize=diffInfo.newDataSize;
    if (diffInfo.oldDataSize!=oldData->streamSize)
        return _hpatch_FALSE;
    if (!listener->onDiffInfo(listener,&diffInfo,&decompressPlugin,&temp_cache,&temp_cacheEnd))
        return _hpatch_FALSE;

    if ((temp_cache==0)||(temp_cache>=temp_cacheEnd))
        result=_hpatch_FALSE;
    if (result){
        result=patch_single_compressed_diff(out_newData,oldData,singleCompressedDiff,diffInfo.diffDataPos,
                                            diffInfo.uncompressedSize,diffInfo.compressedSize,decompressPlugin,
                                            diffInfo.coverCount,(size_t)diffInfo.stepMemSize,
                                            temp_cache,temp_cacheEnd,coversListener);
    }
    if (listener->onPatchFinish)
        listener->onPatchFinish(listener,temp_cache,temp_cacheEnd);
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x11f8, %rsp           # imm = 0x11F8
andq $0x0, 0x48(%rsp)
andq $0x0, 0x40(%rsp)
andq $0x0, 0x38(%rsp)
movups (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
movaps %xmm1, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
testq %rdi, %rdi
je 0x3d9e2
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
je 0x3d9e2
movq %r9, %r15
movq %rdx, %r14
leaq 0x1b8(%rsp), %rsi
movq %rsi, (%rsi)
movq 0x8(%rcx), %rax
movq %rax, 0x8(%rsi)
leaq -0x1c9(%rip), %rax      # 0x3d6fd
movq %rax, 0x10(%rsi)
andq $0x0, 0x18(%rsi)
movq %rcx, 0x20(%rsi)
andq $0x0, 0x28(%rsi)
movq $0x1000, 0x30(%rsi)     # imm = 0x1000
andl $0x0, 0x38(%rsi)
leaq 0x78(%rsp), %rdi
movq %r8, %rdx
callq 0x3d4d6
xorl %ebp, %ebp
testl %eax, %eax
je 0x3d9d2
movq 0x78(%rsp), %rax
cmpq 0x58(%rsp), %rax
ja 0x3d9d2
movq %rax, 0x58(%rsp)
movq 0x80(%rsp), %rax
cmpq 0x8(%r14), %rax
jne 0x3d9d2
leaq 0x78(%rsp), %rsi
leaq 0x48(%rsp), %rdx
leaq 0x40(%rsp), %rcx
leaq 0x38(%rsp), %r8
movq %rbx, %rdi
callq *0x8(%rbx)
testl %eax, %eax
je 0x3d9d2
movq 0x40(%rsp), %rax
testq %rax, %rax
setne %cl
movq 0x38(%rsp), %rdx
cmpq %rdx, %rax
setb %sil
andb %cl, %sil
xorl %ebp, %ebp
cmpb $0x1, %sil
jne 0x3d9ba
movq 0x98(%rsp), %rcx
movq 0x88(%rsp), %r8
movq 0x90(%rsp), %r9
movq 0x48(%rsp), %rsi
movups 0xa0(%rsp), %xmm0
movq %r15, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rax, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
movq %rsi, (%rsp)
leaq 0x50(%rsp), %rdi
leaq 0x1b8(%rsp), %rdx
movq %r14, %rsi
callq 0x3ce56
movl %eax, %ebp
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x3d9d2
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %rbx, %rdi
callq *%rax
movl %ebp, %eax
addq $0x11f8, %rsp           # imm = 0x11F8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x190f5(%rip), %rdi     # 0x56ade
leaq 0x18a3e(%rip), %rsi     # 0x5642e
leaq 0x1910a(%rip), %rcx     # 0x56b01
movl $0x937, %edx            # imm = 0x937
callq 0x4230