// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: patch_single_compressed_diff
hpatch_BOOL patch_single_compressed_diff(const hpatch_TStreamOutput* out_newData,
                                         const hpatch_TStreamInput*  oldData,
                                         const hpatch_TStreamInput*  singleCompressedDiff,
                                         hpatch_StreamPos_t          diffData_pos,
                                         hpatch_StreamPos_t          uncompressedSize,
                                         hpatch_StreamPos_t          compressedSize,
                                         hpatch_TDecompress*         decompressPlugin,
                                         hpatch_StreamPos_t coverCount,hpatch_size_t stepMemSize,
                                         unsigned char* temp_cache,unsigned char* temp_cache_end,
                                         sspatch_coversListener_t* coversListener){
    hpatch_BOOL result;
    hpatch_TUncompresser_t uncompressedStream;
    hpatch_StreamPos_t diffData_posEnd;
    memset(&uncompressedStream,0,sizeof(uncompressedStream));
    if (compressedSize==0){
        decompressPlugin=0;
    }else{
        if (decompressPlugin==0) return _hpatch_FALSE;
    }
    diffData_posEnd=(decompressPlugin?compressedSize:uncompressedSize)+diffData_pos;
    if (diffData_posEnd>singleCompressedDiff->streamSize) return _hpatch_FALSE;
    if (decompressPlugin){
        if (!compressed_stream_as_uncompressed(&uncompressedStream,uncompressedSize,decompressPlugin,singleCompressedDiff,
                                               diffData_pos,diffData_posEnd)) return _hpatch_FALSE;
        singleCompressedDiff=&uncompressedStream.base;
        diffData_pos=0;
        diffData_posEnd=singleCompressedDiff->streamSize;
    }
    result=patch_single_stream_diff(out_newData,oldData,singleCompressedDiff,diffData_pos,diffData_posEnd,
                                    coverCount,stepMemSize,temp_cache,temp_cache_end,coversListener);
    if (decompressPlugin)
        close_compressed_stream_as_uncompressed(&uncompressedStream);
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rcx, %rax
movq %rdx, %rcx
movq %rsi, %r15
movq %rdi, %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
xorl %ebx, %ebx
testq %r9, %r9
je 0x3ce96
movq 0x60(%rsp), %r14
testq %r14, %r14
jne 0x3ce99
jmp 0x3cf27
xorl %r14d, %r14d
testq %r14, %r14
cmoveq %r8, %r9
addq %rax, %r9
cmpq 0x8(%rcx), %r9
ja 0x3cf27
testq %r14, %r14
je 0x3cecf
movq %rsp, %r13
movq %r13, %rdi
movq %r8, %rsi
movq %r14, %rdx
movq %rax, %r8
callq 0x3cf37
testl %eax, %eax
je 0x3cf27
movq 0x8(%rsp), %r9
xorl %eax, %eax
jmp 0x3ced2
movq %rcx, %r13
movq 0x68(%rsp), %r10
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rax, %rcx
movq %r9, %r8
movq %r10, %r9
pushq 0x88(%rsp)
pushq 0x88(%rsp)
pushq 0x88(%rsp)
pushq 0x88(%rsp)
callq 0x3cfcb
addq $0x20, %rsp
movl %eax, %ebx
testq %r14, %r14
je 0x3cf27
movq 0x28(%rsp), %rsi
testq %rsi, %rsi
je 0x3cf27
movq 0x20(%rsp), %rdi
callq *0x10(%rdi)
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq