// File: /workspace/github_cpp_makefile_star2_O3/sisong[P]ApkDiffPatch/src/normalized/normalized.cpp
// Function: ZipNormalized(char const*, char const*, int, int, bool, unsigned long, bool, int*)
bool ZipNormalized(const char* srcApk,const char* dstApk,int ZipAlignSize,int compressLevel,
                   bool isNotCompressEmptyFile,size_t pageAlignSoFile,bool pageAlignCompatible,int* out_apkFilesRemoved){
    bool result=true;
    bool _isInClear=false;
    int  fileCount=0;
    bool isHaveApkV2Sign=false;
    bool isHaveApkV3Sign=false;
    int  jarSignFileCount=0;
    std::vector<int>   fileIndexs;
    std::vector<std::string>  removedFiles;
    std::vector<std::string> _compressedEmptyFiles; //only for WARNING
    UnZipper unzipper;
    Zipper   zipper;
    UnZipper_init(&unzipper);
    Zipper_init(&zipper);
    
    check(UnZipper_openFile(&unzipper,srcApk));
    fileCount=UnZipper_fileCount(&unzipper);
    check(Zipper_openFile(&zipper,dstApk,fileCount,ZipAlignSize,compressLevel,kDefaultZlibCompressMemLevel,
                          pageAlignSoFile,pageAlignCompatible,kPageAlign_inNormalize));
    isHaveApkV2Sign=UnZipper_isHaveApkV2Sign(&unzipper);
    isHaveApkV3Sign=UnZipper_isHaveApkV3Sign(&unzipper);
    {
        int apkFilesRemoved=0;
        std::vector<TFileValue> files;
        getAllFiles(&unzipper,files);
        apkFilesRemoved=removeNonEmptyDirs(&unzipper,files);
        fileCount=(int)files.size();
        std::sort(files.begin(),files.end(),TFileValue::TCmp(UnZipper_fileCount(&unzipper)));
        for (int i=0; i<fileCount; ++i) {
            int fileIndex=files[i].fileIndex;
            if (UnZipper_file_isApkV1Sign(&unzipper,fileIndex)){
                ++jarSignFileCount;
                if (isHaveApkV2Sign){
                    ++apkFilesRemoved;
                    removedFiles.push_back(files[i].fileName);
                    continue; //remove JarSign(ApkV1Sign) when found ApkV2Sign
                }
            }
            if (UnZipper_file_isStampCertFile(&unzipper,fileIndex)){
                ++apkFilesRemoved;
                removedFiles.push_back(files[i].fileName);
                continue; //remove stamp cert file
            }

            fileIndexs.push_back(fileIndex);
        }
        if (out_apkFilesRemoved)
            *out_apkFilesRemoved=apkFilesRemoved;
    }
    
    printf("\n");
    for (int i=0; i<(int)fileIndexs.size(); ++i) {
        int fileIndex=fileIndexs[i];
        std::string fileName=zipFile_name(&unzipper,fileIndex);
        if (g_isPrintNormalizingFileName)
            hpatch_printPath_utf8(("\""+fileName+"\"\n").c_str());
        if (compressLevel==0){
            check(Zipper_file_append_set_new_isCompress(&zipper,false));
        } else if (isCompressedEmptyFile(&unzipper,fileIndex)){
            if (isNotCompressEmptyFile){
                check(Zipper_file_append_set_new_isCompress(&zipper,false));
                hpatch_printPath_utf8(("NOTE: \""+fileName+"\"").c_str());
                printf(" is a compressed empty file, change to uncompressed!\n");
            }else{
                _compressedEmptyFiles.push_back(fileName);
             }
        }
        bool isAlwaysReCompress=true;
        check(Zipper_file_append_copy(&zipper,&unzipper,fileIndex,isAlwaysReCompress));
    }
    printf("\n");

    //no run: check(Zipper_copyExtra_before_fileHeader(&zipper,&unzipper));
    for (int i=0; i<(int)fileIndexs.size(); ++i) {
        int fileIndex=fileIndexs[i];
        if (compressLevel==0){
            check(Zipper_file_append_set_new_isCompress(&zipper,false));
        } else if (isNotCompressEmptyFile&&isCompressedEmptyFile(&unzipper,fileIndex)){
            check(Zipper_fileHeader_append_set_new_isCompress(&zipper,false));
        }
        check(Zipper_fileHeader_append(&zipper,&unzipper,fileIndex));
    }
    check(Zipper_endCentralDirectory_append(&zipper,&unzipper));
    
    for (int i=0;i<(int)_compressedEmptyFiles.size();++i){
        hpatch_printPath_utf8(("WARNING: \""+_compressedEmptyFiles[i]).c_str());
        printf(" is a compressed empty file, can't patch by old(version<v1.3.5) ZipPatch!)\n");
    }
    if (jarSignFileCount>0){
        if (isHaveApkV2Sign){
            printf("WARNING: src removed JarSign(ApkV1Sign) (%d file, need re-sign)\n",jarSignFileCount);
        }else{
            printf("WARNING: src JarSign(ApkV1Sign) (%d file) has been Normalized, Don't re-sign!\n",jarSignFileCount);
        }
    }
    for (size_t i=0;i<removedFiles.size();++i)
        hpatch_printPath_utf8((std::string("WARNING:   removed file: \"")+removedFiles[i]+"\"\n").c_str());
    if (isHaveApkV2Sign){
        printf(isHaveApkV3Sign?
                "WARNING: src removed ApkV2Sign & ApkV3Sign  data (%d Byte, need re-sign)\n"
               :"WARNING: src removed ApkV2Sign data (%d Byte, need re-sign)\n",
                (int)UnZipper_ApkV2SignSize(&unzipper));
    }
    printf("src fileCount: %d  (filseSize: %" PRIu64 ")\n"
            "out fileCount: %d  (filseSize: %" PRIu64 ")\n\n",
            fileCount,unzipper._fileStream.base.streamSize,
            (int)fileIndexs.size(),zipper._fileStream.out_length);

clear:
    _isInClear=true;
    check(UnZipper_close(&unzipper));
    check(Zipper_close(&zipper));
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
movq %r9, %rbx
movl %r8d, 0x84(%rsp)
movl %ecx, 0x5c(%rsp)
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
xorl %eax, %eax
movq %rax, 0x70(%rsp)
movq %rax, 0xd0(%rsp)
movaps %xmm0, 0xc0(%rsp)
movq %rax, 0xf0(%rsp)
movaps %xmm0, 0xe0(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0xc5e8
leaq 0x1a8(%rsp), %rdi
callq 0xd53f
leaq 0xf8(%rsp), %rdi
movq %r12, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xce91
testb %al, %al
je 0x4853
leaq 0xf8(%rsp), %rdi
callq 0xc053
subq $0x8, %rsp
movzbl 0x348(%rsp), %r10d
leaq 0x1b0(%rsp), %rdi
movq %r15, %rsi
movl %eax, %edx
movl %ebp, %ecx
movl 0x64(%rsp), %r8d
movl $0x8, %r9d
pushq $0x1
pushq %r10
pushq %rbx
callq 0xda2a
addq $0x20, %rsp
testb %al, %al
je 0x485c
leaq 0xf8(%rsp), %rdi
movq 0x50(%rdi), %rax
movq %rax, 0xb8(%rsp)
movq 0x98(%rdi), %rax
movq %rax, 0xb0(%rsp)
callq 0xc5d1
movb %al, 0xf(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0xc053
movl %eax, %ebx
movslq %eax, %rsi
leaq 0x30(%rsp), %rdi
callq 0x5422
testl %ebx, %ebx
jle 0x46a8
movl %ebx, %eax
movq %rax, (%rsp)
xorl %r14d, %r14d
leaq 0xf8(%rsp), %rbx
leaq 0x10(%rsp), %r15
xorl %r12d, %r12d
movq 0x30(%rsp), %r13
movl %r12d, 0x20(%r13,%r14)
movq %rbx, %rdi
movl %r12d, %esi
callq 0xc05c
movl %eax, %ebp
movq %rbx, %rdi
movl %r12d, %esi
callq 0xc070
movslq %ebp, %rdx
addq %rax, %rdx
leaq 0x20(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movq %r15, %rdi
movq %rax, %rsi
callq 0x4448
addq %r14, %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x3350
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x469b
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32b0
incq %r12
addq $0x28, %r14
cmpq %r12, (%rsp)
jne 0x4634
leaq 0xf8(%rsp), %rdi
callq 0xc053
movq %rax, (%rsp)
movslq (%rsp), %rsi
leaq 0x10(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0x56b2
movq (%rsp), %rax
movl %eax, %r14d
testl %eax, %eax
jle 0x46fb
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x30(%rsp), %rdx
addq %rax, %rdx
movq 0x10(%rsp), %rsi
movq %rdx, (%rsi,%rcx,8)
incq %rcx
addq $0x28, %rax
cmpq %rcx, %r14
jne 0x46de
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r15
cmpq %r15, %rbx
je 0x4737
movq %r15, %rax
subq %rbx, %rax
sarq $0x3, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x575b
movq %rbx, %rdi
movq %r15, %rsi
callq 0x580e
cmpl $0x2, (%rsp)
jl 0x47eb
movq (%rsp), %rax
decl %eax
movq %rax, 0x78(%rsp)
xorl %ebx, %ebx
movq 0x10(%rsp), %rax
movq (%rax,%rbx,8), %rax
movl 0x20(%rax), %esi
leaq 0xf8(%rsp), %rdi
callq 0xcffc
testl %eax, %eax
jne 0x47dd
movq 0x10(%rsp), %rax
movq (%rax,%rbx,8), %r13
movq 0x8(%rax,%rbx,8), %rax
movq 0x8(%r13), %r15
movq 0x8(%rax), %r12
cmpq %r12, %r15
ja 0x47dd
movq (%r13), %rbp
movq (%rax), %rsi
movq %rbp, %rdi
movq %rsi, 0xa8(%rsp)
movq %r15, %rdx
callq 0x32c0
testl %eax, %eax
jne 0x47dd
testq %r15, %r15
je 0x47b9
movzbl -0x1(%rbp,%r15), %eax
cmpl $0x2f, %eax
je 0x47d5
cmpl $0x5c, %eax
je 0x47d5
cmpq %r12, %r15
jae 0x47dd
movq 0xa8(%rsp), %rax
movzbl (%rax,%r15), %eax
cmpl $0x5c, %eax
je 0x47d5
cmpl $0x2f, %eax
jne 0x47dd
movl $0xffffffff, 0x20(%r13) # imm = 0xFFFFFFFF
incq %rbx
cmpq %rbx, 0x78(%rsp)
jne 0x474e
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x4802
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
cmpl $0x0, (%rsp)
jle 0x48f0
xorl %ebx, %ebx
xorl %r15d, %r15d
xorl %r13d, %r13d
movq 0x30(%rsp), %rsi
movl 0x20(%rsi,%rbx), %eax
testl %eax, %eax
js 0x4842
movl %r13d, %ecx
cmpq %rcx, %r15
je 0x483f
movslq %r13d, %rcx
leaq (%rcx,%rcx,4), %rcx
leaq (%rsi,%rcx,8), %rdi
addq %rbx, %rsi
movl %eax, 0x20(%rdi)
callq 0x3220
incl %r13d
incq %r15
addq $0x28, %rbx
cmpq %r15, %r14
jne 0x4814
jmp 0x48f3
leaq 0x1c7fd(%rip), %rdi     # 0x21057
jmp 0x4863
leaq 0x1c81f(%rip), %rdi     # 0x21082
callq 0x3410
xorl %ebx, %ebx
leaq 0xf8(%rsp), %rdi
callq 0xc5f4
testb %al, %al
jne 0x4889
leaq 0x1ca20(%rip), %rdi     # 0x212a2
callq 0x3410
xorl %ebx, %ebx
leaq 0x1a8(%rsp), %rdi
callq 0xd54b
testb %al, %al
jne 0x48a8
leaq 0x1ca22(%rip), %rdi     # 0x212c3
callq 0x3410
xorl %ebx, %ebx
leaq 0xe0(%rsp), %rdi
callq 0x53c4
leaq 0xc0(%rsp), %rdi
callq 0x53c4
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x48d9
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
andb $0x1, %bl
movl %ebx, %eax
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r13d, %r13d
movslq %r13d, %rsi
leaq 0x30(%rsp), %rdi
callq 0x5422
movq 0x30(%rsp), %r15
movq 0x38(%rsp), %rbx
leaq 0xf8(%rsp), %rdi
callq 0xc053
movl %eax, %ebp
movq %rbx, %rax
subq %r15, %rax
sarq $0x3, %rax
movabsq $-0x3333333333333333, %r12 # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %r12
cmpq %rbx, %r15
je 0x495d
bsrq %r12, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r15, %rdi
movq %rbx, %rsi
movl %ebp, %ecx
callq 0x5c19
movq %r15, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x5d02
movq (%rsp), %rax
subl %r13d, %eax
movq %rax, (%rsp)
testl %r12d, %r12d
jle 0x4a4e
movl %r12d, %r14d
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
xorl %r13d, %r13d
leaq 0xf8(%rsp), %rbx
leaq 0xc0(%rsp), %r15
leaq 0x1c64f(%rip), %rbp     # 0x20fe4
movl $0x0, 0x78(%rsp)
movq 0x30(%rsp), %rax
movl 0x20(%rax,%r13), %esi
movl %esi, 0x10(%rsp)
movq %rbx, %rdi
callq 0xc13d
testb %al, %al
je 0x49df
incl 0x78(%rsp)
movq 0xb0(%rsp), %rax
cmpq 0xb8(%rsp), %rax
jae 0x49df
movq 0x30(%rsp), %rsi
addq %r13, %rsi
movq %r15, %rdi
callq 0x52a0
jmp 0x4a07
movl 0x10(%rsp), %esi
movq %rbx, %rdi
movq %rbp, %rdx
movl $0x11, %ecx
callq 0xc20e
testb %al, %al
je 0x4a13
movq 0x30(%rsp), %rsi
addq %r13, %rsi
movq %r15, %rdi
callq 0x52a0
movq (%rsp), %rax
incl %eax
movq %rax, (%rsp)
jmp 0x4a3f
movq 0x68(%rsp), %rsi
cmpq 0x70(%rsp), %rsi
je 0x4a30
movl 0x10(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x68(%rsp)
jmp 0x4a3f
leaq 0x60(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x6c9e
addq $0x28, %r13
decq %r14
jne 0x499d
jmp 0x4a56
movl $0x0, 0x78(%rsp)
movq 0x348(%rsp), %rax
testq %rax, %rax
je 0x4a69
movq (%rsp), %rcx
movl %ecx, (%rax)
movq %r12, 0xa8(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x52de
movl $0xa, %edi
callq 0x3370
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
testl %ecx, %ecx
jle 0x4d74
leaq 0x40(%rsp), %r14
movb $0x1, %cl
movl %ecx, (%rsp)
xorl %r15d, %r15d
leaq 0xf8(%rsp), %rbx
leaq 0x88(%rsp), %r12
movq %r14, %r13
movl (%rax,%r15,4), %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0xc05c
movl %eax, %r14d
movq %rbx, %rdi
movl %ebp, %esi
callq 0xc070
movslq %r14d, %rdx
addq %rax, %rdx
leaq 0x20(%rsp), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x4448
cmpb $0x1, 0x2c7c3(%rip)     # 0x312c0
movq %r13, %r14
jne 0x4bb1
movq %r12, %rdi
leaq 0x1caf3(%rip), %rsi     # 0x21603
leaq 0x10(%rsp), %rdx
callq 0x533c
movq %r12, %rdi
leaq 0x1b4f3(%rip), %rsi     # 0x20017
callq 0x3520
movq %r14, 0x30(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4b4c
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x4b53
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x30(%rsp), %rdi
callq 0x141a8
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x4b8c
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x4bb1
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x32b0
cmpl $0x0, 0x5c(%rsp)
je 0x4c52
movq %rbx, %rdi
movl %ebp, %esi
callq 0xcffc
testl %eax, %eax
jne 0x4cfa
movq %rbx, %rdi
movl %ebp, %esi
callq 0xc5b9
testb %al, %al
je 0x4cfa
cmpb $0x0, 0x84(%rsp)
je 0x4c75
leaq 0x1a8(%rsp), %rdi
xorl %esi, %esi
callq 0xf4b4
leaq 0x1c5e9(%rip), %rdi     # 0x211ed
testb %al, %al
je 0x4d1f
movq %r12, %rdi
leaq 0x1c1f2(%rip), %rsi     # 0x20e08
leaq 0x10(%rsp), %rdx
callq 0x533c
movq %r12, %rdi
leaq 0x1c9d9(%rip), %rsi     # 0x21603
callq 0x3520
movq %r14, 0x30(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4c89
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x4c90
leaq 0x1a8(%rsp), %rdi
xorl %esi, %esi
callq 0xf4b4
leaq 0x1c585(%rip), %rdi     # 0x211ed
testb %al, %al
jne 0x4cfa
jmp 0x4d1f
leaq 0xe0(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x52a0
jmp 0x4cfa
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x30(%rsp), %rdi
callq 0x141a8
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x4cc9
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x4cee
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x32b0
leaq 0x1c432(%rip), %rdi     # 0x21127
callq 0x3410
leaq 0x1a8(%rsp), %rdi
movq %rbx, %rsi
movl %ebp, %edx
movl $0x1, %ecx
callq 0xf0f6
movb $0x1, %bpl
leaq 0x1c441(%rip), %rdi     # 0x2115c
testb %al, %al
jne 0x4d2d
callq 0x3410
xorl %ebp, %ebp
movl $0x0, (%rsp)
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x4d49
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32b0
testb %bpl, %bpl
je 0x5107
incq %r15
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r15
jl 0x4abb
jmp 0x4d79
movb $0x1, %al
movl %eax, (%rsp)
movl $0xa, %edi
callq 0x3370
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
testl %ecx, %ecx
jle 0x4e3a
xorl %r14d, %r14d
leaq 0x1a8(%rsp), %rbx
leaq 0xf8(%rsp), %r15
movl (%rax,%r14,4), %ebp
cmpl $0x0, 0x5c(%rsp)
je 0x4df3
cmpb $0x0, 0x84(%rsp)
je 0x4e05
movq %r15, %rdi
movl %ebp, %esi
callq 0xcffc
testl %eax, %eax
jne 0x4e05
movq %r15, %rdi
movl %ebp, %esi
callq 0xc5b9
testb %al, %al
je 0x4e05
movq %rbx, %rdi
xorl %esi, %esi
callq 0xf4ee
testb %al, %al
jne 0x4e05
jmp 0x5133
movq %rbx, %rdi
xorl %esi, %esi
callq 0xf4b4
testb %al, %al
je 0x5127
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0xf1ef
testb %al, %al
je 0x511b
incq %r14
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r14
jl 0x4daf
leaq 0x1a8(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0xf242
testb %al, %al
je 0x510f
movq 0xe0(%rsp), %rdx
movq 0xe8(%rsp), %rax
subq %rdx, %rax
shrq $0x5, %rax
leaq 0x20(%rsp), %rbp
testl %eax, %eax
jle 0x4eeb
xorl %r13d, %r13d
leaq 0x1bf8f(%rip), %r12     # 0x20e10
leaq 0x10(%rsp), %r14
leaq 0x1c453(%rip), %r15     # 0x212e0
xorl %ebx, %ebx
addq %r13, %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x533c
movq 0x10(%rsp), %rdi
callq 0x141a8
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0x4ebe
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32b0
movq %r15, %rdi
callq 0x3410
incq %rbx
movq 0xe0(%rsp), %rdx
movq 0xe8(%rsp), %rax
subq %rdx, %rax
shrq $0x5, %rax
cltq
addq $0x20, %r13
cmpq %rax, %rbx
jl 0x4e8f
movl 0x78(%rsp), %esi
testl %esi, %esi
jle 0x4f1c
movq 0xb0(%rsp), %rax
cmpq 0xb8(%rsp), %rax
leaq 0x1bf11(%rip), %rax     # 0x20e1b
leaq 0x1bf4b(%rip), %rdi     # 0x20e5c
cmovbq %rax, %rdi
xorl %eax, %eax
callq 0x3050
movq 0xc8(%rsp), %rax
cmpq 0xc0(%rsp), %rax
je 0x5095
leaq 0x98(%rsp), %r12
leaq 0x40(%rsp), %r13
movl $0x8, %ebx
xorl %r14d, %r14d
leaq 0x88(%rsp), %r15
movq %r12, 0x88(%rsp)
movq %r15, %rdi
leaq 0x1bf4a(%rip), %rsi     # 0x20eab
leaq 0x1bf5d(%rip), %rdx     # 0x20ec5
callq 0x4448
movq 0xc0(%rsp), %rax
movq -0x8(%rax,%rbx), %rsi
movq (%rax,%rbx), %rdx
movq %r15, %rdi
callq 0x30d0
movq %r13, 0x30(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4fa9
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x4fb1
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x30(%rsp), %rdi
leaq 0x1b042(%rip), %rsi     # 0x20017
callq 0x3520
movq %rbp, 0x10(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4ffd
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0x5004
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x10(%rsp), %rdi
callq 0x141a8
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0x503d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x30(%rsp), %rdi
cmpq %r13, %rdi
je 0x5054
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x88(%rsp), %rdi
cmpq %r12, %rdi
je 0x5071
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0xc8(%rsp), %rax
subq 0xc0(%rsp), %rax
incq %r14
sarq $0x5, %rax
addq $0x20, %rbx
cmpq %rax, %r14
jb 0x4f4f
movq 0xb0(%rsp), %rax
cmpq 0xb8(%rsp), %rax
jae 0x50d3
leaq 0x1be18(%rip), %rax     # 0x20ec6
leaq 0x1be5b(%rip), %rdi     # 0x20f10
cmpb $0x0, 0xf(%rsp)
cmovneq %rax, %rdi
movl 0x148(%rsp), %esi
subl 0x190(%rsp), %esi
xorl %eax, %eax
callq 0x3050
movq 0x108(%rsp), %rdx
movq 0x68(%rsp), %rcx
subq 0x60(%rsp), %rcx
shrq $0x2, %rcx
movq 0x1f8(%rsp), %r8
leaq 0x1be55(%rip), %rdi     # 0x20f4d
movq 0xa8(%rsp), %rsi
xorl %eax, %eax
callq 0x3050
movl (%rsp), %ebx
jmp 0x486a
leaq 0x1c150(%rip), %rdi     # 0x21266
jmp 0x4863
leaq 0x1c107(%rip), %rdi     # 0x21229
jmp 0x4863
leaq 0x1c0bf(%rip), %rdi     # 0x211ed
jmp 0x4863
leaq 0x1c071(%rip), %rdi     # 0x211ab
jmp 0x4863
jmp 0x51c5
jmp 0x51e1
jmp 0x5213
jmp 0x5234
jmp 0x5252
movq %rax, %rbx
jmp 0x5193
movq %rax, %rbx
jmp 0x517c
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0x517c
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x30(%rsp), %rdi
cmpq %r13, %rdi
je 0x5193
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x88(%rsp), %rdi
cmpq %r12, %rdi
je 0x5266
movq 0x98(%rsp), %rsi
jmp 0x522a
jmp 0x5252
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
jne 0x5225
jmp 0x5266
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x51e4
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x51e4
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x5216
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x5216
jmp 0x5213
jmp 0x5259
jmp 0x5213
jmp 0x5252
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x5266
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x5266
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x525c
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
jmp 0x525c
jmp 0x5252
movq %rax, %rbx
jmp 0x5266
jmp 0x5259
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x52de
leaq 0xe0(%rsp), %rdi
callq 0x53c4
leaq 0xc0(%rsp), %rdi
callq 0x53c4
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x5297
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq %rbx, %rdi
callq 0x34d0
nop