// File: sisong[P]ApkDiffPatch/src/diff/DiffData.cpp
// Function: getCompressedIsNormalizedBy(UnZipper*, int, int, bool)
bool getCompressedIsNormalizedBy(UnZipper* zip,int zlibCompressLevel,int zlibCompressMemLevel,bool testReCompressedByApkV2Sign){
    std::vector<TByte> oldCompressedCode;
    std::vector<TByte> newCompressedCode;
    int fileCount=UnZipper_fileCount(zip);
    for (int i=0; i<fileCount; ++i) {
        if (!UnZipper_file_isCompressed(zip,i)) continue;
        if (testReCompressedByApkV2Sign ^ UnZipper_file_isReCompressedByApkV2Sign(zip,i)) continue;
        check(getNormalizedCompressedCode(zip,i,newCompressedCode,zlibCompressLevel,zlibCompressMemLevel));
        size_t compressedSize=UnZipper_file_compressedSize(zip,i);
        if (compressedSize!=newCompressedCode.size()) return false;
        
        ZipFilePos_t pos=UnZipper_fileData_offset(zip,i);
        oldCompressedCode.resize(compressedSize);
        check(UnZipper_fileData_read(zip,pos,oldCompressedCode.data(),oldCompressedCode.data()+compressedSize));
        if (0!=memcmp(newCompressedCode.data(),oldCompressedCode.data(),compressedSize))
            return false;
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movb %cl, %al
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xbe70
leaq -0x50(%rbp), %rdi
callq 0xbe70
movq -0x10(%rbp), %rdi
callq 0x7ea90
movl %eax, -0x7c(%rbp)
jmp 0x991c
movl -0x7c(%rbp), %eax
movl %eax, -0x54(%rbp)
movl $0x0, -0x68(%rbp)
movl -0x68(%rbp), %eax
cmpl -0x54(%rbp), %eax
jge 0x9b77
movq -0x10(%rbp), %rdi
movl -0x68(%rbp), %esi
callq 0x7f2e0
movb %al, -0x7d(%rbp)
jmp 0x9946
movb -0x7d(%rbp), %al
testb $0x1, %al
jne 0x9977
jmp 0x994f
jmp 0x9b69
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xbb80
leaq -0x38(%rbp), %rdi
callq 0xbb80
jmp 0x9ba2
movzbl -0x19(%rbp), %eax
andl $0x1, %eax
movl %eax, -0x84(%rbp)
movq -0x10(%rbp), %rdi
movl -0x68(%rbp), %esi
callq 0x7f250
movb %al, -0x7e(%rbp)
jmp 0x9995
movl -0x84(%rbp), %eax
movb -0x7e(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
xorl %ecx, %eax
cmpl $0x0, %eax
je 0x99b0
jmp 0x9b69
movq -0x10(%rbp), %rdi
movl -0x68(%rbp), %esi
movl -0x14(%rbp), %ecx
movl -0x18(%rbp), %r8d
leaq -0x50(%rbp), %rdx
callq 0x9bb0
movb %al, -0x85(%rbp)
jmp 0x99cf
movb -0x85(%rbp), %al
testb $0x1, %al
jne 0x9a0a
jmp 0x99db
leaq 0xa3d62(%rip), %rdi     # 0xad744
xorl %eax, %eax
callq 0x4060
jmp 0x99eb
leaq 0xa387e(%rip), %rdi     # 0xad270
leaq 0xa387d(%rip), %rsi     # 0xad276
movl $0xcb, %edx
leaq 0xa3da3(%rip), %rcx     # 0xad7a8
callq 0x4270
movq -0x10(%rbp), %rdi
movl -0x68(%rbp), %esi
callq 0x80520
movl %eax, -0x8c(%rbp)
jmp 0x9a1e
movl -0x8c(%rbp), %eax
movl %eax, %eax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xbe90
movq %rax, %rcx
movq -0x98(%rbp), %rax
cmpq %rcx, %rax
je 0x9a5d
movb $0x0, -0x1(%rbp)
movl $0x1, -0x74(%rbp)
jmp 0x9b82
movq -0x10(%rbp), %rdi
movl -0x68(%rbp), %esi
callq 0x80620
movl %eax, -0x9c(%rbp)
jmp 0x9a71
movl -0x9c(%rbp), %eax
movl %eax, -0x78(%rbp)
movq -0x70(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0xbeb0
jmp 0x9a89
movq -0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
movl -0x78(%rbp), %eax
movl %eax, -0xac(%rbp)
leaq -0x38(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0xbb60
movq -0xc0(%rbp), %rdi
movq %rax, -0xa8(%rbp)
callq 0xbb60
movq -0xb8(%rbp), %rdi
movl -0xac(%rbp), %esi
movq -0xa8(%rbp), %rdx
movq %rax, %rcx
movq -0x70(%rbp), %rax
addq %rax, %rcx
callq 0x7fcb0
movb %al, -0x9d(%rbp)
jmp 0x9aeb
movb -0x9d(%rbp), %al
testb $0x1, %al
jne 0x9b26
jmp 0x9af7
leaq 0xa3ce7(%rip), %rdi     # 0xad7e5
xorl %eax, %eax
callq 0x4060
jmp 0x9b07
leaq 0xa3762(%rip), %rdi     # 0xad270
leaq 0xa3761(%rip), %rsi     # 0xad276
movl $0xd1, %edx
leaq 0xa3c87(%rip), %rcx     # 0xad7a8
callq 0x4270
leaq -0x50(%rbp), %rdi
callq 0xbb60
movq %rax, -0xc8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xbb60
movq -0xc8(%rbp), %rdi
movq %rax, %rsi
movq -0x70(%rbp), %rdx
callq 0x4190
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x9b67
movb $0x0, -0x1(%rbp)
movl $0x1, -0x74(%rbp)
jmp 0x9b82
jmp 0x9b69
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x9929
movb $0x1, -0x1(%rbp)
movl $0x1, -0x74(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xbb80
leaq -0x38(%rbp), %rdi
callq 0xbb80
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xd0, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x4680
nopl (%rax,%rax)