// File: sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: Zipper_endCentralDirectory_append
bool Zipper_endCentralDirectory_append(Zipper* self,UnZipper* srcZip){
    check(self->_fileEntryCount==self->_fileHeaderCount);
    check(!self->_isUpdateCrc32);
    check(!self->_isUpdateIsCompress);
    const TByte* endBuf=srcZip->_endCentralDirectory;
    ZipFilePos_t centralDirectory_size=self->_curFilePos-self->_centralDirectory_pos;
    
    check(_write(self,endBuf+0,8-0));//固定魔法值--Central Directory的开始分卷号;
    check(_writeUInt16(self,self->_fileEntryCount));
    check(_writeUInt16(self,self->_fileEntryCount));
    check(_writeUInt32(self,centralDirectory_size));
    check(_writeUInt32(self,self->_centralDirectory_pos));
    uint16_t endCommentLen=readUInt16(srcZip->_endCentralDirectory+20); //Zip文件注释长度;
    check(_writeUInt16(self,endCommentLen));
    check(_write(self,srcZip->_endCentralDirectory+22,endCommentLen));//Zip文件注释;
    check(_writeFlush(self));
#if (_IS_USED_MULTITHREAD)
    if (isUsedMT(self)){
        self->_threadWorks->finishDispatchWork();
        check(_dispose_filishedThreadWork(self,true));
    }
#endif
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x60(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x9c(%rcx), %eax
je 0x83ae2
leaq 0x297a6(%rip), %rdi     # 0xad270
leaq 0x2feb9(%rip), %rsi     # 0xb398a
movl $0x5e2, %edx            # imm = 0x5E2
leaq 0x3081f(%rip), %rcx     # 0xb42fc
callq 0x4270
movq -0x8(%rbp), %rax
testb $0x1, 0x148(%rax)
je 0x83b0e
leaq 0x2977a(%rip), %rdi     # 0xad270
leaq 0x2fe8d(%rip), %rsi     # 0xb398a
movl $0x5e3, %edx            # imm = 0x5E3
leaq 0x307f3(%rip), %rcx     # 0xb42fc
callq 0x4270
movq -0x8(%rbp), %rax
testb $0x1, 0x150(%rax)
je 0x83b3a
leaq 0x2974e(%rip), %rdi     # 0xad270
leaq 0x2fe61(%rip), %rsi     # 0xb398a
movl $0x5e4, %edx            # imm = 0x5E4
leaq 0x307c7(%rip), %rcx     # 0xb42fc
callq 0x4270
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x58(%rax), %eax
movq -0x8(%rbp), %rcx
subl 0xa0(%rcx), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x8, %edx
callq 0x821f0
testb $0x1, %al
jne 0x83b8f
leaq 0x296f9(%rip), %rdi     # 0xad270
leaq 0x2fe0c(%rip), %rsi     # 0xb398a
movl $0x5e8, %edx            # imm = 0x5E8
leaq 0x30772(%rip), %rcx     # 0xb42fc
callq 0x4270
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x60(%rax), %eax
movzwl %ax, %esi
callq 0x83d70
testb $0x1, %al
jne 0x83bc5
leaq 0x296c3(%rip), %rdi     # 0xad270
leaq 0x2fdd6(%rip), %rsi     # 0xb398a
movl $0x5e9, %edx            # imm = 0x5E9
leaq 0x3073c(%rip), %rcx     # 0xb42fc
callq 0x4270
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x60(%rax), %eax
movzwl %ax, %esi
callq 0x83d70
testb $0x1, %al
jne 0x83bfb
leaq 0x2968d(%rip), %rdi     # 0xad270
leaq 0x2fda0(%rip), %rsi     # 0xb398a
movl $0x5ea, %edx            # imm = 0x5EA
leaq 0x30706(%rip), %rcx     # 0xb42fc
callq 0x4270
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x83db0
testb $0x1, %al
jne 0x83c2a
leaq 0x2965e(%rip), %rdi     # 0xad270
leaq 0x2fd71(%rip), %rsi     # 0xb398a
movl $0x5eb, %edx            # imm = 0x5EB
leaq 0x306d7(%rip), %rcx     # 0xb42fc
callq 0x4270
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0xa0(%rax), %esi
callq 0x83db0
testb $0x1, %al
jne 0x83c60
leaq 0x29628(%rip), %rdi     # 0xad270
leaq 0x2fd3b(%rip), %rsi     # 0xb398a
movl $0x5ec, %edx            # imm = 0x5EC
leaq 0x306a1(%rip), %rcx     # 0xb42fc
callq 0x4270
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
addq $0x14, %rdi
callq 0x7eac0
movw %ax, -0x1e(%rbp)
movq -0x8(%rbp), %rdi
movzwl -0x1e(%rbp), %esi
callq 0x83d70
testb $0x1, %al
jne 0x83ca5
leaq 0x295e3(%rip), %rdi     # 0xad270
leaq 0x2fcf6(%rip), %rsi     # 0xb398a
movl $0x5ee, %edx            # imm = 0x5EE
leaq 0x3065c(%rip), %rcx     # 0xb42fc
callq 0x4270
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rsi
addq $0x16, %rsi
movzwl -0x1e(%rbp), %eax
movl %eax, %edx
callq 0x821f0
testb $0x1, %al
jne 0x83ce3
leaq 0x295a5(%rip), %rdi     # 0xad270
leaq 0x2fcb8(%rip), %rsi     # 0xb398a
movl $0x5ef, %edx            # imm = 0x5EF
leaq 0x3061e(%rip), %rcx     # 0xb42fc
callq 0x4270
movq -0x8(%rbp), %rdi
callq 0x83df0
testb $0x1, %al
jne 0x83d0f
leaq 0x29579(%rip), %rdi     # 0xad270
leaq 0x2fc8c(%rip), %rsi     # 0xb398a
movl $0x5f0, %edx            # imm = 0x5F0
leaq 0x305f2(%rip), %rcx     # 0xb42fc
callq 0x4270
movq -0x8(%rbp), %rax
cmpl $0x1, 0x154(%rax)
jle 0x83d5f
movq -0x8(%rbp), %rax
movq 0x158(%rax), %rdi
callq 0x85700
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x834e0
testb $0x1, %al
jne 0x83d5d
leaq 0x2952b(%rip), %rdi     # 0xad270
leaq 0x2fc3e(%rip), %rsi     # 0xb398a
movl $0x5f4, %edx            # imm = 0x5F4
leaq 0x305a4(%rip), %rcx     # 0xb42fc
callq 0x4270
jmp 0x83d5f
movb $0x1, %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)