// File: /workspace/github_c_makefile_star2_O3/Paxa[P]fast_excel/libxlsxwriter/src/packager.c
// Function: add_buffer_to_zip
STATIC lxw_error
_add_buffer_to_zip(lxw_packager *self, const char *buffer, size_t buffer_size,
                   const char *filename)
{
    int16_t error = ZIP_OK;

    error = zipOpenNewFileInZip4_64(self->zipfile,
                                    filename,
                                    &self->zipfile_info,
                                    NULL, 0, NULL, 0, NULL,
                                    Z_DEFLATED, Z_DEFAULT_COMPRESSION, 0,
                                    -MAX_WBITS, DEF_MEM_LEVEL,
                                    Z_DEFAULT_STRATEGY, NULL, 0, 0, 0,
                                    self->use_zip64);

    if (error != ZIP_OK) {
        LXW_ERROR("Error adding member to zipfile");
        RETURN_ON_ZIP_ERROR(error, LXW_ERROR_ZIP_FILE_ADD);
    }

    error = zipWriteInFileInZip(self->zipfile,
                                buffer, (unsigned int) buffer_size);

    if (error < 0) {
        LXW_ERROR("Error in writing member in the zipfile");
        RETURN_ON_ZIP_ERROR(error, LXW_ERROR_ZIP_FILE_ADD);
    }

    error = zipCloseFileInZip(self->zipfile);
    if (error != ZIP_OK) {
        LXW_ERROR("Error in closing member in the zipfile");
        RETURN_ON_ZIP_ERROR(error, LXW_ERROR_ZIP_FILE_ADD);
    }

    return LXW_NO_ERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
leaq 0x28(%rbx), %rdx
movzbl 0x78(%rbx), %eax
movl %eax, 0x60(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rsp)
movups %xmm0, 0x40(%rsp)
xorl %eax, %eax
movl %eax, 0x38(%rsp)
movl $0x8, %esi
movl %esi, 0x30(%rsp)
movl %eax, 0x20(%rsp)
movl %esi, 0x10(%rsp)
movl %eax, (%rsp)
movl $0xfffffff1, 0x28(%rsp) # imm = 0xFFFFFFF1
movl $0xffffffff, 0x18(%rsp) # imm = 0xFFFFFFFF
movq $0x0, 0x8(%rsp)
movq %rcx, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xc730
movl %eax, %ebp
shll $0x10, %ebp
jne 0x225f7
movq 0x20(%rbx), %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0xc100
movl %eax, %ebp
shll $0x10, %ebp
js 0x22616
movq 0x20(%rbx), %rdi
callq 0xc1f0
movl %eax, %ebx
xorl %eax, %eax
shll $0x10, %ebx
jne 0x22669
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x349fa(%rip), %rax     # 0x56ff8
movq (%rax), %rdi
leaq 0x20833(%rip), %rsi     # 0x42e3b
leaq 0x20651(%rip), %rdx     # 0x42c60
movl $0x733, %ecx            # imm = 0x733
jmp 0x22633
movq 0x349db(%rip), %rax     # 0x56ff8
movq (%rax), %rdi
leaq 0x20844(%rip), %rsi     # 0x42e6b
leaq 0x20632(%rip), %rdx     # 0x42c60
movl $0x73b, %ecx            # imm = 0x73B
xorl %eax, %eax
callq 0xc870
cmpl $0xff99ffff, %ebp       # imm = 0xFF99FFFF
jg 0x22657
cmpl $0xff980000, %ebp       # imm = 0xFF980000
je 0x226af
cmpl $0xff990000, %ebp       # imm = 0xFF990000
je 0x226a5
jmp 0x226dd
cmpl $0xffff0000, %ebp       # imm = 0xFFFF0000
je 0x226d3
cmpl $0xff9a0000, %ebp       # imm = 0xFF9A0000
je 0x226c9
jmp 0x226dd
movq 0x34988(%rip), %rax     # 0x56ff8
movq (%rax), %rdi
leaq 0x20829(%rip), %rsi     # 0x42ea3
leaq 0x205df(%rip), %rdx     # 0x42c60
movl $0x741, %ecx            # imm = 0x741
xorl %eax, %eax
callq 0xc870
cmpl $0xff99ffff, %ebx       # imm = 0xFF99FFFF
jg 0x226b9
cmpl $0xff980000, %ebx       # imm = 0xFF980000
je 0x226af
cmpl $0xff990000, %ebx       # imm = 0xFF990000
jne 0x226dd
movl $0x7, %eax
jmp 0x225ec
movl $0x8, %eax
jmp 0x225ec
cmpl $0xffff0000, %ebx       # imm = 0xFFFF0000
je 0x226d3
cmpl $0xff9a0000, %ebx       # imm = 0xFF9A0000
jne 0x226dd
movl $0x6, %eax
jmp 0x225ec
movl $0x5, %eax
jmp 0x225ec
movl $0x9, %eax
jmp 0x225ec