// File: sisong[P]ApkDiffPatch/src/patch/NewStream.cpp
// Function: NewStream_write(hpatch_TStreamOutput const*, unsigned long long, unsigned char const*, unsigned char const*)
static hpatch_BOOL _NewStream_write(const hpatch_TStreamOutput* stream,
                                    const hpatch_StreamPos_t _writeToPos,
                                    const unsigned char* data,const unsigned char* data_end){
    size_t dataSize=(size_t)(data_end-data);
    hpatch_StreamPos_t writeToPos=_writeToPos;
    NewStream* self=(NewStream*)stream->streamImport;
    check(!self->isFinish);
    assert(dataSize>=0);
    assert(writeToPos<=self->_curWriteToPosEnd);
    if (writeToPos+dataSize>self->_curWriteToPosEnd){
        size_t leftLen=(size_t)(self->_curWriteToPosEnd-writeToPos);
        check(_NewStream_write(stream,writeToPos,data,data+leftLen));
        check(_NewStream_write(stream,writeToPos+leftLen,data+leftLen,data_end));
        return hpatch_TRUE;
    }
    
    //write data
    if (self->_curFileIndex<0){//fvce
        memcpy(self->_newZipVCE._cache_fvce+self->_extraEditSize+writeToPos,data,dataSize);
    }else{
        check(self->_curFileIndex<self->_fileCount);
#if (_IS_NEED_VIRTUAL_ZIP)
        if ((self->_vout)&&(self->_vout->virtualStream)){
            hpatch_TStreamOutput* stream=self->_vout->virtualStream;
            hpatch_StreamPos_t wpos=stream->streamSize-(self->_curWriteToPosEnd-writeToPos);
            check(stream->write(stream,wpos,data,data+dataSize));
        }else
#endif
            check(Zipper_file_append_part(self->_out_newZip,data,dataSize));
    }
    
    if (writeToPos+dataSize<self->_curWriteToPosEnd)//write continue
        return hpatch_TRUE;
    
    //write one end
    if (self->_curFileIndex<0){//vce ok
        check(UnZipper_updateVirtualVCE(&self->_newZipVCE,self->_newZipIsDataNormalized,self->_newZipCESize));
        bool newIsStable=self->_newZipVCE._isDataNormalized && UnZipper_isHaveApkV2Sign(&self->_newZipVCE);
        bool oldIsStable=self->_oldZip->_isDataNormalized && UnZipper_isHaveApkV2Sign(self->_oldZip);
        self->_isAlwaysReCompress=newIsStable&(!oldIsStable);
        //if (newIsStable)
            Zipper_by_multi_thread(self->_out_newZip,self->_threadNum);
    }else{
        check(Zipper_file_append_end(self->_out_newZip));
#if (_IS_NEED_VIRTUAL_ZIP)
        if ((self->_vout)&&(self->_vout->virtualStream))
            check(self->_vout->endVirtual(self->_vout));
#endif
    }
    ++self->_curFileIndex;
    
    while (self->_curFileIndex<self->_fileCount) {
        if ((self->_curSamePairIndex<self->_samePairCount)
            &&(self->_curFileIndex==(int)self->_samePairList[self->_curSamePairIndex*2])){
            const uint32_t* pairNewiOldi=self->_samePairList+self->_curSamePairIndex*2;
            check(_copy_same_file(self,pairNewiOldi[0],pairNewiOldi[1]));
            ++self->_curSamePairIndex;
            ++self->_curFileIndex;
        }else if ((0==UnZipper_file_uncompressedSize(&self->_newZipVCE,self->_curFileIndex))
                  &&(!UnZipper_file_isCompressed(&self->_newZipVCE,self->_curFileIndex))){
            _update_compressedSize(self,self->_curFileIndex,0);
#if (_IS_NEED_VIRTUAL_ZIP)
            if (self->_vout){
                TVirtualZip_out_type ty=self->_vout->beginVirtual(self->_vout,&self->_newZipVCE,self->_curFileIndex);
                switch (ty) {
                    case kVirtualZip_out_void: { //ok, do nothing
                        assert(self->_vout->virtualStream==0); } break;
                    case kVirtualZip_out_emptyFile_cast: { //ok, already fileSize==0, do nothing
                        assert(self->_vout->virtualStream==0); } break;
                    case kVirtualZip_out_emptyFile_uncompressed: { //already fileSize==0, need endVirtual
                        assert(self->_vout->virtualStream!=0); } break;
                    default: { check(false); } break; //error, or unknow as error
                }
            }
#endif
            check(Zipper_file_append_begin(self->_out_newZip,&self->_newZipVCE,self->_curFileIndex,false,0,0));
            check(Zipper_file_append_end(self->_out_newZip));
#if (_IS_NEED_VIRTUAL_ZIP)
            if ((self->_vout)&&(self->_vout->virtualStream))
                check(self->_vout->endVirtual(self->_vout));
#endif
            ++self->_curFileIndex;
        }else{//open file for write
            ZipFilePos_t uncompressedSize=UnZipper_file_uncompressedSize(&self->_newZipVCE,self->_curFileIndex);
            ZipFilePos_t compressedSize=uncompressedSize;
            if (UnZipper_file_isCompressed(&self->_newZipVCE,self->_curFileIndex)){
                check(self->_curNewReCompressSizeIndex<self->_newReCompressSizeCount);
                compressedSize=self->_newReCompressSizeList[self->_curNewReCompressSizeIndex];
                ++self->_curNewReCompressSizeIndex;
            }
            _update_compressedSize(self,self->_curFileIndex,compressedSize);
            
            bool isWriteOtherCompressedData=(self->_curNewOtherCompressIndex<self->_newRefOtherCompressedCount)
                    &&((int)self->_newRefOtherCompressedList[self->_curNewOtherCompressIndex]==self->_curFileIndex);
            if (isWriteOtherCompressedData)
                ++self->_curNewOtherCompressIndex;

            bool isVirtualFile0Size=false; // is notInZip virtualFile && uncompressedFizeSize==0 ?
    #if (_IS_NEED_VIRTUAL_ZIP)
            TVirtualZip_out_type ty=kVirtualZip_out_void;
            if (self->_vout){
                ty=self->_vout->beginVirtual(self->_vout,&self->_newZipVCE,self->_curFileIndex);
                switch (ty) {
                    case kVirtualZip_out_void: { //ok, do nothing
                        assert(self->_vout->virtualStream==0); } break;
                    case kVirtualZip_out_emptyFile_cast: { // set fileSize==0
                        assert(self->_vout->virtualStream==0);
                        _update_fileSize(self,self->_curFileIndex,0,0);
                        isVirtualFile0Size=true; } break;
                    case kVirtualZip_out_emptyFile_uncompressed: { //set fileSize==0, need out and endVirtual
                        assert(self->_vout->virtualStream!=0);
                        _update_fileSize(self,self->_curFileIndex,0,0);
                        isVirtualFile0Size=true; } break;
                    default: { check(false); } break; //error, or unknow as error
                }
            }
    #endif
            if (isWriteOtherCompressedData && self->_newOtherCompressIsValid){
                check(Zipper_file_append_beginWith(self->_out_newZip,&self->_newZipVCE,self->_curFileIndex,
                                                   false,isVirtualFile0Size?0:uncompressedSize,isVirtualFile0Size?0:compressedSize,
                                                   self->_newOtherCompressLevel,self->_newOtherCompressMemLevel));
                self->_curWriteToPosEnd+=uncompressedSize;
            }else{
    #if (_IS_NEED_VIRTUAL_ZIP)
                if (ty==kVirtualZip_out_emptyFile_uncompressed){
                    check(!isWriteOtherCompressedData); //now unsupport auto decompress data
                }
    #endif
                check(Zipper_file_append_begin(self->_out_newZip,&self->_newZipVCE,self->_curFileIndex,
                                            isWriteOtherCompressedData,
                                            isVirtualFile0Size?0:uncompressedSize,isVirtualFile0Size?0:compressedSize));
                self->_curWriteToPosEnd+=isWriteOtherCompressedData?compressedSize:uncompressedSize;
            }

            if ((!isVirtualFile0Size)&&(uncompressedSize==0)){ // compressed && empty file 
                check(Zipper_file_append_part(self->_out_newZip,0,0));
                check(Zipper_file_append_end(self->_out_newZip));
                ++self->_curFileIndex;
            }else{
                return hpatch_TRUE; //opened a file wait for write;
            }
        }
    }
    
    //file entry end
    check(_file_entry_end(self));
    return hpatch_TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
testb $0x1, 0x8(%rax)
je 0xa27b4
leaq 0x1c62d(%rip), %rdi     # 0xbedbb
movb $0x0, %al
callq 0x4060
leaq 0xaad4(%rip), %rdi      # 0xad270
leaq 0x1c41d(%rip), %rsi     # 0xbebc0
movl $0x3e, %edx
leaq 0x1c624(%rip), %rcx     # 0xbedd3
callq 0x4270
cmpq $0x0, -0x30(%rbp)
jb 0xa27bd
jmp 0xa27dc
leaq 0x1c692(%rip), %rdi     # 0xbee56
leaq 0x1c3f5(%rip), %rsi     # 0xbebc0
movl $0x3f, %edx
leaq 0x1c5fc(%rip), %rcx     # 0xbedd3
callq 0x4270
movq -0x38(%rbp), %rax
movq -0x40(%rbp), %rcx
cmpq 0xa8(%rcx), %rax
ja 0xa27ef
jmp 0xa280e
leaq 0x1c66c(%rip), %rdi     # 0xbee62
leaq 0x1c3c3(%rip), %rsi     # 0xbebc0
movl $0x40, %edx
leaq 0x1c5ca(%rip), %rcx     # 0xbedd3
callq 0x4270
movq -0x38(%rbp), %rax
addq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
cmpq 0xa8(%rcx), %rax
jbe 0xa28e0
movq -0x40(%rbp), %rax
movq 0xa8(%rax), %rax
subq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x20(%rbp), %rcx
addq -0x48(%rbp), %rcx
callq 0xa2740
cmpl $0x0, %eax
jne 0xa2885
leaq 0x1c627(%rip), %rdi     # 0xbee86
movb $0x0, %al
callq 0x4060
leaq 0xaa03(%rip), %rdi      # 0xad270
leaq 0x1c34c(%rip), %rsi     # 0xbebc0
movl $0x43, %edx
leaq 0x1c553(%rip), %rcx     # 0xbedd3
callq 0x4270
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
addq -0x48(%rbp), %rsi
movq -0x20(%rbp), %rdx
addq -0x48(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0xa2740
cmpl $0x0, %eax
jne 0xa28d4
leaq 0x1c616(%rip), %rdi     # 0xbeec4
movb $0x0, %al
callq 0x4060
leaq 0xa9b4(%rip), %rdi      # 0xad270
leaq 0x1c2fd(%rip), %rsi     # 0xbebc0
movl $0x44, %edx
leaq 0x1c504(%rip), %rcx     # 0xbedd3
callq 0x4270
movl $0x1, -0x4(%rbp)
jmp 0xa316e
movq -0x40(%rbp), %rax
cmpl $0x0, 0xa4(%rax)
jge 0xa2919
movq -0x40(%rbp), %rax
movq 0x170(%rax), %rdi
movq -0x40(%rbp), %rax
addq 0x98(%rax), %rdi
addq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x4320
jmp 0xa29a4
movq -0x40(%rbp), %rax
movl 0xa4(%rax), %eax
movq -0x40(%rbp), %rcx
cmpl 0x90(%rcx), %eax
jl 0xa295c
leaq 0x1c5d8(%rip), %rdi     # 0xbef0e
movb $0x0, %al
callq 0x4060
leaq 0xa92c(%rip), %rdi      # 0xad270
leaq 0x1c275(%rip), %rsi     # 0xbebc0
movl $0x4c, %edx
leaq 0x1c47c(%rip), %rcx     # 0xbedd3
callq 0x4270
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x83790
testb $0x1, %al
jne 0xa29a2
leaq 0x1c5bf(%rip), %rdi     # 0xbef3b
movb $0x0, %al
callq 0x4060
leaq 0xa8e6(%rip), %rdi      # 0xad270
leaq 0x1c22f(%rip), %rsi     # 0xbebc0
movl $0x54, %edx
leaq 0x1c436(%rip), %rcx     # 0xbedd3
callq 0x4270
jmp 0xa29a4
movq -0x38(%rbp), %rax
addq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
cmpq 0xa8(%rcx), %rax
jae 0xa29c5
movl $0x1, -0x4(%rbp)
jmp 0xa316e
movq -0x40(%rbp), %rax
cmpl $0x0, 0xa4(%rax)
jge 0xa2ac8
movq -0x40(%rbp), %rdi
addq $0xd0, %rdi
movq -0x40(%rbp), %rax
movb 0x20(%rax), %al
movq -0x40(%rbp), %rcx
movq 0x28(%rcx), %rdx
andb $0x1, %al
movzbl %al, %esi
callq 0x802e0
testb $0x1, %al
jne 0xa2a2b
leaq 0x1c577(%rip), %rdi     # 0xbef7c
movb $0x0, %al
callq 0x4060
leaq 0xa85d(%rip), %rdi      # 0xad270
leaq 0x1c1a6(%rip), %rsi     # 0xbebc0
movl $0x5c, %edx
leaq 0x1c3ad(%rip), %rcx     # 0xbedd3
callq 0x4270
movq -0x40(%rbp), %rcx
xorl %eax, %eax
testb $0x1, 0x159(%rcx)
movb %al, -0x63(%rbp)
je 0xa2a50
movq -0x40(%rbp), %rdi
addq $0xd0, %rdi
callq 0xa3180
movb %al, -0x63(%rbp)
movb -0x63(%rbp), %al
andb $0x1, %al
movb %al, -0x49(%rbp)
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rcx
xorl %eax, %eax
testb $0x1, 0x89(%rcx)
movb %al, -0x64(%rbp)
je 0xa2a7e
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xa3180
movb %al, -0x64(%rbp)
movb -0x64(%rbp), %al
andb $0x1, %al
movb %al, -0x4a(%rbp)
movb -0x49(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movb -0x4a(%rbp), %cl
xorb $-0x1, %cl
andb $0x1, %cl
movzbl %cl, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
setne %cl
movq -0x40(%rbp), %rax
andb $0x1, %cl
movb %cl, 0xc8(%rax)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x40(%rbp), %rax
movl 0xa0(%rax), %esi
callq 0x81370
jmp 0xa2b08
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x83280
testb $0x1, %al
jne 0xa2b06
leaq 0x1c503(%rip), %rdi     # 0xbefe3
movb $0x0, %al
callq 0x4060
leaq 0xa782(%rip), %rdi      # 0xad270
leaq 0x1c0cb(%rip), %rsi     # 0xbebc0
movl $0x63, %edx
leaq 0x1c2d2(%rip), %rcx     # 0xbedd3
callq 0x4270
jmp 0xa2b08
movq -0x40(%rbp), %rax
movl 0xa4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xa4(%rax)
movq -0x40(%rbp), %rax
movl 0xa4(%rax), %eax
movq -0x40(%rbp), %rcx
cmpl 0x90(%rcx), %eax
jge 0xa312d
movq -0x40(%rbp), %rax
movq 0xb0(%rax), %rax
movq -0x40(%rbp), %rcx
cmpq 0x38(%rcx), %rax
jae 0xa2c0d
movq -0x40(%rbp), %rax
movl 0xa4(%rax), %eax
movq -0x40(%rbp), %rcx
movq 0x30(%rcx), %rcx
movq -0x40(%rbp), %rdx
movq 0xb0(%rdx), %rdx
shlq %rdx
cmpl (%rcx,%rdx,4), %eax
jne 0xa2c0d
movq -0x40(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x40(%rbp), %rcx
movq 0xb0(%rcx), %rcx
shlq %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rdi
movq -0x58(%rbp), %rax
movl (%rax), %esi
movq -0x58(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xa31b0
testb $0x1, %al
jne 0xa2bdf
leaq 0x1c45c(%rip), %rdi     # 0xbf015
movb $0x0, %al
callq 0x4060
leaq 0xa6a9(%rip), %rdi      # 0xad270
leaq 0x1bff2(%rip), %rsi     # 0xbebc0
movl $0x6f, %edx
leaq 0x1c1f9(%rip), %rcx     # 0xbedd3
callq 0x4270
movq -0x40(%rbp), %rax
movq 0xb0(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0xb0(%rax)
movq -0x40(%rbp), %rax
movl 0xa4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xa4(%rax)
jmp 0xa3128
movq -0x40(%rbp), %rdi
addq $0xd0, %rdi
movq -0x40(%rbp), %rax
movl 0xa4(%rax), %esi
callq 0x80480
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0xa2d1d
movq -0x40(%rbp), %rdi
addq $0xd0, %rdi
movq -0x40(%rbp), %rax
movl 0xa4(%rax), %esi
callq 0x7f2e0
testb $0x1, %al
jne 0xa2d1d
movq -0x40(%rbp), %rdi
movq -0x40(%rbp), %rax
movl 0xa4(%rax), %esi
xorl %edx, %edx
callq 0xa3510
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x40(%rbp), %rsi
addq $0xd0, %rsi
movq -0x40(%rbp), %rax
movl 0xa4(%rax), %edx
xorl %ecx, %ecx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
callq 0x82320
testb $0x1, %al
jne 0xa2cc7
leaq 0x1c3b2(%rip), %rdi     # 0xbf053
movb $0x0, %al
callq 0x4060
leaq 0xa5c1(%rip), %rdi      # 0xad270
leaq 0x1bf0a(%rip), %rsi     # 0xbebc0
movl $0x83, %edx
leaq 0x1c111(%rip), %rcx     # 0xbedd3
callq 0x4270
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x83280
testb $0x1, %al
jne 0xa2d05
leaq 0x1c304(%rip), %rdi     # 0xbefe3
movb $0x0, %al
callq 0x4060
leaq 0xa583(%rip), %rdi      # 0xad270
leaq 0x1becc(%rip), %rsi     # 0xbebc0
movl $0x84, %edx
leaq 0x1c0d3(%rip), %rcx     # 0xbedd3
callq 0x4270
movq -0x40(%rbp), %rax
movl 0xa4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xa4(%rax)
jmp 0xa3126
movq -0x40(%rbp), %rdi
addq $0xd0, %rdi
movq -0x40(%rbp), %rax
movl 0xa4(%rax), %esi
callq 0x80480
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movl %eax, -0x60(%rbp)
movq -0x40(%rbp), %rdi
addq $0xd0, %rdi
movq -0x40(%rbp), %rax
movl 0xa4(%rax), %esi
callq 0x7f2e0
testb $0x1, %al
jne 0xa2d60
jmp 0xa2dd1
movq -0x40(%rbp), %rax
movq 0xc0(%rax), %rax
movq -0x40(%rbp), %rcx
cmpq 0x68(%rcx), %rax
jb 0xa2da2
leaq 0x1c33b(%rip), %rdi     # 0xbf0b7
movb $0x0, %al
callq 0x4060
leaq 0xa4e6(%rip), %rdi      # 0xad270
leaq 0x1be2f(%rip), %rsi     # 0xbebc0
movl $0x8e, %edx
leaq 0x1c036(%rip), %rcx     # 0xbedd3
callq 0x4270
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x40(%rbp), %rcx
movq 0xc0(%rcx), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x60(%rbp)
movq -0x40(%rbp), %rax
movq 0xc0(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0xc0(%rax)
movq -0x40(%rbp), %rdi
movq -0x40(%rbp), %rax
movl 0xa4(%rax), %esi
movl -0x60(%rbp), %edx
callq 0xa3510
movq -0x40(%rbp), %rax
movq 0xb8(%rax), %rcx
movq -0x40(%rbp), %rdx
xorl %eax, %eax
cmpq 0x48(%rdx), %rcx
movb %al, -0x65(%rbp)
jae 0xa2e27
movq -0x40(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x40(%rbp), %rcx
movq 0xb8(%rcx), %rcx
movl (%rax,%rcx,4), %eax
movq -0x40(%rbp), %rcx
cmpl 0xa4(%rcx), %eax
sete %al
movb %al, -0x65(%rbp)
movb -0x65(%rbp), %al
andb $0x1, %al
movb %al, -0x61(%rbp)
testb $0x1, -0x61(%rbp)
je 0xa2e4b
movq -0x40(%rbp), %rax
movq 0xb8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0xb8(%rax)
movb $0x0, -0x62(%rbp)
testb $0x1, -0x61(%rbp)
je 0xa2f57
movq -0x40(%rbp), %rax
testb $0x1, 0x50(%rax)
je 0xa2f57
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x40(%rbp), %rax
addq $0xd0, %rax
movq %rax, -0x78(%rbp)
movq -0x40(%rbp), %rax
movl 0xa4(%rax), %eax
movl %eax, -0x6c(%rbp)
testb $0x1, -0x62(%rbp)
je 0xa2e9e
xorl %eax, %eax
movl %eax, -0x84(%rbp)
jmp 0xa2ea7
movl -0x5c(%rbp), %eax
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %eax
movl %eax, %eax
movq %rax, -0x90(%rbp)
testb $0x1, -0x62(%rbp)
je 0xa2ec6
xorl %eax, %eax
movl %eax, -0x94(%rbp)
jmp 0xa2ecf
movl -0x60(%rbp), %eax
movl %eax, -0x94(%rbp)
movq -0x90(%rbp), %r8
movl -0x6c(%rbp), %edx
movq -0x78(%rbp), %rsi
movq -0x80(%rbp), %rdi
movl -0x94(%rbp), %eax
movl %eax, %eax
movl %eax, %r9d
movq -0x40(%rbp), %rax
movl 0x54(%rax), %r10d
movq -0x40(%rbp), %rax
movl 0x58(%rax), %eax
xorl %ecx, %ecx
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x82390
testb $0x1, %al
jne 0xa2f3b
leaq 0x1c1e9(%rip), %rdi     # 0xbf0fe
movb $0x0, %al
callq 0x4060
leaq 0xa34d(%rip), %rdi      # 0xad270
leaq 0x1bc96(%rip), %rsi     # 0xbebc0
movl $0xb0, %edx
leaq 0x1be9d(%rip), %rcx     # 0xbedd3
callq 0x4270
movl -0x5c(%rbp), %eax
movl %eax, %ecx
movq -0x40(%rbp), %rax
addq 0xa8(%rax), %rcx
movq %rcx, 0xa8(%rax)
jmp 0xa306f
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xb0(%rbp)
movq -0x40(%rbp), %rax
addq $0xd0, %rax
movq %rax, -0xa8(%rbp)
movq -0x40(%rbp), %rax
movl 0xa4(%rax), %eax
movl %eax, -0x9c(%rbp)
movb -0x61(%rbp), %al
movb %al, -0x95(%rbp)
testb $0x1, -0x62(%rbp)
je 0xa2fa0
xorl %eax, %eax
movl %eax, -0xb4(%rbp)
jmp 0xa2fa9
movl -0x5c(%rbp), %eax
movl %eax, -0xb4(%rbp)
movl -0xb4(%rbp), %eax
movl %eax, %eax
movq %rax, -0xc0(%rbp)
testb $0x1, -0x62(%rbp)
je 0xa2fc8
xorl %eax, %eax
movl %eax, -0xc4(%rbp)
jmp 0xa2fd1
movl -0x60(%rbp), %eax
movl %eax, -0xc4(%rbp)
movq -0xc0(%rbp), %r8
movl -0x9c(%rbp), %edx
movq -0xa8(%rbp), %rsi
movq -0xb0(%rbp), %rdi
movb -0x95(%rbp), %al
movl -0xc4(%rbp), %ecx
movl %ecx, %ecx
movl %ecx, %r9d
movzbl %al, %ecx
andl $0x1, %ecx
callq 0x82320
testb $0x1, %al
jne 0xa3039
leaq 0x1c1d8(%rip), %rdi     # 0xbf1eb
movb $0x0, %al
callq 0x4060
leaq 0xa24f(%rip), %rdi      # 0xad270
leaq 0x1bb98(%rip), %rsi     # 0xbebc0
movl $0xba, %edx
leaq 0x1bd9f(%rip), %rcx     # 0xbedd3
callq 0x4270
testb $0x1, -0x61(%rbp)
je 0xa304a
movl -0x60(%rbp), %eax
movl %eax, -0xc8(%rbp)
jmp 0xa3053
movl -0x5c(%rbp), %eax
movl %eax, -0xc8(%rbp)
movl -0xc8(%rbp), %eax
movl %eax, %eax
movl %eax, %ecx
movq -0x40(%rbp), %rax
addq 0xa8(%rax), %rcx
movq %rcx, 0xa8(%rax)
testb $0x1, -0x62(%rbp)
jne 0xa311b
cmpl $0x0, -0x5c(%rbp)
jne 0xa311b
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rdi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x83790
testb $0x1, %al
jne 0xa30c8
leaq 0x1c20a(%rip), %rdi     # 0xbf2ac
movb $0x0, %al
callq 0x4060
leaq 0xa1c0(%rip), %rdi      # 0xad270
leaq 0x1bb09(%rip), %rsi     # 0xbebc0
movl $0xbf, %edx
leaq 0x1bd10(%rip), %rcx     # 0xbedd3
callq 0x4270
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x83280
testb $0x1, %al
jne 0xa3106
leaq 0x1bf03(%rip), %rdi     # 0xbefe3
movb $0x0, %al
callq 0x4060
leaq 0xa182(%rip), %rdi      # 0xad270
leaq 0x1bacb(%rip), %rsi     # 0xbebc0
movl $0xc0, %edx
leaq 0x1bcd2(%rip), %rcx     # 0xbedd3
callq 0x4270
movq -0x40(%rbp), %rax
movl 0xa4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xa4(%rax)
jmp 0xa3124
movl $0x1, -0x4(%rbp)
jmp 0xa316e
jmp 0xa3126
jmp 0xa3128
jmp 0xa2b1b
movq -0x40(%rbp), %rdi
callq 0xa3540
testb $0x1, %al
jne 0xa3167
leaq 0x1c1a2(%rip), %rdi     # 0xbf2e3
movb $0x0, %al
callq 0x4060
leaq 0xa121(%rip), %rdi      # 0xad270
leaq 0x1ba6a(%rip), %rsi     # 0xbebc0
movl $0xc9, %edx
leaq 0x1bc71(%rip), %rcx     # 0xbedd3
callq 0x4270
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xe0, %rsp
popq %rbp
retq
nopw (%rax,%rax)