// File: /workspace/github_cpp_makefile_star2_O3/sisong[P]ApkDiffPatch/src/diff/Differ.cpp
// Function: checkZipDiffWithStream(hpatch_TStreamInput const*, hpatch_TStreamInput const*, hpatch_TStreamInput const*, int)
TCheckZipDiffResult checkZipDiffWithStream(const hpatch_TStreamInput* oldZipStream,
                                           const hpatch_TStreamInput* newZipStream,
                                           const hpatch_TStreamInput* diffStream,int threadNum){
    assert((size_t)newZipStream->streamSize==newZipStream->streamSize);
    std::vector<TByte>      temp_newZip;
    TVectorStreamOutput     temp_outNewZipStream(temp_newZip);
    if (PATCH_SUCCESS!=ZipPatchWithStream(oldZipStream,diffStream,&temp_outNewZipStream,0,0,threadNum))
        return CHECK_ZIPPATCH_ERROR;
    //else
        
    
    hpatch_TStreamInput     temp_inNewZipStream;
    mem_as_hStreamInput(&temp_inNewZipStream,temp_newZip.data(),temp_newZip.data()+temp_newZip.size());
    bool isByteByByteEqual=getIsEqual(newZipStream,&temp_inNewZipStream);
    if (isByteByByteEqual)
        return CHECK_BYTE_BY_BYTE_EQUAL_TRUE;
    
    bool isOldHaveApkV2Sign=false;
    bool isSame=getZipIsSameWithStream(newZipStream,&temp_inNewZipStream,0,&isOldHaveApkV2Sign);
    if (!isSame)
        return CHECK_SAME_LIKE_ERROR;
    if (isOldHaveApkV2Sign)
        return CHECK_SAME_LIKE_TRUE__BYTE_BY_BYTE_EQUAL_ERROR;
    else
        return CHECK_SAME_LIKE_TRUE__BYTE_BY_BYTE_EQUAL_FALSE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %ecx, %r9d
movq %rsi, %rbx
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rcx
movaps %xmm0, (%rcx)
movq $0x0, 0x10(%rcx)
leaq 0x60(%rsp), %rax
movq %rcx, 0x20(%rax)
movq %rax, (%rax)
movq $-0x1, 0x8(%rax)
leaq 0x5b4(%rip), %rcx       # 0xc04a
movq %rcx, 0x18(%rax)
movq %rdx, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x53cf4
movl $0x4, %ebp
testl %eax, %eax
jne 0xbba2
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
leaq 0x40(%rsp), %rdi
callq 0x433a9
movq 0x8(%rbx), %r14
testq %r14, %r14
js 0xbbcd
cmpq 0x48(%rsp), %r14
jne 0xbb7a
testq %r14, %r14
je 0xbb60
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq (%r14,%r14), %r13
movq %r13, %rsi
callq 0x9b50
movq (%rsp), %r15
leaq (%r15,%r14), %r12
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r12, %rcx
callq *0x10(%rbx)
testl %eax, %eax
je 0xbb64
addq %r15, %r13
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r13, %rcx
callq *0x10(%rdi)
testl %eax, %eax
je 0xbb64
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x4310
movl %eax, %ebp
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xbb5c
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
testl %ebp, %ebp
jne 0xbb7a
xorl %ebp, %ebp
jmp 0xbba2
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xbb7a
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq %rsp, %rcx
movb $0x0, (%rcx)
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x7406
movzbl (%rsp), %ecx
andl $0x1, %ecx
incl %ecx
testb %al, %al
movl $0x3, %ebp
cmovnel %ecx, %ebp
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xbbb9
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movl %ebp, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4f0f0(%rip), %rdi     # 0x5acc4
leaq 0x4ef86(%rip), %rsi     # 0x5ab61
leaq 0x4f098(%rip), %rcx     # 0x5ac7a
movl $0x143, %edx            # imm = 0x143
callq 0x4200
jmp 0xbbee
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xbc10
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
jmp 0xbc10
jmp 0xbc0d
jmp 0xbc0d
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xbc27
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq %rbx, %rdi
callq 0x45e0