// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %r14
movq %rsi, %r15
movq %rdi, %r12
movq $0x0, 0x20(%rsp)
xorl %ebx, %ebx
testq %r9, %r9
je 0x45fcb
movq 0x70(%rsp), %rbp
testq %rbp, %rbp
jne 0x45fcd
jmp 0x45fdd
xorl %ebp, %ebp
testq %rbp, %rbp
cmoveq %r14, %r9
addq %rcx, %r9
cmpq 0x8(%rdx), %r9
jbe 0x45fee
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x80(%rsp), %r13
movq 0x78(%rsp), %rax
testq %rbp, %rbp
je 0x46088
movq %rbp, %rdi
movq %r14, %rsi
movq %r9, %r8
callq *0x8(%rbp)
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0x45fdd
movq %r13, %r10
leaq 0x8(%rsp), %r13
movq %rbp, 0x20(%r13)
movq %r13, (%r13)
movq %r14, 0x8(%r13)
leaq 0x86c(%rip), %rax       # 0x468a1
movq %rax, 0x10(%r13)
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
movq %r14, %r8
movq 0x78(%rsp), %r9
pushq 0x98(%rsp)
pushq 0x98(%rsp)
pushq 0x98(%rsp)
pushq %r10
callq 0x4614f
addq $0x20, %rsp
movl %eax, %ebx
movq 0x28(%r13), %rsi
testq %rsi, %rsi
je 0x45fdd
movq 0x28(%rsp), %rdi
callq *0x10(%rdi)
jmp 0x45fdd
movq %r12, %rdi
movq %r15, %rsi
movq %r9, %r8
movq %rax, %r9
pushq 0x98(%rsp)
pushq 0x98(%rsp)
pushq 0x98(%rsp)
pushq %r13
callq 0x4614f
addq $0x58, %rsp
jmp 0x45fe3