// File: 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
movq %rsp, %rbp
pushq %rbx
subq $0xa8, %rsp
movq 0x38(%rbp), %rax
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq %rcx, -0x30(%rbp)
movq %r8, -0x38(%rbp)
movq %r9, -0x40(%rbp)
leaq -0x78(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x4210
cmpq $0x0, -0x40(%rbp)
jne 0x8971d
movq $0x0, 0x10(%rbp)
jmp 0x89732
cmpq $0x0, 0x10(%rbp)
jne 0x89730
movl $0x0, -0xc(%rbp)
jmp 0x89821
jmp 0x89732
cmpq $0x0, 0x10(%rbp)
je 0x89746
movq -0x40(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x89751
movq -0x38(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jbe 0x8977a
movl $0x0, -0xc(%rbp)
jmp 0x89821
cmpq $0x0, 0x10(%rbp)
je 0x897c8
movq -0x38(%rbp), %rsi
movq 0x10(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movq -0x80(%rbp), %r9
leaq -0x78(%rbp), %rdi
callq 0x89830
cmpl $0x0, %eax
jne 0x897ac
movl $0x0, -0xc(%rbp)
jmp 0x89821
leaq -0x78(%rbp), %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x80(%rbp), %r8
movq 0x18(%rbp), %r9
movq 0x20(%rbp), %rbx
movq 0x28(%rbp), %r11
movq 0x30(%rbp), %r10
movq 0x38(%rbp), %rax
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x89930
movl %eax, -0x44(%rbp)
cmpq $0x0, 0x10(%rbp)
je 0x8981b
leaq -0x78(%rbp), %rdi
callq 0x89da0
movl -0x44(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
addq $0xa8, %rsp
popq %rbx
popq %rbp
retq
nop