// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: read_diffz_head
hpatch_BOOL read_diffz_head(hpatch_compressedDiffInfo* out_diffInfo,_THDiffzHead* out_head,
                            const hpatch_TStreamInput* compressedDiff){
    TStreamCacheClip  _diffHeadClip;
    TStreamCacheClip* diffHeadClip=&_diffHeadClip;
    TByte             temp_cache[hpatch_kStreamCacheSize];
    _TStreamCacheClip_init(&_diffHeadClip,compressedDiff,0,compressedDiff->streamSize,
                           temp_cache,hpatch_kStreamCacheSize);
    {//type
        const char* kVersionType="HDIFF13";
        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;
        out_head->typesEndPos=_TStreamCacheClip_readPosOfSrcStream(diffHeadClip);
    }
    _clip_unpackUIntTo(&out_diffInfo->newDataSize,diffHeadClip);
    _clip_unpackUIntTo(&out_diffInfo->oldDataSize,diffHeadClip);
    _clip_unpackUIntTo(&out_head->coverCount,diffHeadClip);
    out_head->compressSizeBeginPos=_TStreamCacheClip_readPosOfSrcStream(diffHeadClip);
    _clip_unpackUIntTo(&out_head->cover_buf_size,diffHeadClip);
    _clip_unpackUIntTo(&out_head->compress_cover_buf_size,diffHeadClip);
    _clip_unpackUIntTo(&out_head->rle_ctrlBuf_size,diffHeadClip);
    _clip_unpackUIntTo(&out_head->compress_rle_ctrlBuf_size,diffHeadClip);
    _clip_unpackUIntTo(&out_head->rle_codeBuf_size,diffHeadClip);
    _clip_unpackUIntTo(&out_head->compress_rle_codeBuf_size,diffHeadClip);
    _clip_unpackUIntTo(&out_head->newDataDiff_size,diffHeadClip);
    _clip_unpackUIntTo(&out_head->compress_newDataDiff_size,diffHeadClip);
    out_head->headEndPos=_TStreamCacheClip_readPosOfSrcStream(diffHeadClip);
    
    out_diffInfo->compressedCount=((out_head->compress_cover_buf_size)?1:0)
                                 +((out_head->compress_rle_ctrlBuf_size)?1:0)
                                 +((out_head->compress_rle_codeBuf_size)?1:0)
                                 +((out_head->compress_newDataDiff_size)?1:0);
    if (out_head->compress_cover_buf_size>0)
        out_head->coverEndPos=out_head->headEndPos+out_head->compress_cover_buf_size;
    else
        out_head->coverEndPos=out_head->headEndPos+out_head->cover_buf_size;
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1038, %rsp           # imm = 0x1038
movq %rsi, %rbx
movq 0x8(%rdx), %rax
testq %rdx, %rdx
sete %cl
testq %rax, %rax
setne %sil
andb %cl, %sil
cmpb $0x1, %sil
je 0x45016
movq %rdi, %r14
movq %rsp, %rdi
movq $0x0, (%rdi)
movq %rax, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
leaq 0x30(%rsp), %rax
movq %rax, 0x18(%rdi)
movl $0x1000, %eax           # imm = 0x1000
movq %rax, 0x20(%rdi)
movq %rax, 0x28(%rdi)
leaq 0x14(%r14), %r15
movl $0x26, %esi
movq %r15, %rdx
callq 0x44506
xorl %ebp, %ebp
testl %eax, %eax
je 0x44e83
leaq 0x174be(%rip), %rsi     # 0x5c335
movq %r15, %rdi
callq 0x4420
testl %eax, %eax
je 0x44e93
movl %ebp, %eax
addq $0x1038, %rsp           # imm = 0x1038
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rsp, %rdi
xorl %ebp, %ebp
xorl %esi, %esi
movq %r15, %rdx
callq 0x44506
testl %eax, %eax
je 0x44e83
movq %rsp, %rdi
movq (%rdi), %rax
subq 0x28(%rdi), %rax
addq 0x20(%rdi), %rax
movq %rax, 0x48(%rbx)
xorl %ebp, %ebp
movq %r14, %rsi
xorl %edx, %edx
callq 0x44699
testl %eax, %eax
je 0x44e83
leaq 0x8(%r14), %rsi
movq %rsp, %rdi
xorl %ebp, %ebp
xorl %edx, %edx
callq 0x44699
testl %eax, %eax
je 0x44e83
movq %rsp, %rdi
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %edx, %edx
callq 0x44699
testl %eax, %eax
je 0x44e83
movq %rsp, %rdi
movq (%rdi), %rax
subq 0x28(%rdi), %rax
addq 0x20(%rdi), %rax
movq %rax, 0x50(%rbx)
leaq 0x8(%rbx), %r15
xorl %ebp, %ebp
movq %r15, %rsi
xorl %edx, %edx
callq 0x44699
testl %eax, %eax
je 0x44e83
leaq 0x10(%rbx), %rsi
movq %rsp, %rdi
xorl %ebp, %ebp
xorl %edx, %edx
callq 0x44699
testl %eax, %eax
je 0x44e83
leaq 0x18(%rbx), %rsi
movq %rsp, %rdi
xorl %ebp, %ebp
xorl %edx, %edx
callq 0x44699
testl %eax, %eax
je 0x44e83
leaq 0x20(%rbx), %rsi
movq %rsp, %rdi
xorl %ebp, %ebp
xorl %edx, %edx
callq 0x44699
testl %eax, %eax
je 0x44e83
leaq 0x28(%rbx), %rsi
movq %rsp, %rdi
xorl %ebp, %ebp
xorl %edx, %edx
callq 0x44699
testl %eax, %eax
je 0x44e83
leaq 0x30(%rbx), %rsi
movq %rsp, %rdi
xorl %ebp, %ebp
xorl %edx, %edx
callq 0x44699
testl %eax, %eax
je 0x44e83
leaq 0x38(%rbx), %rsi
movq %rsp, %rdi
xorl %ebp, %ebp
xorl %edx, %edx
callq 0x44699
testl %eax, %eax
je 0x44e83
leaq 0x40(%rbx), %rsi
movq %rsp, %rdi
xorl %ebp, %ebp
xorl %edx, %edx
callq 0x44699
testl %eax, %eax
je 0x44e83
movq 0x20(%rsp), %rax
subq 0x28(%rsp), %rax
addq (%rsp), %rax
movq 0x10(%rbx), %rcx
xorl %edx, %edx
testq %rcx, %rcx
setne %dl
cmpq $0x1, 0x20(%rbx)
sbbl $-0x1, %edx
cmpq $0x1, 0x30(%rbx)
sbbl $-0x1, %edx
cmpq $0x1, 0x40(%rbx)
sbbl $-0x1, %edx
movq %rax, 0x58(%rbx)
movl %edx, 0x10(%r14)
testq %rcx, %rcx
je 0x45005
addq %rcx, %rax
jmp 0x45008
addq (%r15), %rax
movq %rax, 0x60(%rbx)
movl $0x1, %ebp
jmp 0x44e83
leaq 0x1ca82(%rip), %rdi     # 0x61a9f
leaq 0x1cacc(%rip), %rsi     # 0x61af0
leaq 0x1caf5(%rip), %rcx     # 0x61b20
movl $0x55, %edx
callq 0x4200