// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: read_diff_head
static hpatch_BOOL read_diff_head(_THDiffHead* out_diffHead,
                                  const hpatch_TStreamInput* serializedDiff){
    hpatch_StreamPos_t       diffPos0;
    const hpatch_StreamPos_t diffPos_end=serializedDiff->streamSize;
    TByte       temp_cache[hpatch_kStreamCacheSize];
    TStreamCacheClip  diffHeadClip;
    _TStreamCacheClip_init(&diffHeadClip,serializedDiff,0,diffPos_end,temp_cache,hpatch_kStreamCacheSize);
    _clip_unpackUIntTo(&out_diffHead->coverCount,&diffHeadClip);
    _clip_unpackUIntTo(&out_diffHead->lengthSize,&diffHeadClip);
    _clip_unpackUIntTo(&out_diffHead->inc_newPosSize,&diffHeadClip);
    _clip_unpackUIntTo(&out_diffHead->inc_oldPosSize,&diffHeadClip);
    _clip_unpackUIntTo(&out_diffHead->newDataDiffSize,&diffHeadClip);
    diffPos0=(hpatch_StreamPos_t)(_TStreamCacheClip_readPosOfSrcStream(&diffHeadClip));
    out_diffHead->headEndPos=diffPos0;
#ifdef __RUN_MEM_SAFE_CHECK
    if (out_diffHead->lengthSize>(hpatch_StreamPos_t)(diffPos_end-diffPos0)) return _hpatch_FALSE;
#endif
    diffPos0+=out_diffHead->lengthSize;
#ifdef __RUN_MEM_SAFE_CHECK
    if (out_diffHead->inc_newPosSize>(hpatch_StreamPos_t)(diffPos_end-diffPos0)) return _hpatch_FALSE;
#endif
    diffPos0+=out_diffHead->inc_newPosSize;
#ifdef __RUN_MEM_SAFE_CHECK
    if (out_diffHead->inc_oldPosSize>(hpatch_StreamPos_t)(diffPos_end-diffPos0)) return _hpatch_FALSE;
#endif
    diffPos0+=out_diffHead->inc_oldPosSize;
    out_diffHead->coverEndPos=diffPos0;
#ifdef __RUN_MEM_SAFE_CHECK
    if (out_diffHead->newDataDiffSize>(hpatch_StreamPos_t)(diffPos_end-diffPos0)) return _hpatch_FALSE;
#endif
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1030, %rsp           # imm = 0x1030
movq 0x8(%rsi), %r12
testq %rsi, %rsi
sete %al
testq %r12, %r12
setne %cl
andb %al, %cl
cmpb $0x1, %cl
je 0x47b9b
movq %rdi, %rbx
movq %rsp, %rdi
movq $0x0, (%rdi)
movq %r12, 0x8(%rdi)
movq %rsi, 0x10(%rdi)
leaq 0x30(%rsp), %rax
movq %rax, 0x18(%rdi)
movl $0x1000, %eax           # imm = 0x1000
movq %rax, 0x20(%rdi)
movq %rax, 0x28(%rdi)
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %edx, %edx
callq 0x44699
testl %eax, %eax
je 0x47b89
leaq 0x8(%rbx), %rsi
movq %rsp, %rdi
xorl %ebp, %ebp
xorl %edx, %edx
callq 0x44699
testl %eax, %eax
je 0x47b89
leaq 0x10(%rbx), %r14
movq %rsp, %rdi
xorl %ebp, %ebp
movq %r14, %rsi
xorl %edx, %edx
callq 0x44699
testl %eax, %eax
je 0x47b89
leaq 0x18(%rbx), %r15
movq %rsp, %rdi
xorl %ebp, %ebp
movq %r15, %rsi
xorl %edx, %edx
callq 0x44699
testl %eax, %eax
je 0x47b89
leaq 0x20(%rbx), %rsi
movq %rsp, %rdi
xorl %ebp, %ebp
xorl %edx, %edx
callq 0x44699
testl %eax, %eax
je 0x47b89
movq 0x20(%rsp), %rax
subq 0x28(%rsp), %rax
addq (%rsp), %rax
movq %rax, 0x28(%rbx)
movq 0x8(%rbx), %rcx
movq %r12, %rdx
subq %rax, %rdx
cmpq %rdx, %rcx
ja 0x47b89
addq %rcx, %rax
movq (%r14), %rcx
movq %r12, %rdx
subq %rax, %rdx
cmpq %rdx, %rcx
ja 0x47b89
addq %rax, %rcx
movq (%r15), %rax
movq %r12, %rdx
subq %rcx, %rdx
cmpq %rdx, %rax
ja 0x47b89
addq %rcx, %rax
movq %rax, 0x30(%rbx)
subq %rax, %r12
xorl %ebp, %ebp
cmpq %r12, 0x20(%rbx)
setbe %bpl
movl %ebp, %eax
addq $0x1030, %rsp           # imm = 0x1030
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x19efd(%rip), %rdi     # 0x61a9f
leaq 0x19f47(%rip), %rsi     # 0x61af0
leaq 0x19f70(%rip), %rcx     # 0x61b20
movl $0x55, %edx
callq 0x4200