// File: sisong[P]ApkDiffPatch/src/diff/Differ.cpp
// Function: ZipDiffWithStream(hpatch_TStreamInput const*, hpatch_TStreamInput const*, hpatch_TStreamOutput const*, hdiff_TCompress const*, hpatch_TDecompress*, int, unsigned long, bool*, int)
bool ZipDiffWithStream(const hpatch_TStreamInput* oldZipStream,const hpatch_TStreamInput* newZipStream,
                       const hpatch_TStreamOutput* outDiffStream,
                       const hdiff_TCompress* compressPlugin,hpatch_TDecompress* decompressPlugin,
                       int diffMatchScore,size_t patchStepMemSize,
                       bool* out_isNewZipApkV2SignNoError,int threadNum){
    UnZipper            oldZip;
    UnZipper            newZip;
    std::vector<TByte>  newData;
    std::vector<TByte>  oldData;
    std::vector<TByte>  hdiffzData;
    std::vector<TByte>  out_diffData;
    std::vector<uint32_t> samePairList;
    std::vector<uint32_t> newRefDecompressList;
    std::vector<uint32_t> newRefList;
    std::vector<uint32_t> newRefOtherCompressedList;
    std::vector<uint32_t> newRefCompressedSizeList;
    std::vector<uint32_t> oldRefList;
    bool            result=true;
    bool            _isInClear=false;
    bool            byteByByteEqualCheck=false;
    bool            isNewZipApkV2SignNoError=true;
    size_t          newZipAlignSize=0;
    int             newZipNormalized_compressLevel=kDefaultZlibCompressLevel;
    int             newZipNormalized_compressMemLevel=kDefaultZlibCompressMemLevel;
    int             newZip_otherCompressLevel=0;
    int             newZip_otherCompressMemLevel=0;
    bool            newCompressedDataIsNormalized=false;
    const bool isSD=patchStepMemSize>0;
    
    check(compressPlugin!=0);
    check(decompressPlugin!=0);

    UnZipper_init(&oldZip);
    UnZipper_init(&newZip);
    check(UnZipper_openStream(&oldZip,oldZipStream));
    check(UnZipper_openStream(&newZip,newZipStream,false,false,true));
    
    newZipAlignSize=getBaseAlignSize_unsafe(&newZip);
    if (UnZipper_isHaveApkV2Sign(&newZip)){//precondition (+checkZipIsSame() to complete)
        newZip._isDataNormalized=(newZipAlignSize>0)&&(newZip._dataDescriptorCount==0);
    }else{
        newZip._isDataNormalized=true;
    }
    //if (newZip._isDataNormalized && UnZipper_isHaveApkV2Sign(&newZip)){
        newCompressedDataIsNormalized=getCompressedIsNormalized(&newZip,&newZipNormalized_compressLevel,
                                                                &newZipNormalized_compressMemLevel);
    //}else{
    //    newCompressedDataIsNormalized=getCompressedIsNormalizedBy(&newZip,newZipNormalized_compressLevel,
    //                                                              newZipNormalized_compressMemLevel);
    //}
    newZip._isDataNormalized&=newCompressedDataIsNormalized;
    if (UnZipper_isHaveApkV2Sign(&newZip)){
        if (!getCompressedIsNormalized(&newZip,&newZip_otherCompressLevel,&newZip_otherCompressMemLevel,true)){
            newZip_otherCompressLevel=0;
            newZip_otherCompressMemLevel=0;
        }
    }
    byteByByteEqualCheck=UnZipper_isHaveApkV2Sign(&newZip);
    
    if (newCompressedDataIsNormalized && UnZipper_isHaveApkV2Sign(&oldZip))
        oldZip._isDataNormalized=getCompressedIsNormalizedBy(&oldZip,newZipNormalized_compressLevel,
                                                             newZipNormalized_compressMemLevel);
    isNewZipApkV2SignNoError=checkZipInfo(&oldZip,&newZip);
    if (out_isNewZipApkV2SignNoError) *out_isNewZipApkV2SignNoError=isNewZipApkV2SignNoError;
    //if isNewZipApkV2SignNoError==false ,same info error,but continue;
    
    std::cout<<"ZipDiff with compress plugin: \""<<compressPlugin->compressType()<<"\"\n";
    check(getSamePairList(&newZip,&oldZip,newCompressedDataIsNormalized,
                          newZipNormalized_compressLevel,newZipNormalized_compressMemLevel,
                          samePairList,newRefList,newRefOtherCompressedList,newRefCompressedSizeList));
    newRefDecompressList=newRefList;
    if ((newZip_otherCompressLevel|newZip_otherCompressMemLevel)!=0){
        newRefDecompressList.insert(newRefDecompressList.end(),
                                    newRefOtherCompressedList.begin(),newRefOtherCompressedList.end());
        std::sort(newRefDecompressList.begin(),newRefDecompressList.end());
    }
    check(getOldRefList(&newZip,samePairList,newRefDecompressList,&oldZip,oldRefList));
    std::cout<<"ZipDiff same file count: "<<samePairList.size()/2<<" (all "
    <<UnZipper_fileCount(&newZip)<<")\n";
    std::cout<<"    diff new file count: "<<newRefList.size()+newRefOtherCompressedList.size()<<"\n";
    std::cout<<"     ref old file count: "<<oldRefList.size()<<" (all "
    <<UnZipper_fileCount(&oldZip)<<")\n";
    std::cout<<"     ref old decompress: "
    <<OldStream_getDecompressFileCount(&oldZip,oldRefList.data(),oldRefList.size())<<" file ("
    <<OldStream_getDecompressSumSize(&oldZip,oldRefList.data(),oldRefList.size()) <<" byte!)\n";
    //for (int i=0; i<(int)newRefList.size(); ++i) std::cout<<zipFile_name(&newZip,newRefList[i])<<"\n";
    //for (int i=0; i<(int)newRefOtherCompressedList.size(); ++i) std::cout<<zipFile_name(&newZip,newRefOtherCompressedList[i])<<"\n";
    //for (int i=0; i<(int)oldRefList.size(); ++i) std::cout<<zipFile_name(&oldZip,oldRefList[i])<<"\n";
    
    #define _loadNewAndOldData() \
        if ((newZip_otherCompressLevel|newZip_otherCompressMemLevel)!=0){ \
            check(readZipStreamData(&newZip,newRefDecompressList,std::vector<uint32_t>(),newData)); \
        }else{ \
            check(readZipStreamData(&newZip,newRefList,newRefOtherCompressedList,newData)); \
        } \
        check(readZipStreamData(&oldZip,oldRefList,std::vector<uint32_t>(),oldData));
    _loadNewAndOldData();
    check(HDiffZ(oldData,newData,hdiffzData,compressPlugin,diffMatchScore,patchStepMemSize,threadNum));
    _loadNewAndOldData();
    check(HPatchZ_check(oldData,newData,hdiffzData,decompressPlugin,isSD));
    { std::vector<TByte> _empty; oldData.swap(_empty); }
    { std::vector<TByte> _empty; newData.swap(_empty); }
    
    check(serializeZipDiffData(out_diffData,&newZip,&oldZip,newZipAlignSize,
                               newZipNormalized_compressLevel,newZipNormalized_compressMemLevel,
                               newZip_otherCompressLevel,newZip_otherCompressMemLevel,
                               samePairList,newRefOtherCompressedList,newRefCompressedSizeList,
                               oldRefList,hdiffzData,compressPlugin,isSD?1:0));
    std::cout<<"ZipDiff size: "<<out_diffData.size()<<"\n";
    
    check(outDiffStream->write(outDiffStream,0,out_diffData.data(),out_diffData.data()+out_diffData.size()));
clear:
    _isInClear=true;
    check(UnZipper_close(&newZip));
    check(UnZipper_close(&oldZip));
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x5b0, %rsp            # imm = 0x5B0
movl 0x20(%rbp), %eax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0xbe70
leaq -0x1c0(%rbp), %rdi
callq 0xbe70
leaq -0x1d8(%rbp), %rdi
callq 0xbe70
leaq -0x1f0(%rbp), %rdi
callq 0xbe70
leaq -0x208(%rbp), %rdi
callq 0xbf40
leaq -0x220(%rbp), %rdi
callq 0xbf40
leaq -0x238(%rbp), %rdi
callq 0xbf40
leaq -0x250(%rbp), %rdi
callq 0xbf40
leaq -0x268(%rbp), %rdi
callq 0xbf40
leaq -0x280(%rbp), %rdi
callq 0xbf40
movb $0x1, -0x281(%rbp)
movb $0x0, -0x282(%rbp)
movb $0x0, -0x283(%rbp)
movb $0x1, -0x284(%rbp)
movq $0x0, -0x290(%rbp)
movl $0x6, -0x294(%rbp)
movl $0x8, -0x298(%rbp)
movl $0x0, -0x29c(%rbp)
movl $0x0, -0x2a0(%rbp)
movb $0x0, -0x2a1(%rbp)
cmpq $0x0, 0x10(%rbp)
seta %al
andb $0x1, %al
movb %al, -0x2a2(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x12b11
leaq 0x9b2fa(%rip), %rdi     # 0xaddd4
xorl %eax, %eax
callq 0x4060
jmp 0x12ae3
movb $0x0, -0x281(%rbp)
testb $0x1, -0x282(%rbp)
jne 0x12b0f
jmp 0x139f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2b0(%rbp)
movl %eax, -0x2b4(%rbp)
jmp 0x13b1b
jmp 0x12b11
cmpq $0x0, -0x28(%rbp)
jne 0x12b3f
leaq 0x9b2b3(%rip), %rdi     # 0xaddd2
xorl %eax, %eax
callq 0x4060
jmp 0x12b28
movb $0x0, -0x281(%rbp)
testb $0x1, -0x282(%rbp)
jne 0x12b3d
jmp 0x139f4
jmp 0x12b3f
leaq -0xe0(%rbp), %rdi
callq 0x7f360
jmp 0x12b4d
leaq -0x190(%rbp), %rdi
callq 0x7f360
jmp 0x12b5b
movq -0x8(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
xorl %r8d, %r8d
movl %r8d, %edx
movl %r8d, %ecx
callq 0x7f480
movb %al, -0x3a1(%rbp)
jmp 0x12b7c
movb -0x3a1(%rbp), %al
testb $0x1, %al
jne 0x12baf
jmp 0x12b88
leaq 0x9a777(%rip), %rdi     # 0xad306
xorl %eax, %eax
callq 0x4060
jmp 0x12b98
movb $0x0, -0x281(%rbp)
testb $0x1, -0x282(%rbp)
jne 0x12bad
jmp 0x139f4
jmp 0x12baf
movq -0x10(%rbp), %rsi
leaq -0x190(%rbp), %rdi
xorl %ecx, %ecx
movl $0x1, %r8d
movl %ecx, %edx
callq 0x7f480
movb %al, -0x3a2(%rbp)
jmp 0x12bd1
movb -0x3a2(%rbp), %al
testb $0x1, %al
jne 0x12c04
jmp 0x12bdd
leaq 0x9b20a(%rip), %rdi     # 0xaddee
xorl %eax, %eax
callq 0x4060
jmp 0x12bed
movb $0x0, -0x281(%rbp)
testb $0x1, -0x282(%rbp)
jne 0x12c02
jmp 0x139f4
jmp 0x12c04
leaq -0x190(%rbp), %rdi
callq 0x9e50
movq %rax, -0x3b0(%rbp)
jmp 0x12c19
movq -0x3b0(%rbp), %rax
movq %rax, -0x290(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x13f80
movb %al, -0x3b1(%rbp)
jmp 0x12c3b
movb -0x3b1(%rbp), %al
testb $0x1, %al
jne 0x12c47
jmp 0x12c79
xorl %eax, %eax
cmpq $0x0, -0x290(%rbp)
movb %al, -0x3b2(%rbp)
jbe 0x12c69
cmpl $0x0, -0x120(%rbp)
sete %al
movb %al, -0x3b2(%rbp)
movb -0x3b2(%rbp), %al
andb $0x1, %al
movb %al, -0x107(%rbp)
jmp 0x12c80
movb $0x1, -0x107(%rbp)
leaq -0x190(%rbp), %rdi
leaq -0x294(%rbp), %rsi
leaq -0x298(%rbp), %rdx
xorl %ecx, %ecx
callq 0x9ce0
movb %al, -0x3b3(%rbp)
jmp 0x12ca4
movb -0x3b3(%rbp), %al
andb $0x1, %al
movb %al, -0x2a1(%rbp)
movzbl -0x2a1(%rbp), %eax
movzbl -0x107(%rbp), %ecx
andl %ecx, %eax
andb $0x1, %al
movb %al, -0x107(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x13f80
movb %al, -0x3b4(%rbp)
jmp 0x12cde
movb -0x3b4(%rbp), %al
testb $0x1, %al
jne 0x12cea
jmp 0x12d33
leaq -0x190(%rbp), %rdi
leaq -0x29c(%rbp), %rsi
leaq -0x2a0(%rbp), %rdx
movl $0x1, %ecx
callq 0x9ce0
movb %al, -0x3b5(%rbp)
jmp 0x12d11
movb -0x3b5(%rbp), %al
testb $0x1, %al
jne 0x12d31
jmp 0x12d1d
movl $0x0, -0x29c(%rbp)
movl $0x0, -0x2a0(%rbp)
jmp 0x12d33
leaq -0x190(%rbp), %rdi
callq 0x13f80
movb %al, -0x3b6(%rbp)
jmp 0x12d47
movb -0x3b6(%rbp), %al
andb $0x1, %al
movb %al, -0x283(%rbp)
testb $0x1, -0x2a1(%rbp)
je 0x12dab
leaq -0xe0(%rbp), %rdi
callq 0x13f80
movb %al, -0x3b7(%rbp)
jmp 0x12d72
movb -0x3b7(%rbp), %al
testb $0x1, %al
jne 0x12d7e
jmp 0x12dab
movl -0x294(%rbp), %esi
movl -0x298(%rbp), %edx
leaq -0xe0(%rbp), %rdi
xorl %ecx, %ecx
callq 0x98e0
movb %al, -0x3b8(%rbp)
jmp 0x12da0
movb -0x3b8(%rbp), %al
andb $0x1, %al
movb %al, -0x57(%rbp)
leaq -0xe0(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x13fb0
movb %al, -0x3b9(%rbp)
jmp 0x12dc6
movb -0x3b9(%rbp), %al
andb $0x1, %al
movb %al, -0x284(%rbp)
cmpq $0x0, 0x18(%rbp)
je 0x12dea
movb -0x284(%rbp), %cl
movq 0x18(%rbp), %rax
andb $0x1, %cl
movb %cl, (%rax)
movq 0xd31d7(%rip), %rdi     # 0xe5fc8
leaq 0x9b039(%rip), %rsi     # 0xade31
callq 0x4380
movq %rax, -0x3c8(%rbp)
jmp 0x12e06
movq -0x20(%rbp), %rax
movq (%rax), %rax
callq *%rax
movq %rax, -0x3d0(%rbp)
jmp 0x12e18
movq -0x3d0(%rbp), %rsi
movq -0x3c8(%rbp), %rdi
callq 0x4380
movq %rax, -0x3d8(%rbp)
jmp 0x12e34
movq -0x3d8(%rbp), %rdi
leaq 0x993d7(%rip), %rsi     # 0xac219
callq 0x4380
jmp 0x12e49
movl -0x294(%rbp), %ecx
movl -0x298(%rbp), %r8d
movzbl -0x2a1(%rbp), %edx
movq %rsp, %rax
leaq -0x268(%rbp), %rsi
movq %rsi, 0x10(%rax)
leaq -0x250(%rbp), %rsi
movq %rsi, 0x8(%rax)
leaq -0x238(%rbp), %rsi
movq %rsi, (%rax)
andl $0x1, %edx
leaq -0x190(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
leaq -0x208(%rbp), %r9
callq 0xa050
movb %al, -0x3d9(%rbp)
jmp 0x12ea5
movb -0x3d9(%rbp), %al
testb $0x1, %al
jne 0x12ed8
jmp 0x12eb1
leaq 0x9af99(%rip), %rdi     # 0xade51
xorl %eax, %eax
callq 0x4060
jmp 0x12ec1
movb $0x0, -0x281(%rbp)
testb $0x1, -0x282(%rbp)
jne 0x12ed6
jmp 0x139f4
jmp 0x12ed8
leaq -0x220(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x147b0
jmp 0x12eed
movl -0x29c(%rbp), %eax
orl -0x2a0(%rbp), %eax
cmpl $0x0, %eax
je 0x12fd8
leaq -0x220(%rbp), %rdi
movq %rdi, -0x3f0(%rbp)
callq 0x115b0
movq %rax, -0x2c8(%rbp)
leaq -0x2c0(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
callq 0x14ab0
leaq -0x250(%rbp), %rdi
movq %rdi, -0x3f8(%rbp)
callq 0x11720
movq -0x3f8(%rbp), %rdi
movq %rax, -0x2d0(%rbp)
callq 0x115b0
movq -0x3f0(%rbp), %rdi
movq %rax, -0x2d8(%rbp)
movq -0x2c0(%rbp), %rsi
movq -0x2d0(%rbp), %rdx
movq -0x2d8(%rbp), %rcx
callq 0x14a00
movq %rax, -0x3e8(%rbp)
jmp 0x12f86
movq -0x3e8(%rbp), %rax
movq %rax, -0x2e0(%rbp)
leaq -0x220(%rbp), %rdi
movq %rdi, -0x400(%rbp)
callq 0x11720
movq -0x400(%rbp), %rdi
movq %rax, -0x2e8(%rbp)
callq 0x115b0
movq %rax, -0x2f0(%rbp)
movq -0x2e8(%rbp), %rdi
movq -0x2f0(%rbp), %rsi
callq 0x14af0
jmp 0x12fd6
jmp 0x12fd8
leaq -0x190(%rbp), %rdi
leaq -0x208(%rbp), %rsi
leaq -0x220(%rbp), %rdx
leaq -0xe0(%rbp), %rcx
leaq -0x280(%rbp), %r8
callq 0x17570
movb %al, -0x401(%rbp)
jmp 0x13008
movb -0x401(%rbp), %al
testb $0x1, %al
jne 0x1303b
jmp 0x13014
leaq 0x9af0b(%rip), %rdi     # 0xadf26
xorl %eax, %eax
callq 0x4060
jmp 0x13024
movb $0x0, -0x281(%rbp)
testb $0x1, -0x282(%rbp)
jne 0x13039
jmp 0x139f4
jmp 0x1303b
movq 0xd2f86(%rip), %rdi     # 0xe5fc8
leaq 0x9af31(%rip), %rsi     # 0xadf7a
callq 0x4380
movq %rax, -0x410(%rbp)
jmp 0x13057
leaq -0x208(%rbp), %rdi
callq 0xc360
movq -0x410(%rbp), %rdi
movq %rax, %rsi
shrq %rsi
callq 0x40b0
movq %rax, -0x418(%rbp)
jmp 0x1307e
movq -0x418(%rbp), %rdi
leaq 0x9af08(%rip), %rsi     # 0xadf94
callq 0x4380
movq %rax, -0x420(%rbp)
jmp 0x1309a
leaq -0x190(%rbp), %rdi
callq 0x7ea90
movl %eax, -0x424(%rbp)
jmp 0x130ae
movl -0x424(%rbp), %esi
movq -0x420(%rbp), %rdi
callq 0x4660
movq %rax, -0x430(%rbp)
jmp 0x130c9
movq -0x430(%rbp), %rdi
leaq 0x99f04(%rip), %rsi     # 0xacfdb
callq 0x4380
jmp 0x130de
movq 0xd2ee3(%rip), %rdi     # 0xe5fc8
leaq 0x9aeaf(%rip), %rsi     # 0xadf9b
callq 0x4380
movq %rax, -0x438(%rbp)
jmp 0x130fa
leaq -0x238(%rbp), %rdi
callq 0xc360
movq %rax, -0x448(%rbp)
leaq -0x250(%rbp), %rdi
callq 0xc360
movq -0x448(%rbp), %rsi
movq -0x438(%rbp), %rdi
addq %rax, %rsi
callq 0x40b0
movq %rax, -0x440(%rbp)
jmp 0x13138
movq -0x440(%rbp), %rdi
leaq 0x99300(%rip), %rsi     # 0xac446
callq 0x4380
jmp 0x1314d
movq 0xd2e74(%rip), %rdi     # 0xe5fc8
leaq 0x9ae5a(%rip), %rsi     # 0xadfb5
callq 0x4380
movq %rax, -0x450(%rbp)
jmp 0x13169
leaq -0x280(%rbp), %rdi
callq 0xc360
movq -0x450(%rbp), %rdi
movq %rax, %rsi
callq 0x40b0
movq %rax, -0x458(%rbp)
jmp 0x1318d
movq -0x458(%rbp), %rdi
leaq 0x9adf9(%rip), %rsi     # 0xadf94
callq 0x4380
movq %rax, -0x460(%rbp)
jmp 0x131a9
leaq -0xe0(%rbp), %rdi
callq 0x7ea90
movl %eax, -0x464(%rbp)
jmp 0x131bd
movl -0x464(%rbp), %esi
movq -0x460(%rbp), %rdi
callq 0x4660
movq %rax, -0x470(%rbp)
jmp 0x131d8
movq -0x470(%rbp), %rdi
leaq 0x99df5(%rip), %rsi     # 0xacfdb
callq 0x4380
jmp 0x131ed
movq 0xd2dd4(%rip), %rdi     # 0xe5fc8
leaq 0x9add4(%rip), %rsi     # 0xadfcf
callq 0x4380
movq %rax, -0x478(%rbp)
jmp 0x13209
leaq -0x280(%rbp), %rdi
movq %rdi, -0x490(%rbp)
callq 0x14b30
movq -0x490(%rbp), %rdi
movq %rax, -0x488(%rbp)
callq 0xc360
movq -0x488(%rbp), %rsi
movq %rax, %rdx
leaq -0xe0(%rbp), %rdi
callq 0x7bbc0
movl %eax, -0x47c(%rbp)
jmp 0x1324d
movl -0x47c(%rbp), %esi
movq -0x478(%rbp), %rdi
callq 0x4660
movq %rax, -0x498(%rbp)
jmp 0x13268
movq -0x498(%rbp), %rdi
leaq 0x9ad73(%rip), %rsi     # 0xadfe9
callq 0x4380
movq %rax, -0x4a0(%rbp)
jmp 0x13284
leaq -0x280(%rbp), %rdi
movq %rdi, -0x4b8(%rbp)
callq 0x14b30
movq -0x4b8(%rbp), %rdi
movq %rax, -0x4b0(%rbp)
callq 0xc360
movq -0x4b0(%rbp), %rsi
movq %rax, %rdx
leaq -0xe0(%rbp), %rdi
callq 0x7bc30
movl %eax, -0x4a4(%rbp)
jmp 0x132c8
movl -0x4a4(%rbp), %esi
movq -0x4a0(%rbp), %rdi
callq 0x44e0
movq %rax, -0x4c0(%rbp)
jmp 0x132e3
movq -0x4c0(%rbp), %rdi
leaq 0x9ad00(%rip), %rsi     # 0xadff1
callq 0x4380
jmp 0x132f8
movl -0x29c(%rbp), %eax
orl -0x2a0(%rbp), %eax
cmpl $0x0, %eax
je 0x133d0
xorps %xmm0, %xmm0
movaps %xmm0, -0x310(%rbp)
movq $0x0, -0x300(%rbp)
leaq -0x310(%rbp), %rdi
movq %rdi, -0x4d0(%rbp)
callq 0xbf40
movq -0x4d0(%rbp), %rdx
leaq -0x190(%rbp), %rdi
leaq -0x220(%rbp), %rsi
leaq -0x1a8(%rbp), %rcx
callq 0xa800
movb %al, -0x4c1(%rbp)
jmp 0x1335e
movb -0x4c1(%rbp), %al
xorb $-0x1, %al
movb %al, -0x4d1(%rbp)
leaq -0x310(%rbp), %rdi
callq 0xc010
movb -0x4d1(%rbp), %al
testb $0x1, %al
jne 0x13384
jmp 0x133ce
leaq 0x9ac6f(%rip), %rdi     # 0xadffa
xorl %eax, %eax
callq 0x4060
jmp 0x13394
movb $0x0, -0x281(%rbp)
testb $0x1, -0x282(%rbp)
jne 0x133cc
jmp 0x139f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2b0(%rbp)
movl %eax, -0x2b4(%rbp)
leaq -0x310(%rbp), %rdi
callq 0xc010
jmp 0x13b1b
jmp 0x133ce
jmp 0x1342e
leaq -0x190(%rbp), %rdi
leaq -0x238(%rbp), %rsi
leaq -0x250(%rbp), %rdx
leaq -0x1a8(%rbp), %rcx
callq 0xa800
movb %al, -0x4d2(%rbp)
jmp 0x133f9
movb -0x4d2(%rbp), %al
testb $0x1, %al
jne 0x1342c
jmp 0x13405
leaq 0x9ac46(%rip), %rdi     # 0xae052
xorl %eax, %eax
callq 0x4060
jmp 0x13415
movb $0x0, -0x281(%rbp)
testb $0x1, -0x282(%rbp)
jne 0x1342a
jmp 0x139f4
jmp 0x1342c
jmp 0x1342e
xorps %xmm0, %xmm0
movaps %xmm0, -0x330(%rbp)
movq $0x0, -0x320(%rbp)
leaq -0x330(%rbp), %rdi
movq %rdi, -0x4e0(%rbp)
callq 0xbf40
movq -0x4e0(%rbp), %rdx
leaq -0xe0(%rbp), %rdi
leaq -0x280(%rbp), %rsi
leaq -0x1c0(%rbp), %rcx
callq 0xa800
movb %al, -0x4d3(%rbp)
jmp 0x1347f
movb -0x4d3(%rbp), %al
xorb $-0x1, %al
movb %al, -0x4e1(%rbp)
leaq -0x330(%rbp), %rdi
callq 0xc010
movb -0x4e1(%rbp), %al
testb $0x1, %al
jne 0x134a5
jmp 0x134ef
leaq 0x9abf6(%rip), %rdi     # 0xae0a2
xorl %eax, %eax
callq 0x4060
jmp 0x134b5
movb $0x0, -0x281(%rbp)
testb $0x1, -0x282(%rbp)
jne 0x134ed
jmp 0x139f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2b0(%rbp)
movl %eax, -0x2b4(%rbp)
leaq -0x330(%rbp), %rdi
callq 0xc010
jmp 0x13b1b
jmp 0x134ef
movq -0x20(%rbp), %rcx
movl -0x2c(%rbp), %r8d
movq 0x10(%rbp), %r9
movl 0x20(%rbp), %edx
movq %rsp, %rax
movl %edx, (%rax)
leaq -0x1c0(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
leaq -0x1d8(%rbp), %rdx
callq 0x14130
movb %al, -0x4e2(%rbp)
jmp 0x13525
movb -0x4e2(%rbp), %al
testb $0x1, %al
jne 0x13558
jmp 0x13531
leaq 0x9abb8(%rip), %rdi     # 0xae0f0
xorl %eax, %eax
callq 0x4060
jmp 0x13541
movb $0x0, -0x281(%rbp)
testb $0x1, -0x282(%rbp)
jne 0x13556
jmp 0x139f4
jmp 0x13558
movl -0x29c(%rbp), %eax
orl -0x2a0(%rbp), %eax
cmpl $0x0, %eax
je 0x13630
xorps %xmm0, %xmm0
movaps %xmm0, -0x350(%rbp)
movq $0x0, -0x340(%rbp)
leaq -0x350(%rbp), %rdi
movq %rdi, -0x4f0(%rbp)
callq 0xbf40
movq -0x4f0(%rbp), %rdx
leaq -0x190(%rbp), %rdi
leaq -0x220(%rbp), %rsi
leaq -0x1a8(%rbp), %rcx
callq 0xa800
movb %al, -0x4e3(%rbp)
jmp 0x135be
movb -0x4e3(%rbp), %al
xorb $-0x1, %al
movb %al, -0x4f1(%rbp)
leaq -0x350(%rbp), %rdi
callq 0xc010
movb -0x4f1(%rbp), %al
testb $0x1, %al
jne 0x135e4
jmp 0x1362e
leaq 0x9aa0f(%rip), %rdi     # 0xadffa
xorl %eax, %eax
callq 0x4060
jmp 0x135f4
movb $0x0, -0x281(%rbp)
testb $0x1, -0x282(%rbp)
jne 0x1362c
jmp 0x139f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2b0(%rbp)
movl %eax, -0x2b4(%rbp)
leaq -0x350(%rbp), %rdi
callq 0xc010
jmp 0x13b1b
jmp 0x1362e
jmp 0x1368e
leaq -0x190(%rbp), %rdi
leaq -0x238(%rbp), %rsi
leaq -0x250(%rbp), %rdx
leaq -0x1a8(%rbp), %rcx
callq 0xa800
movb %al, -0x4f2(%rbp)
jmp 0x13659
movb -0x4f2(%rbp), %al
testb $0x1, %al
jne 0x1368c
jmp 0x13665
leaq 0x9a9e6(%rip), %rdi     # 0xae052
xorl %eax, %eax
callq 0x4060
jmp 0x13675
movb $0x0, -0x281(%rbp)
testb $0x1, -0x282(%rbp)
jne 0x1368a
jmp 0x139f4
jmp 0x1368c
jmp 0x1368e
xorps %xmm0, %xmm0
movaps %xmm0, -0x370(%rbp)
movq $0x0, -0x360(%rbp)
leaq -0x370(%rbp), %rdi
movq %rdi, -0x500(%rbp)
callq 0xbf40
movq -0x500(%rbp), %rdx
leaq -0xe0(%rbp), %rdi
leaq -0x280(%rbp), %rsi
leaq -0x1c0(%rbp), %rcx
callq 0xa800
movb %al, -0x4f3(%rbp)
jmp 0x136df
movb -0x4f3(%rbp), %al
xorb $-0x1, %al
movb %al, -0x501(%rbp)
leaq -0x370(%rbp), %rdi
callq 0xc010
movb -0x501(%rbp), %al
testb $0x1, %al
jne 0x13705
jmp 0x1374f
leaq 0x9a996(%rip), %rdi     # 0xae0a2
xorl %eax, %eax
callq 0x4060
jmp 0x13715
movb $0x0, -0x281(%rbp)
testb $0x1, -0x282(%rbp)
jne 0x1374d
jmp 0x139f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2b0(%rbp)
movl %eax, -0x2b4(%rbp)
leaq -0x370(%rbp), %rdi
callq 0xc010
jmp 0x13b1b
jmp 0x1374f
movq -0x28(%rbp), %rcx
movzbl -0x2a2(%rbp), %r8d
andl $0x1, %r8d
leaq -0x1c0(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
leaq -0x1d8(%rbp), %rdx
callq 0x14340
movb %al, -0x502(%rbp)
jmp 0x13781
movb -0x502(%rbp), %al
testb $0x1, %al
jne 0x137b4
jmp 0x1378d
leaq 0x9a9c0(%rip), %rdi     # 0xae154
xorl %eax, %eax
callq 0x4060
jmp 0x1379d
movb $0x0, -0x281(%rbp)
testb $0x1, -0x282(%rbp)
jne 0x137b2
jmp 0x139f4
jmp 0x137b4
leaq -0x388(%rbp), %rdi
movq %rdi, -0x520(%rbp)
callq 0xbe70
movq -0x520(%rbp), %rsi
leaq -0x1c0(%rbp), %rdi
callq 0x14b50
movq -0x520(%rbp), %rdi
callq 0xbb80
leaq -0x3a0(%rbp), %rdi
movq %rdi, -0x518(%rbp)
callq 0xbe70
movq -0x518(%rbp), %rsi
leaq -0x1a8(%rbp), %rdi
callq 0x14b50
movq -0x518(%rbp), %rdi
callq 0xbb80
movq -0x290(%rbp), %rcx
movslq -0x294(%rbp), %r8
movslq -0x298(%rbp), %r9
movslq -0x29c(%rbp), %rdx
movslq -0x2a0(%rbp), %rsi
movq -0x20(%rbp), %rdi
movzbl -0x2a2(%rbp), %eax
andl $0x1, %eax
movl %eax, %r10d
movq %rsp, %rax
movq %rax, -0x510(%rbp)
movq %r10, 0x40(%rax)
movq %rdi, 0x38(%rax)
leaq -0x1d8(%rbp), %rdi
movq %rdi, 0x30(%rax)
leaq -0x280(%rbp), %rdi
movq %rdi, 0x28(%rax)
leaq -0x268(%rbp), %rdi
movq %rdi, 0x20(%rax)
leaq -0x250(%rbp), %rdi
movq %rdi, 0x18(%rax)
leaq -0x208(%rbp), %rdi
movq %rdi, 0x10(%rax)
movq %rsi, 0x8(%rax)
movq %rdx, (%rax)
leaq -0x1f0(%rbp), %rdi
leaq -0x190(%rbp), %rsi
leaq -0xe0(%rbp), %rdx
callq 0xac40
movb %al, -0x503(%rbp)
jmp 0x138be
movb -0x503(%rbp), %al
testb $0x1, %al
jne 0x138f1
jmp 0x138ca
leaq 0x9a8cb(%rip), %rdi     # 0xae19c
xorl %eax, %eax
callq 0x4060
jmp 0x138da
movb $0x0, -0x281(%rbp)
testb $0x1, -0x282(%rbp)
jne 0x138ef
jmp 0x139f4
jmp 0x138f1
movq 0xd26d0(%rip), %rdi     # 0xe5fc8
leaq 0x9a9d2(%rip), %rsi     # 0xae2d1
callq 0x4380
movq %rax, -0x528(%rbp)
jmp 0x1390d
leaq -0x1f0(%rbp), %rdi
callq 0xbe90
movq -0x528(%rbp), %rdi
movq %rax, %rsi
callq 0x40b0
movq %rax, -0x530(%rbp)
jmp 0x13931
movq -0x530(%rbp), %rdi
leaq 0x98b07(%rip), %rsi     # 0xac446
callq 0x4380
jmp 0x13946
movq -0x18(%rbp), %rax
movq %rax, -0x550(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0x540(%rbp)
leaq -0x1f0(%rbp), %rdi
movq %rdi, -0x560(%rbp)
callq 0xbb60
movq -0x560(%rbp), %rdi
movq %rax, -0x548(%rbp)
callq 0xbb60
movq -0x560(%rbp), %rdi
movq %rax, -0x558(%rbp)
callq 0xbe90
movq -0x558(%rbp), %rcx
movq -0x550(%rbp), %rdi
movq -0x548(%rbp), %rdx
movq %rax, %rsi
movq -0x540(%rbp), %rax
addq %rsi, %rcx
xorl %esi, %esi
callq *%rax
movl %eax, -0x534(%rbp)
jmp 0x139c3
movl -0x534(%rbp), %eax
cmpl $0x0, %eax
jne 0x139f2
leaq 0x9a90b(%rip), %rdi     # 0xae2e0
xorl %eax, %eax
callq 0x4060
jmp 0x139de
movb $0x0, -0x281(%rbp)
testb $0x1, -0x282(%rbp)
jne 0x139f0
jmp 0x139f4
jmp 0x139f2
jmp 0x139f4
movb $0x1, -0x282(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x7f390
movb %al, -0x561(%rbp)
jmp 0x13a0f
movb -0x561(%rbp), %al
testb $0x1, %al
jne 0x13a3f
jmp 0x13a1b
leaq 0x99a6a(%rip), %rdi     # 0xad48c
xorl %eax, %eax
callq 0x4060
jmp 0x13a2b
movb $0x0, -0x281(%rbp)
testb $0x1, -0x282(%rbp)
jne 0x13a3d
jmp 0x139f4
jmp 0x13a3f
leaq -0xe0(%rbp), %rdi
callq 0x7f390
movb %al, -0x562(%rbp)
jmp 0x13a53
movb -0x562(%rbp), %al
testb $0x1, %al
jne 0x13a86
jmp 0x13a5f
leaq 0x99a46(%rip), %rdi     # 0xad4ac
xorl %eax, %eax
callq 0x4060
jmp 0x13a6f
movb $0x0, -0x281(%rbp)
testb $0x1, -0x282(%rbp)
jne 0x13a84
jmp 0x139f4
jmp 0x13a86
movb -0x281(%rbp), %al
movb %al, -0x563(%rbp)
leaq -0x280(%rbp), %rdi
callq 0xc010
leaq -0x268(%rbp), %rdi
callq 0xc010
leaq -0x250(%rbp), %rdi
callq 0xc010
leaq -0x238(%rbp), %rdi
callq 0xc010
leaq -0x220(%rbp), %rdi
callq 0xc010
leaq -0x208(%rbp), %rdi
callq 0xc010
leaq -0x1f0(%rbp), %rdi
callq 0xbb80
leaq -0x1d8(%rbp), %rdi
callq 0xbb80
leaq -0x1c0(%rbp), %rdi
callq 0xbb80
leaq -0x1a8(%rbp), %rdi
callq 0xbb80
movb -0x563(%rbp), %al
andb $0x1, %al
addq $0x5b0, %rsp            # imm = 0x5B0
popq %rbp
retq
leaq -0x280(%rbp), %rdi
callq 0xc010
leaq -0x268(%rbp), %rdi
callq 0xc010
leaq -0x250(%rbp), %rdi
callq 0xc010
leaq -0x238(%rbp), %rdi
callq 0xc010
leaq -0x220(%rbp), %rdi
callq 0xc010
leaq -0x208(%rbp), %rdi
callq 0xc010
leaq -0x1f0(%rbp), %rdi
callq 0xbb80
leaq -0x1d8(%rbp), %rdi
callq 0xbb80
leaq -0x1c0(%rbp), %rdi
callq 0xbb80
leaq -0x1a8(%rbp), %rdi
callq 0xbb80
movq -0x2b0(%rbp), %rdi
callq 0x4680
nop