// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/src/patch/Zipper.cpp
// Function: Zipper_file_append_end
bool Zipper_file_append_end(Zipper* self){
    Zipper_file_append_stream* append_state=&self->_append_stream;
    if (append_state->self==0) { assert(false); return false; }
    
    bool result=true;
    const bool isCompressedFile=(append_state->compressHandle!=0);
    if (isCompressedFile){
        if ((append_state->inputPos==0)&&(append_state->outputPos==0)){
            Byte emptyBuf=0; //compress empty file
            check(append_state->write(append_state,0,&emptyBuf,&emptyBuf));
        }
        void* compressHandle=append_state->compressHandle;
        append_state->compressHandle=0;
        check_clear(append_state->compressor->closeCompressHandle(append_state->compressor,compressHandle));
    }
    
    check_clear(append_state->inputPos==append_state->streamSize);
#if (_IS_USED_MULTITHREAD)
    if (isUsedMT(self)) {
        if (append_state->threadWork){
            self->_threadWorks->dispatchWork(append_state->threadWork);
            append_state->threadWork=0;
        }
        check_clear(_dispose_filishedThreadWork(self,false));
    }
#endif
    if (isCompressedFile){
        assert(append_state->outputPos==(ZipFilePos_t)append_state->outputPos);
        ZipFilePos_t compressedSize=(ZipFilePos_t)append_state->outputPos;
        check_clear(_zipper_file_update_compressedSize(self,append_state->curFileIndex,compressedSize));
    }
clear:
    memset(append_state,0,sizeof(Zipper_file_append_stream));
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
cmpq $0x0, 0xf0(%rdi)
je 0x428fe
movq %rdi, %r14
leaq 0xc0(%rdi), %rbx
movq 0x108(%rdi), %r15
testq %r15, %r15
je 0x427bf
cmpq $0x0, 0xe0(%r14)
jne 0x4279b
cmpq $0x0, 0xe8(%r14)
jne 0x4279b
leaq 0xb(%rsp), %rcx
movb $0x0, (%rcx)
movq %rbx, %rdi
xorl %esi, %esi
movq %rcx, %rdx
callq *0xd8(%r14)
testl %eax, %eax
je 0x429b8
movq 0x100(%r14), %rdi
movq 0x108(%r14), %rsi
movq $0x0, 0x108(%r14)
callq *0x18(%rdi)
testb %al, %al
je 0x4293c
movq 0xe0(%r14), %rax
cmpq 0xc8(%r14), %rax
jne 0x4291d
cmpl $0x2, 0x154(%r14)
jl 0x4281a
movq 0xf8(%r14), %rsi
testq %rsi, %rsi
je 0x42808
movq 0x158(%r14), %rdi
incl 0x38(%rdi)
movl $0x1, %edx
callq 0x49676
movq $0x0, 0xf8(%r14)
movq %r14, %rdi
xorl %esi, %esi
callq 0x429d7
testb %al, %al
je 0x42999
testq %r15, %r15
je 0x428cc
movq 0xe8(%r14), %rax
movq %rax, %rcx
shrq $0x20, %rcx
jne 0x4295b
movslq 0x130(%r14), %rcx
cmpl %ecx, 0x60(%r14)
jle 0x4297a
movq 0xb0(%r14), %rdx
cmpl %eax, (%rdx,%rcx,4)
je 0x428cc
movl %eax, (%rdx,%rcx,4)
movq 0xa8(%r14), %rdx
movl (%rdx,%rcx,4), %edx
leal 0x12(%rdx), %r15d
movl 0x58(%r14), %ecx
subq 0x140(%r14), %rcx
cmpq %r15, %rcx
jbe 0x428bf
movl %eax, 0xc(%rsp)
addl $0x16, %edx
cmpq %rdx, %rcx
jae 0x42889
movq %r14, %rdi
callq 0x42e0c
movq (%r14), %rdi
leaq 0x10(%rsp), %rcx
leaq 0xc(%rsp), %rdx
movq %r15, %rsi
callq *0x18(%rdi)
testl %eax, %eax
jne 0x428cc
leaq 0x177a9(%rip), %rdi     # 0x5a050
leaq 0x1d9b3(%rip), %rsi     # 0x60261
leaq 0x1e92e(%rip), %rcx     # 0x611e3
movl $0x3f7, %edx            # imm = 0x3F7
callq 0x4200
addq 0x138(%r14), %r15
subq %rcx, %r15
movl %eax, (%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x60(%rbx)
movups %xmm0, 0x50(%rbx)
movups %xmm0, 0x40(%rbx)
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
movq $0x0, 0x70(%rbx)
movb $0x1, %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1774b(%rip), %rdi     # 0x5a050
leaq 0x1d955(%rip), %rsi     # 0x60261
leaq 0x1e0e7(%rip), %rcx     # 0x609fa
movl $0x596, %edx            # imm = 0x596
callq 0x4200
leaq 0x1772c(%rip), %rdi     # 0x5a050
leaq 0x1d936(%rip), %rsi     # 0x60261
leaq 0x1e0c8(%rip), %rcx     # 0x609fa
movl $0x5a4, %edx            # imm = 0x5A4
callq 0x4200
leaq 0x1770d(%rip), %rdi     # 0x5a050
leaq 0x1d917(%rip), %rsi     # 0x60261
leaq 0x1e0a9(%rip), %rcx     # 0x609fa
movl $0x5a1, %edx            # imm = 0x5A1
callq 0x4200
leaq 0x1e0be(%rip), %rdi     # 0x60a20
leaq 0x1d8f8(%rip), %rsi     # 0x60261
leaq 0x1e08a(%rip), %rcx     # 0x609fa
movl $0x5af, %edx            # imm = 0x5AF
callq 0x4200
leaq 0x176cf(%rip), %rdi     # 0x5a050
leaq 0x1d8d9(%rip), %rsi     # 0x60261
leaq 0x1e88d(%rip), %rcx     # 0x6121c
movl $0x56e, %edx            # imm = 0x56E
callq 0x4200
leaq 0x176b0(%rip), %rdi     # 0x5a050
leaq 0x1d8ba(%rip), %rsi     # 0x60261
leaq 0x1e04c(%rip), %rcx     # 0x609fa
movl $0x5ab, %edx            # imm = 0x5AB
callq 0x4200
leaq 0x17691(%rip), %rdi     # 0x5a050
leaq 0x1d89b(%rip), %rsi     # 0x60261
leaq 0x1e02d(%rip), %rcx     # 0x609fa
movl $0x59d, %edx            # imm = 0x59D
callq 0x4200