// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x70, %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)
andl $0x0, 0x38(%rsp)
andl $0x0, 0x20(%rsp)
orl $-0x1, 0x18(%rsp)
pushq $0x8
popq %r12
andq $0x0, 0x8(%rsp)
movl %r12d, 0x30(%rsp)
andl $0x0, (%rsp)
movl %r12d, 0x10(%rsp)
movl $0xfffffff1, 0x28(%rsp) # imm = 0xFFFFFFF1
movq %rcx, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xc790
movl %eax, %ebp
shll $0x10, %ebp
jne 0x1f3de
movq 0x20(%rbx), %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0xc110
movl %eax, %ebp
shll $0x10, %ebp
js 0x1f3fd
movq 0x20(%rbx), %rdi
callq 0xc210
movl %eax, %ebx
xorl %eax, %eax
shll $0x10, %ebx
jne 0x1f445
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x33c13(%rip), %rax     # 0x52ff8
movq (%rax), %rdi
leaq 0x20a4c(%rip), %rsi     # 0x3fe3b
leaq 0x2086a(%rip), %rdx     # 0x3fc60
movl $0x733, %ecx            # imm = 0x733
jmp 0x1f41a
movq 0x33bf4(%rip), %rax     # 0x52ff8
movq (%rax), %rdi
leaq 0x20a5d(%rip), %rsi     # 0x3fe6b
leaq 0x2084b(%rip), %rdx     # 0x3fc60
movl $0x73b, %ecx            # imm = 0x73B
xorl %eax, %eax
callq 0xc8d0
cmpl $0xff980000, %ebp       # imm = 0xFF980000
je 0x1f499
cmpl $0xff990000, %ebp       # imm = 0xFF990000
je 0x1f48d
cmpl $0xffff0000, %ebp       # imm = 0xFFFF0000
je 0x1f491
cmpl $0xff9a0000, %ebp       # imm = 0xFF9A0000
jne 0x1f489
pushq $0x6
jmp 0x1f493
movq 0x33bac(%rip), %rax     # 0x52ff8
movq (%rax), %rdi
leaq 0x20a4d(%rip), %rsi     # 0x3fea3
leaq 0x20803(%rip), %rdx     # 0x3fc60
movl $0x741, %ecx            # imm = 0x741
xorl %eax, %eax
callq 0xc8d0
cmpl $0xff980000, %ebx       # imm = 0xFF980000
je 0x1f499
cmpl $0xff990000, %ebx       # imm = 0xFF990000
je 0x1f48d
cmpl $0xffff0000, %ebx       # imm = 0xFFFF0000
je 0x1f491
cmpl $0xff9a0000, %ebx       # imm = 0xFF9A0000
je 0x1f441
pushq $0x9
jmp 0x1f493
pushq $0x7
jmp 0x1f493
pushq $0x5
popq %rax
jmp 0x1f3d1
movl %r12d, %eax
jmp 0x1f3d1