// File: /workspace/github_cpp_makefile_star2_O1/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 %r8, %r14
movq %rsi, %r12
movq %rdi, %r13
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
xorl %r15d, %r15d
testq %r9, %r9
je 0x46a56
movq 0x60(%rsp), %rbx
testq %rbx, %rbx
jne 0x46a58
jmp 0x46b09
xorl %ebx, %ebx
testq %rbx, %rbx
cmoveq %r14, %r9
addq %rcx, %r9
cmpq 0x8(%rdx), %r9
ja 0x46b09
testq %rbx, %rbx
je 0x46ab0
cmpq $0x0, 0x28(%rsp)
jne 0x46b1a
movq %rbx, %rdi
movq %r14, %rsi
movq %r9, %r8
callq *0x8(%rbx)
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x46b09
movq %rsp, %rdx
movq %rbx, 0x20(%rdx)
movq %rdx, (%rdx)
movq %r14, 0x8(%rdx)
leaq 0x98d(%rip), %rax       # 0x47435
movq %rax, 0x10(%rdx)
xorl %ecx, %ecx
jmp 0x46ab3
movq %r9, %r14
movq 0x68(%rsp), %r9
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %r8
pushq 0x88(%rsp)
pushq 0x88(%rsp)
pushq 0x88(%rsp)
pushq 0x88(%rsp)
callq 0x46bcf
addq $0x20, %rsp
movl %eax, %r15d
testq %rbx, %rbx
je 0x46b09
movq 0x28(%rsp), %rsi
testq %rsi, %rsi
je 0x46b09
movq 0x20(%rsp), %rdi
callq *0x10(%rdi)
movq $0x0, 0x28(%rsp)
movl %r15d, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x1ad2d(%rip), %rdi     # 0x6184e
leaq 0x1a7e6(%rip), %rsi     # 0x6130e
leaq 0x1ac68(%rip), %rcx     # 0x61797
movl $0x81e, %edx            # imm = 0x81E
callq 0x4200