// File: /workspace/github_c_makefile_star2_O1/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 0x22583
movq 0x20(%rbx), %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0xc100
movl %eax, %ebp
shll $0x10, %ebp
js 0x225a2
movq 0x20(%rbx), %rdi
callq 0xc1f0
movl %eax, %ebx
xorl %eax, %eax
shll $0x10, %ebx
jne 0x225f5
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x33a6e(%rip), %rax     # 0x55ff8
movq (%rax), %rdi
leaq 0x20897(%rip), %rsi     # 0x42e2b
leaq 0x206b5(%rip), %rdx     # 0x42c50
movl $0x733, %ecx            # imm = 0x733
jmp 0x225bf
movq 0x33a4f(%rip), %rax     # 0x55ff8
movq (%rax), %rdi
leaq 0x208a8(%rip), %rsi     # 0x42e5b
leaq 0x20696(%rip), %rdx     # 0x42c50
movl $0x73b, %ecx            # imm = 0x73B
xorl %eax, %eax
callq 0xc870
cmpl $0xff99ffff, %ebp       # imm = 0xFF99FFFF
jg 0x225e3
cmpl $0xff980000, %ebp       # imm = 0xFF980000
je 0x2263b
cmpl $0xff990000, %ebp       # imm = 0xFF990000
je 0x22631
jmp 0x22669
cmpl $0xffff0000, %ebp       # imm = 0xFFFF0000
je 0x2265f
cmpl $0xff9a0000, %ebp       # imm = 0xFF9A0000
je 0x22655
jmp 0x22669
movq 0x339fc(%rip), %rax     # 0x55ff8
movq (%rax), %rdi
leaq 0x2088d(%rip), %rsi     # 0x42e93
leaq 0x20643(%rip), %rdx     # 0x42c50
movl $0x741, %ecx            # imm = 0x741
xorl %eax, %eax
callq 0xc870
cmpl $0xff99ffff, %ebx       # imm = 0xFF99FFFF
jg 0x22645
cmpl $0xff980000, %ebx       # imm = 0xFF980000
je 0x2263b
cmpl $0xff990000, %ebx       # imm = 0xFF990000
jne 0x22669
movl $0x7, %eax
jmp 0x22578
movl $0x8, %eax
jmp 0x22578
cmpl $0xffff0000, %ebx       # imm = 0xFFFF0000
je 0x2265f
cmpl $0xff9a0000, %ebx       # imm = 0xFF9A0000
jne 0x22669
movl $0x6, %eax
jmp 0x22578
movl $0x5, %eax
jmp 0x22578
movl $0x9, %eax
jmp 0x22578