// File: /workspace/github_cpp_makefile_star2_O3/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 0x42415
movq %rdi, %r14
leaq 0xc0(%rdi), %rbx
movq 0x108(%rdi), %r15
testq %r15, %r15
je 0x422d6
cmpq $0x0, 0xe0(%r14)
movq %r15, %rsi
jne 0x422b9
cmpq $0x0, 0xe8(%r14)
movq %r15, %rsi
jne 0x422b9
leaq 0xb(%rsp), %rcx
movb $0x0, (%rcx)
movq %rbx, %rdi
xorl %esi, %esi
movq %rcx, %rdx
callq *0xd8(%r14)
testl %eax, %eax
je 0x424cf
movq 0x108(%r14), %rsi
movq $0x0, 0x108(%r14)
movq 0x100(%r14), %rdi
callq *0x18(%rdi)
testb %al, %al
je 0x42453
movq 0xe0(%r14), %rax
cmpq 0xc8(%r14), %rax
jne 0x42434
cmpl $0x2, 0x154(%r14)
jl 0x42331
movq 0xf8(%r14), %rsi
testq %rsi, %rsi
je 0x4231f
movq 0x158(%r14), %rdi
incl 0x38(%rdi)
movl $0x1, %edx
callq 0x489e4
movq $0x0, 0xf8(%r14)
movq %r14, %rdi
xorl %esi, %esi
callq 0x424ee
testb %al, %al
je 0x424b0
testq %r15, %r15
je 0x423e3
movq 0xe8(%r14), %rax
movq %rax, %rcx
shrq $0x20, %rcx
jne 0x42472
movslq 0x130(%r14), %rcx
cmpl %ecx, 0x60(%r14)
jle 0x42491
movq 0xb0(%r14), %rdx
cmpl %eax, (%rdx,%rcx,4)
je 0x423e3
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 0x423d6
movl %eax, 0xc(%rsp)
addl $0x16, %edx
cmpq %rdx, %rcx
jae 0x423a0
movq %r14, %rdi
callq 0x42910
movq (%r14), %rdi
leaq 0x10(%rsp), %rcx
leaq 0xc(%rsp), %rdx
movq %r15, %rsi
callq *0x18(%rdi)
testl %eax, %eax
jne 0x423e3
leaq 0x17c92(%rip), %rdi     # 0x5a050
leaq 0x1df1c(%rip), %rsi     # 0x602e1
leaq 0x1ee97(%rip), %rcx     # 0x61263
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 0x17c34(%rip), %rdi     # 0x5a050
leaq 0x1debe(%rip), %rsi     # 0x602e1
leaq 0x1e650(%rip), %rcx     # 0x60a7a
movl $0x596, %edx            # imm = 0x596
callq 0x4200
leaq 0x17c15(%rip), %rdi     # 0x5a050
leaq 0x1de9f(%rip), %rsi     # 0x602e1
leaq 0x1e631(%rip), %rcx     # 0x60a7a
movl $0x5a4, %edx            # imm = 0x5A4
callq 0x4200
leaq 0x17bf6(%rip), %rdi     # 0x5a050
leaq 0x1de80(%rip), %rsi     # 0x602e1
leaq 0x1e612(%rip), %rcx     # 0x60a7a
movl $0x5a1, %edx            # imm = 0x5A1
callq 0x4200
leaq 0x1e627(%rip), %rdi     # 0x60aa0
leaq 0x1de61(%rip), %rsi     # 0x602e1
leaq 0x1e5f3(%rip), %rcx     # 0x60a7a
movl $0x5af, %edx            # imm = 0x5AF
callq 0x4200
leaq 0x17bb8(%rip), %rdi     # 0x5a050
leaq 0x1de42(%rip), %rsi     # 0x602e1
leaq 0x1edf6(%rip), %rcx     # 0x6129c
movl $0x56e, %edx            # imm = 0x56E
callq 0x4200
leaq 0x17b99(%rip), %rdi     # 0x5a050
leaq 0x1de23(%rip), %rsi     # 0x602e1
leaq 0x1e5b5(%rip), %rcx     # 0x60a7a
movl $0x5ab, %edx            # imm = 0x5AB
callq 0x4200
leaq 0x17b7a(%rip), %rdi     # 0x5a050
leaq 0x1de04(%rip), %rsi     # 0x602e1
leaq 0x1e596(%rip), %rcx     # 0x60a7a
movl $0x59d, %edx            # imm = 0x59D
callq 0x4200