// File: /workspace/github_cpp_makefile_star2_O1/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 0x5ab(%rip), %rcx       # 0xc25c
movq %rcx, 0x18(%rax)
movq %rdx, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x53f00
movl $0x4, %ebp
testl %eax, %eax
jne 0xbdbd
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
leaq 0x40(%rsp), %rdi
callq 0x4392d
movq 0x8(%rbx), %r14
testq %r14, %r14
js 0xbde8
cmpq 0x48(%rsp), %r14
jne 0xbd95
testq %r14, %r14
je 0xbd7b
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq (%r14,%r14), %r13
movq %r13, %rsi
callq 0x9d84
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 0xbd7f
addq %r15, %r13
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r13, %rcx
callq *0x10(%rdi)
testl %eax, %eax
je 0xbd7f
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x4310
movl %eax, %ebp
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xbd77
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
testl %ebp, %ebp
jne 0xbd95
xorl %ebp, %ebp
jmp 0xbdbd
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xbd95
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 0x755e
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 0xbdd4
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 0x4eed5(%rip), %rdi     # 0x5acc4
leaq 0x4ed6b(%rip), %rsi     # 0x5ab61
leaq 0x4ee7d(%rip), %rcx     # 0x5ac7a
movl $0x143, %edx            # imm = 0x143
callq 0x4200
jmp 0xbe09
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xbe2b
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
jmp 0xbe2b
jmp 0xbe28
jmp 0xbe28
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xbe42
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq %rbx, %rdi
callq 0x45e0