// File: sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: getSingleCompressedDiffInfo
hpatch_BOOL getSingleCompressedDiffInfo(hpatch_singleCompressedDiffInfo* out_diffInfo,
                                        const hpatch_TStreamInput* singleCompressedDiff,
                                        hpatch_StreamPos_t         diffInfo_pos){
    TStreamCacheClip  _diffHeadClip;
    TStreamCacheClip* diffHeadClip=&_diffHeadClip;
    TByte             temp_cache[hpatch_kStreamCacheSize];
    _TStreamCacheClip_init(&_diffHeadClip,singleCompressedDiff,diffInfo_pos,singleCompressedDiff->streamSize,
                           temp_cache,hpatch_kStreamCacheSize);
    {//type
        const char* kVersionType="HDIFFSF20";
        char* tempType=out_diffInfo->compressType;
        if (!_TStreamCacheClip_readType_end(diffHeadClip,'&',tempType)) return _hpatch_FALSE;
        if (0!=strcmp(tempType,kVersionType)) return _hpatch_FALSE;
    }
    {//read compressType
        if (!_TStreamCacheClip_readType_end(diffHeadClip,'\0',
                                            out_diffInfo->compressType)) return _hpatch_FALSE;
    }
    _clip_unpackUIntTo(&out_diffInfo->newDataSize,diffHeadClip);
    _clip_unpackUIntTo(&out_diffInfo->oldDataSize,diffHeadClip);
    _clip_unpackUIntTo(&out_diffInfo->coverCount,diffHeadClip);
    _clip_unpackUIntTo(&out_diffInfo->stepMemSize,diffHeadClip);
    _clip_unpackUIntTo(&out_diffInfo->uncompressedSize,diffHeadClip);
    _clip_unpackUIntTo(&out_diffInfo->compressedSize,diffHeadClip);
    out_diffInfo->diffDataPos=_TStreamCacheClip_readPosOfSrcStream(diffHeadClip)-diffInfo_pos;
    if (out_diffInfo->compressedSize>out_diffInfo->uncompressedSize)
        return _hpatch_FALSE;
    if (out_diffInfo->stepMemSize>(out_diffInfo->newDataSize>=_kStepMemSizeSafeLimit?out_diffInfo->newDataSize:_kStepMemSizeSafeLimit))
        return _hpatch_FALSE;
    if (out_diffInfo->stepMemSize>out_diffInfo->uncompressedSize)
        return _hpatch_FALSE;
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1080, %rsp           # imm = 0x1080
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
leaq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
leaq -0x1060(%rbp), %r8
leaq -0x50(%rbp), %rdi
movl $0x1000, %r9d           # imm = 0x1000
callq 0x871e0
leaq 0x25b16(%rip), %rax     # 0xaf962
movq %rax, -0x1068(%rbp)
movq -0x10(%rbp), %rax
addq $0x38, %rax
movq %rax, -0x1070(%rbp)
movq -0x58(%rbp), %rdi
movq -0x1070(%rbp), %rdx
movl $0x26, %esi
callq 0x869b0
cmpl $0x0, %eax
jne 0x89e88
movl $0x0, -0x4(%rbp)
jmp 0x8a060
movq -0x1070(%rbp), %rdi
movq -0x1068(%rbp), %rsi
callq 0x44f0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x89eaf
movl $0x0, -0x4(%rbp)
jmp 0x8a060
movq -0x58(%rbp), %rdi
movq -0x10(%rbp), %rdx
addq $0x38, %rdx
xorl %esi, %esi
callq 0x869b0
cmpl $0x0, %eax
jne 0x89ed3
movl $0x0, -0x4(%rbp)
jmp 0x8a060
movq -0x58(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %edx, %edx
callq 0x86d00
cmpl $0x0, %eax
jne 0x89ef3
movl $0x0, -0x4(%rbp)
jmp 0x8a060
movq -0x58(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
xorl %edx, %edx
callq 0x86d00
cmpl $0x0, %eax
jne 0x89f17
movl $0x0, -0x4(%rbp)
jmp 0x8a060
movq -0x58(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
xorl %edx, %edx
callq 0x86d00
cmpl $0x0, %eax
jne 0x89f3b
movl $0x0, -0x4(%rbp)
jmp 0x8a060
movq -0x58(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x30, %rsi
xorl %edx, %edx
callq 0x86d00
cmpl $0x0, %eax
jne 0x89f5f
movl $0x0, -0x4(%rbp)
jmp 0x8a060
movq -0x58(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
xorl %edx, %edx
callq 0x86d00
cmpl $0x0, %eax
jne 0x89f83
movl $0x0, -0x4(%rbp)
jmp 0x8a060
movq -0x58(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x18, %rsi
xorl %edx, %edx
callq 0x86d00
cmpl $0x0, %eax
jne 0x89fa7
movl $0x0, -0x4(%rbp)
jmp 0x8a060
movq -0x58(%rbp), %rax
movq (%rax), %rcx
movq -0x58(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x58(%rbp), %rdx
subq 0x20(%rdx), %rax
subq %rax, %rcx
subq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jbe 0x89fe8
movl $0x0, -0x4(%rbp)
jmp 0x8a060
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x1078(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x1000000, (%rax)      # imm = 0x1000000
jb 0x8a014
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x1080(%rbp)
jmp 0x8a022
movl $0x1000000, %eax        # imm = 0x1000000
movq %rax, -0x1080(%rbp)
jmp 0x8a022
movq -0x1078(%rbp), %rax
movq -0x1080(%rbp), %rcx
cmpq %rcx, %rax
jbe 0x8a03e
movl $0x0, -0x4(%rbp)
jmp 0x8a060
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jbe 0x8a059
movl $0x0, -0x4(%rbp)
jmp 0x8a060
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x1080, %rsp           # imm = 0x1080
popq %rbp
retq
nopl (%rax)