// File: sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: write_fileHeaderInfo(Zipper*, int, UnZipper*, int, bool)
static bool _write_fileHeaderInfo(Zipper* self,int fileIndex,UnZipper* srcZip,int srcFileIndex,bool isFullInfo){
    const TByte* const headBuf=fileHeaderBuf(srcZip,srcFileIndex);
    bool isCompressed=UnZipper_file_isCompressed(srcZip,srcFileIndex);
    ZipFilePos_t compressedSize=self->_fileCompressedSizes[fileIndex];
    if (self->_isUpdateIsCompress){
        self->_isUpdateIsCompress=false;
        if (isCompressed!=self->_newIsCompress){
            isCompressed=self->_newIsCompress;
            if (!self->_newIsCompress)
                compressedSize=UnZipper_file_uncompressedSize(srcZip,srcFileIndex);
        }
    }
    const uint16_t fileNameLen=UnZipper_file_nameLen(srcZip,srcFileIndex);
    const TByte* const fileNameBuf=headBuf+46;
    const TByte* extraFieldBuf=fileNameBuf+fileNameLen;
    const uint16_t extraFieldLen=_file_extraFieldLen(srcZip,srcFileIndex);
    uint16_t extraFieldBufLen=extraFieldLen;
    if (self->_pageAlignState==kPageAlign_inNormalize){
        extraFieldBufLen=_extraFieldNormalize(self->_normalizeExtraFieldBuf,extraFieldBuf,extraFieldLen);
        extraFieldBuf=self->_normalizeExtraFieldBuf;
    }
    uint16_t extraFieldLen_for_align=extraFieldBufLen;
    const bool isNeedAlign=(!isFullInfo)&&(!isCompressed); //dir or 0 size file need align too, same AndroidSDK#zipalign
    size_t curAlignSize=self->_ZipAlignSize;
    bool   curPageAlignCompatible=(self->_pageAlignCompatible)&&(self->_pageAlignState==kPageAlign_inNormalize);
    bool   isOldPatchSo=false;    
    if (isNeedAlign){
        const size_t headInfoLen=30+fileNameLen;
        const int skipLen_base=_getAlignSkipLen(self->_curFilePos+headInfoLen+extraFieldLen_for_align,curAlignSize);
        int skipLen=skipLen_base;
        if ((self->_pageAlignState==kPageAlign_inPatch)&& //only in patch compatible with old(<1.8.0) page-align
              ((self->_normalizeSoPageAlign!=curAlignSize)&&(self->_normalizeSoPageAlign==kSoSmallPageAlignSize)
              &&(self->_pageAlignCompatible)&&_file_getIsSoFileName(srcZip,srcFileIndex))){
            bool _isOldSmallPageAlign=_file_getIsPageAlignSoFile(srcZip,srcFileIndex);
            if (_isOldSmallPageAlign){// got patch for old page-align
                curAlignSize=kSoSmallPageAlignSize;
                isOldPatchSo=true;
            }
        }else if ((self->_normalizeSoPageAlign)&&
             (self->_normalizeSoPageAlign!=curAlignSize)&&_file_getIsSoFileName(srcZip,srcFileIndex)){
            if (0!=(self->_normalizeSoPageAlign%curAlignSize)){//error
                LOG_ERR("ERROR: Normalize unsupport this AlignSize %d\n",(int)curAlignSize);
                return false;
            }
            curAlignSize=self->_normalizeSoPageAlign;
        }
        if (curAlignSize!=self->_ZipAlignSize){//update skipLen
            int skipSoLen=_getAlignSkipLen(self->_curFilePos+headInfoLen+extraFieldLen_for_align,curAlignSize);
            if (skipSoLen!=skipLen){
                skipLen=skipSoLen;
                ++self->_normalizeSoPageAlignCount;
            }
        }
        
        if (skipLen!=0){
            if (fileNameLen+1>hpatch_kPathMaxSize) return false;
            // 第一个entry只能扩展其extraField来对齐;
            if ( (fileIndex==0) || ((!isOldPatchSo)&&curPageAlignCompatible&&(skipLen!=skipLen_base)) ){
                assert(0<=(int)extraFieldLen_for_align+skipLen);
                check(kMaxExtraFieldLen>=(int)extraFieldLen_for_align+skipLen);
                extraFieldLen_for_align+=skipLen;
                if ((extraFieldLen_for_align!=extraFieldLen)&&(self->_pageAlignState==kPageAlign_inNormalize)){// print WARNING 
                    const int changedLen=extraFieldLen_for_align-extraFieldLen;
                    char fileName[hpatch_kPathMaxSize];
                    if (fileNameLen+1>hpatch_kPathMaxSize) return false;
                    memcpy(fileName,UnZipper_file_nameBegin(srcZip,srcFileIndex),fileNameLen);
                    fileName[fileNameLen]='\0';
                    printf("WARNING: \""); hpatch_printPath_utf8(fileName);
                    if (changedLen>=0)
                        printf("\" file's extraField adding %d bytes 0 for align!\n",changedLen);
                    else
                        printf("\" file's extraField deleted %d bytes 0 for align!\n",-changedLen);
                }
            }else{
                check(_writeAlignSkip(self,skipLen));//利用entry之间的空间对齐;
            }
        }
    }
    if (!isFullInfo){
        self->_fileEntryOffsets[fileIndex]=self->_curFilePos;
        if (self->_normalizeExtraFieldLens)
            self->_normalizeExtraFieldLens[fileIndex]=self->_pageAlignCompatible?extraFieldLen_for_align:extraFieldBufLen;
    }else{
        if (self->_normalizeExtraFieldLens)
            extraFieldLen_for_align=self->_normalizeExtraFieldLens[fileIndex];
    }

    check(_writeUInt32(self,isFullInfo?kCENTRALHEADERMAGIC:kLOCALHEADERMAGIC));
    if (isFullInfo)
        check(_write(self,headBuf+4,2));//创建时版本;
    check(_write(self,headBuf+6,4));//解开时需要的版本+标志;//其中 标志 中已经去掉了data descriptor标识;
    check(_writeUInt16(self,isCompressed?Z_DEFLATED:0));//压缩方法;
    check(_write(self,headBuf+12,4));//文件的最后修改时间+文件最后修改日期;
    if (self->_isUpdateCrc32){
        self->_isUpdateCrc32=false;
        check(_writeUInt32(self,self->_newCrc32));//更新CRC-32校验;
    }else{
        check(_write(self,headBuf+16,4));//CRC-32校验;
    }
    check(_writeUInt32(self,compressedSize));//压缩后大小;
    check(_write(self,headBuf+24,30-24));//压缩前大小--文件名称长度;
    check(_writeUInt16(self,extraFieldLen_for_align));//扩展字段长度;
    
    uint16_t fileCommentLen=0;//文件注释长度;
    if (isFullInfo){
        fileCommentLen=readUInt16(headBuf+32);
        check(_writeUInt16(self,fileCommentLen));
        check(_write(self,headBuf+34,42-34));//文件开始的分卷号--文件外部属性;
        check(_writeUInt32(self,self->_fileEntryOffsets[fileIndex]));//对应文件在文件中的偏移;
    }
    check(_write(self,fileNameBuf,fileNameLen));//文件名称
    check(_write(self,extraFieldBuf,
                ((extraFieldBufLen<extraFieldLen_for_align)?extraFieldBufLen:extraFieldLen_for_align)));//扩展字段;
    if (extraFieldLen_for_align>extraFieldBufLen) //对齐;
        check(_writeAlignSkip(self,extraFieldLen_for_align-extraFieldBufLen));
    
    if (fileCommentLen>0)
        check(_write(self,fileNameBuf+fileNameLen+extraFieldLen,fileCommentLen));//[+文件注释];
    if (isNeedAlign)
        assert_align(self->_curFilePos,curAlignSize);//对齐检查;
    return  true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10c0, %rsp           # imm = 0x10C0
movb %r8b, %al
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
andb $0x1, %al
movb %al, -0x25(%rbp)
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x7eb20
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x7f2e0
andb $0x1, %al
movb %al, -0x31(%rbp)
movq -0x10(%rbp), %rax
movq 0xb0(%rax), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rax
testb $0x1, 0x150(%rax)
je 0x828aa
movq -0x10(%rbp), %rax
movb $0x0, 0x150(%rax)
movb -0x31(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movq -0x10(%rbp), %rcx
movb 0x151(%rcx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
je 0x828a8
movq -0x10(%rbp), %rax
movb 0x151(%rax), %al
andb $0x1, %al
movb %al, -0x31(%rbp)
movq -0x10(%rbp), %rax
testb $0x1, 0x151(%rax)
jne 0x828a6
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x80480
movl %eax, -0x38(%rbp)
jmp 0x828a8
jmp 0x828aa
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x7eae0
movw %ax, -0x3a(%rbp)
movq -0x30(%rbp), %rax
addq $0x2e, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movzwl -0x3a(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x81a60
movw %ax, -0x52(%rbp)
movw -0x52(%rbp), %ax
movw %ax, -0x54(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x90(%rax)
jne 0x82928
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rdi
movq -0x50(%rbp), %rsi
movzwl -0x52(%rbp), %edx
callq 0x85210
movw %ax, -0x54(%rbp)
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rax
movq %rax, -0x50(%rbp)
movw -0x54(%rbp), %ax
movw %ax, -0x56(%rbp)
xorl %eax, %eax
testb $0x1, -0x25(%rbp)
movb %al, -0x1093(%rbp)
jne 0x82949
movb -0x31(%rbp), %al
xorb $-0x1, %al
movb %al, -0x1093(%rbp)
movb -0x1093(%rbp), %al
andb $0x1, %al
movb %al, -0x57(%rbp)
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rcx
xorl %eax, %eax
testb $0x1, 0x88(%rcx)
movb %al, -0x1094(%rbp)
je 0x82989
movq -0x10(%rbp), %rax
cmpl $0x1, 0x90(%rax)
sete %al
movb %al, -0x1094(%rbp)
movb -0x1094(%rbp), %al
andb $0x1, %al
movb %al, -0x61(%rbp)
movb $0x0, -0x62(%rbp)
testb $0x1, -0x57(%rbp)
je 0x82cc7
movzwl -0x3a(%rbp), %eax
addl $0x1e, %eax
cltq
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rax
movl 0x58(%rax), %eax
movl %eax, %edi
addq -0x70(%rbp), %rdi
movzwl -0x56(%rbp), %eax
addq %rax, %rdi
movq -0x60(%rbp), %rsi
callq 0x81aa0
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %eax
movl %eax, -0x78(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x90(%rax)
jne 0x82a42
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rax
cmpq -0x60(%rbp), %rax
je 0x82a42
movq -0x10(%rbp), %rax
cmpq $0x1000, 0x70(%rax)     # imm = 0x1000
jne 0x82a42
movq -0x10(%rbp), %rax
testb $0x1, 0x88(%rax)
je 0x82a42
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x81a30
testb $0x1, %al
jne 0x82a1d
jmp 0x82a42
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x85300
andb $0x1, %al
movb %al, -0x79(%rbp)
testb $0x1, -0x79(%rbp)
je 0x82a40
movq $0x1000, -0x60(%rbp)    # imm = 0x1000
movb $0x1, -0x62(%rbp)
jmp 0x82ab9
movq -0x10(%rbp), %rax
cmpq $0x0, 0x70(%rax)
je 0x82ab7
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rax
cmpq -0x60(%rbp), %rax
je 0x82ab7
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x81a30
testb $0x1, %al
jne 0x82a6d
jmp 0x82ab7
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x60(%rbp)
xorl %eax, %eax
cmpq %rdx, %rax
je 0x82aab
movq 0x63545(%rip), %rax     # 0xe5fd0
movq (%rax), %rdi
movq -0x60(%rbp), %rax
movl %eax, %edx
leaq 0x31c7b(%rip), %rsi     # 0xb4716
movb $0x0, %al
callq 0x4520
movb $0x0, -0x1(%rbp)
jmp 0x8320b
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0x82ab9
movq -0x60(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x68(%rcx), %rax
je 0x82b0a
movq -0x10(%rbp), %rax
movl 0x58(%rax), %eax
movl %eax, %edi
addq -0x70(%rbp), %rdi
movzwl -0x56(%rbp), %eax
addq %rax, %rdi
movq -0x60(%rbp), %rsi
callq 0x81aa0
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x78(%rbp), %eax
je 0x82b08
movl -0x80(%rbp), %eax
movl %eax, -0x78(%rbp)
movq -0x10(%rbp), %rax
movl 0x8c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8c(%rax)
jmp 0x82b0a
cmpl $0x0, -0x78(%rbp)
je 0x82cc5
movzwl -0x3a(%rbp), %eax
addl $0x1, %eax
cmpl $0x1000, %eax           # imm = 0x1000
jle 0x82b2b
movb $0x0, -0x1(%rbp)
jmp 0x8320b
cmpl $0x0, -0x14(%rbp)
je 0x82b51
testb $0x1, -0x62(%rbp)
jne 0x82c91
testb $0x1, -0x61(%rbp)
je 0x82c91
movl -0x78(%rbp), %eax
cmpl -0x74(%rbp), %eax
je 0x82c91
movzwl -0x56(%rbp), %ecx
addl -0x78(%rbp), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jg 0x82b60
jmp 0x82b7f
leaq 0x31bdd(%rip), %rdi     # 0xb4744
leaq 0x30e1c(%rip), %rsi     # 0xb398a
movl $0x47e, %edx            # imm = 0x47E
leaq 0x31bf2(%rip), %rcx     # 0xb476c
callq 0x4270
movzwl -0x56(%rbp), %ecx
addl -0x78(%rbp), %ecx
movl $0xffff, %eax           # imm = 0xFFFF
cmpl %ecx, %eax
jge 0x82bae
leaq 0x2a6da(%rip), %rdi     # 0xad270
leaq 0x30ded(%rip), %rsi     # 0xb398a
movl $0x47f, %edx            # imm = 0x47F
leaq 0x31bc3(%rip), %rcx     # 0xb476c
callq 0x4270
movl -0x78(%rbp), %ecx
movzwl -0x56(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x56(%rbp)
movzwl -0x56(%rbp), %eax
movzwl -0x52(%rbp), %ecx
cmpl %ecx, %eax
je 0x82c8f
movq -0x10(%rbp), %rax
cmpl $0x1, 0x90(%rax)
jne 0x82c8f
movzwl -0x56(%rbp), %eax
movzwl -0x52(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x84(%rbp)
movzwl -0x3a(%rbp), %eax
addl $0x1, %eax
cmpl $0x1000, %eax           # imm = 0x1000
jle 0x82c03
movb $0x0, -0x1(%rbp)
jmp 0x8320b
leaq -0x1090(%rbp), %rax
movq %rax, -0x10a0(%rbp)
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x7eb50
movq -0x10a0(%rbp), %rdi
movq %rax, %rsi
movzwl -0x3a(%rbp), %eax
movl %eax, %edx
callq 0x4320
movzwl -0x3a(%rbp), %eax
movb $0x0, -0x1090(%rbp,%rax)
leaq 0x31b68(%rip), %rdi     # 0xb47ad
movb $0x0, %al
callq 0x4060
leaq -0x1090(%rbp), %rdi
callq 0x8cf20
cmpl $0x0, -0x84(%rbp)
jl 0x82c77
movl -0x84(%rbp), %esi
leaq 0x31b4a(%rip), %rdi     # 0xb47b8
movb $0x0, %al
callq 0x4060
jmp 0x82c8d
xorl %esi, %esi
subl -0x84(%rbp), %esi
leaq 0x31b64(%rip), %rdi     # 0xb47ea
movb $0x0, %al
callq 0x4060
jmp 0x82c8f
jmp 0x82cc3
movq -0x10(%rbp), %rdi
movslq -0x78(%rbp), %rsi
callq 0x85340
testb $0x1, %al
jne 0x82cc1
leaq 0x2a5c7(%rip), %rdi     # 0xad270
leaq 0x30cda(%rip), %rsi     # 0xb398a
movl $0x48e, %edx            # imm = 0x48E
leaq 0x31ab0(%rip), %rcx     # 0xb476c
callq 0x4270
jmp 0x82cc3
jmp 0x82cc5
jmp 0x82cc7
testb $0x1, -0x25(%rbp)
jne 0x82d2f
movq -0x10(%rbp), %rax
movl 0x58(%rax), %edx
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movslq -0x14(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x78(%rax)
je 0x82d2d
movq -0x10(%rbp), %rax
testb $0x1, 0x88(%rax)
je 0x82d0b
movw -0x56(%rbp), %ax
movw %ax, -0x10a2(%rbp)
jmp 0x82d16
movw -0x54(%rbp), %ax
movw %ax, -0x10a2(%rbp)
movw -0x10a2(%rbp), %dx
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x14(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
jmp 0x82d50
movq -0x10(%rbp), %rax
cmpq $0x0, 0x78(%rax)
je 0x82d4e
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x14(%rbp), %rcx
movw (%rax,%rcx,2), %ax
movw %ax, -0x56(%rbp)
jmp 0x82d50
movq -0x10(%rbp), %rdi
movb -0x25(%rbp), %cl
movl $0x4034b50, %esi        # imm = 0x4034B50
movl $0x2014b50, %eax        # imm = 0x2014B50
testb $0x1, %cl
cmovnel %eax, %esi
callq 0x83db0
testb $0x1, %al
jne 0x82d8f
leaq 0x2a4f9(%rip), %rdi     # 0xad270
leaq 0x30c0c(%rip), %rsi     # 0xb398a
movl $0x49b, %edx            # imm = 0x49B
leaq 0x319e2(%rip), %rcx     # 0xb476c
callq 0x4270
testb $0x1, -0x25(%rbp)
je 0x82dd0
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x4, %rsi
movl $0x2, %edx
callq 0x821f0
testb $0x1, %al
jne 0x82dce
leaq 0x2a4ba(%rip), %rdi     # 0xad270
leaq 0x30bcd(%rip), %rsi     # 0xb398a
movl $0x49d, %edx            # imm = 0x49D
leaq 0x319a3(%rip), %rcx     # 0xb476c
callq 0x4270
jmp 0x82dd0
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x6, %rsi
movl $0x4, %edx
callq 0x821f0
testb $0x1, %al
jne 0x82e09
leaq 0x2a47f(%rip), %rdi     # 0xad270
leaq 0x30b92(%rip), %rsi     # 0xb398a
movl $0x49e, %edx            # imm = 0x49E
leaq 0x31968(%rip), %rcx     # 0xb476c
callq 0x4270
movq -0x10(%rbp), %rdi
movb -0x31(%rbp), %dl
xorl %eax, %eax
movl $0x8, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movzwl %ax, %esi
callq 0x83d70
testb $0x1, %al
jne 0x82e48
leaq 0x2a440(%rip), %rdi     # 0xad270
leaq 0x30b53(%rip), %rsi     # 0xb398a
movl $0x49f, %edx            # imm = 0x49F
leaq 0x31929(%rip), %rcx     # 0xb476c
callq 0x4270
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0xc, %rsi
movl $0x4, %edx
callq 0x821f0
testb $0x1, %al
jne 0x82e81
leaq 0x2a407(%rip), %rdi     # 0xad270
leaq 0x30b1a(%rip), %rsi     # 0xb398a
movl $0x4a0, %edx            # imm = 0x4A0
leaq 0x318f0(%rip), %rcx     # 0xb476c
callq 0x4270
movq -0x10(%rbp), %rax
testb $0x1, 0x148(%rax)
je 0x82ed1
movq -0x10(%rbp), %rax
movb $0x0, 0x148(%rax)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x14c(%rax), %esi
callq 0x83db0
testb $0x1, %al
jne 0x82ecf
leaq 0x2a3b9(%rip), %rdi     # 0xad270
leaq 0x30acc(%rip), %rsi     # 0xb398a
movl $0x4a3, %edx            # imm = 0x4A3
leaq 0x318a2(%rip), %rcx     # 0xb476c
callq 0x4270
jmp 0x82f0c
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x10, %rsi
movl $0x4, %edx
callq 0x821f0
testb $0x1, %al
jne 0x82f0a
leaq 0x2a37e(%rip), %rdi     # 0xad270
leaq 0x30a91(%rip), %rsi     # 0xb398a
movl $0x4a5, %edx            # imm = 0x4A5
leaq 0x31867(%rip), %rcx     # 0xb476c
callq 0x4270
jmp 0x82f0c
movq -0x10(%rbp), %rdi
movl -0x38(%rbp), %esi
callq 0x83db0
testb $0x1, %al
jne 0x82f3b
leaq 0x2a34d(%rip), %rdi     # 0xad270
leaq 0x30a60(%rip), %rsi     # 0xb398a
movl $0x4a7, %edx            # imm = 0x4A7
leaq 0x31836(%rip), %rcx     # 0xb476c
callq 0x4270
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x18, %rsi
movl $0x6, %edx
callq 0x821f0
testb $0x1, %al
jne 0x82f74
leaq 0x2a314(%rip), %rdi     # 0xad270
leaq 0x30a27(%rip), %rsi     # 0xb398a
movl $0x4a8, %edx            # imm = 0x4A8
leaq 0x317fd(%rip), %rcx     # 0xb476c
callq 0x4270
movq -0x10(%rbp), %rdi
movzwl -0x56(%rbp), %esi
callq 0x83d70
testb $0x1, %al
jne 0x82fa4
leaq 0x2a2e4(%rip), %rdi     # 0xad270
leaq 0x309f7(%rip), %rsi     # 0xb398a
movl $0x4a9, %edx            # imm = 0x4A9
leaq 0x317cd(%rip), %rcx     # 0xb476c
callq 0x4270
movw $0x0, -0x1092(%rbp)
testb $0x1, -0x25(%rbp)
je 0x83077
movq -0x30(%rbp), %rdi
addq $0x20, %rdi
callq 0x7eac0
movw %ax, -0x1092(%rbp)
movq -0x10(%rbp), %rdi
movzwl -0x1092(%rbp), %esi
callq 0x83d70
testb $0x1, %al
jne 0x82ffe
leaq 0x2a28a(%rip), %rdi     # 0xad270
leaq 0x3099d(%rip), %rsi     # 0xb398a
movl $0x4ae, %edx            # imm = 0x4AE
leaq 0x31773(%rip), %rcx     # 0xb476c
callq 0x4270
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x22, %rsi
movl $0x8, %edx
callq 0x821f0
testb $0x1, %al
jne 0x83037
leaq 0x2a251(%rip), %rdi     # 0xad270
leaq 0x30964(%rip), %rsi     # 0xb398a
movl $0x4af, %edx            # imm = 0x4AF
leaq 0x3173a(%rip), %rcx     # 0xb476c
callq 0x4270
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %esi
callq 0x83db0
testb $0x1, %al
jne 0x83075
leaq 0x2a213(%rip), %rdi     # 0xad270
leaq 0x30926(%rip), %rsi     # 0xb398a
movl $0x4b0, %edx            # imm = 0x4B0
leaq 0x316fc(%rip), %rcx     # 0xb476c
callq 0x4270
jmp 0x83077
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
movzwl -0x3a(%rbp), %eax
movl %eax, %edx
callq 0x821f0
testb $0x1, %al
jne 0x830ad
leaq 0x2a1db(%rip), %rdi     # 0xad270
leaq 0x308ee(%rip), %rsi     # 0xb398a
movl $0x4b2, %edx            # imm = 0x4B2
leaq 0x316c4(%rip), %rcx     # 0xb476c
callq 0x4270
movq -0x10(%rbp), %rax
movq %rax, -0x10b8(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x10b0(%rbp)
movzwl -0x54(%rbp), %eax
movzwl -0x56(%rbp), %ecx
cmpl %ecx, %eax
jge 0x830dc
movw -0x54(%rbp), %ax
movw %ax, -0x10ba(%rbp)
jmp 0x830e7
movw -0x56(%rbp), %ax
movw %ax, -0x10ba(%rbp)
movq -0x10b0(%rbp), %rsi
movq -0x10b8(%rbp), %rdi
movw -0x10ba(%rbp), %ax
movzwl %ax, %eax
movl %eax, %edx
callq 0x821f0
testb $0x1, %al
jne 0x83129
leaq 0x2a15f(%rip), %rdi     # 0xad270
leaq 0x30872(%rip), %rsi     # 0xb398a
movl $0x4b4, %edx            # imm = 0x4B4
leaq 0x31648(%rip), %rcx     # 0xb476c
callq 0x4270
movzwl -0x56(%rbp), %eax
movzwl -0x54(%rbp), %ecx
cmpl %ecx, %eax
jle 0x83170
movq -0x10(%rbp), %rdi
movzwl -0x56(%rbp), %eax
movzwl -0x54(%rbp), %ecx
subl %ecx, %eax
movslq %eax, %rsi
callq 0x85340
testb $0x1, %al
jne 0x8316e
leaq 0x2a11a(%rip), %rdi     # 0xad270
leaq 0x3082d(%rip), %rsi     # 0xb398a
movl $0x4b6, %edx            # imm = 0x4B6
leaq 0x31603(%rip), %rcx     # 0xb476c
callq 0x4270
jmp 0x83170
movzwl -0x1092(%rbp), %eax
cmpl $0x0, %eax
jle 0x831c9
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
movzwl -0x3a(%rbp), %eax
cltq
addq %rax, %rsi
movzwl -0x52(%rbp), %eax
cltq
addq %rax, %rsi
movzwl -0x1092(%rbp), %eax
movl %eax, %edx
callq 0x821f0
testb $0x1, %al
jne 0x831c7
leaq 0x2a0c1(%rip), %rdi     # 0xad270
leaq 0x307d4(%rip), %rsi     # 0xb398a
movl $0x4b9, %edx            # imm = 0x4B9
leaq 0x315aa(%rip), %rcx     # 0xb476c
callq 0x4270
jmp 0x831c9
testb $0x1, -0x57(%rbp)
je 0x83207
movq -0x10(%rbp), %rax
movl 0x58(%rax), %eax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x60(%rbp)
cmpq $0x0, %rdx
jne 0x831e6
jmp 0x83205
leaq 0x31630(%rip), %rdi     # 0xb481d
leaq 0x30796(%rip), %rsi     # 0xb398a
movl $0x4bb, %edx            # imm = 0x4BB
leaq 0x3156c(%rip), %rcx     # 0xb476c
callq 0x4270
jmp 0x83207
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x10c0, %rsp           # imm = 0x10C0
popq %rbp
retq
nopl (%rax)