// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movw $0x0, -0x2a(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rdx
addq $0x28, %rdx
movq -0x10(%rbp), %rax
movzbl 0x78(%rax), %eax
xorl %ecx, %ecx
movl %ecx, %r9d
xorl %r8d, %r8d
movq %r9, %rcx
movl $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
movl $0x8, 0x10(%rsp)
movl $0xffffffff, 0x18(%rsp) # imm = 0xFFFFFFFF
movl $0x0, 0x20(%rsp)
movl $0xfffffff1, 0x28(%rsp) # imm = 0xFFFFFFF1
movl $0x8, 0x30(%rsp)
movl $0x0, 0x38(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x48(%rsp)
movq $0x0, 0x50(%rsp)
movq $0x0, 0x58(%rsp)
movl %eax, 0x60(%rsp)
callq 0xc7a0
movw %ax, -0x2a(%rbp)
movswl -0x2a(%rbp), %eax
cmpl $0x0, %eax
je 0x2ff0a
movq 0x4d16b(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x38dc8(%rip), %rsi     # 0x68c5f
leaq 0x38be6(%rip), %rdx     # 0x68a84
movl $0x733, %ecx            # imm = 0x733
movb $0x0, %al
callq 0xc8f0
movswl -0x2a(%rbp), %eax
cmpl $-0x1, %eax
jne 0x2febf
movl $0x5, -0x4(%rbp)
jmp 0x3004c
movswl -0x2a(%rbp), %eax
cmpl $-0x66, %eax
jne 0x2fed4
movl $0x6, -0x4(%rbp)
jmp 0x3004c
movswl -0x2a(%rbp), %eax
cmpl $-0x67, %eax
jne 0x2fee9
movl $0x7, -0x4(%rbp)
jmp 0x3004c
movswl -0x2a(%rbp), %eax
cmpl $-0x68, %eax
jne 0x2fefe
movl $0x8, -0x4(%rbp)
jmp 0x3004c
movl $0x9, -0x4(%rbp)
jmp 0x3004c
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rax
movl %eax, %edx
callq 0xc120
movw %ax, -0x2a(%rbp)
movswl -0x2a(%rbp), %eax
cmpl $0x0, %eax
jge 0x2ffb6
movq 0x4d0bf(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x38d4c(%rip), %rsi     # 0x68c8f
leaq 0x38b3a(%rip), %rdx     # 0x68a84
movl $0x73b, %ecx            # imm = 0x73B
movb $0x0, %al
callq 0xc8f0
movswl -0x2a(%rbp), %eax
cmpl $-0x1, %eax
jne 0x2ff6b
movl $0x5, -0x4(%rbp)
jmp 0x3004c
movswl -0x2a(%rbp), %eax
cmpl $-0x66, %eax
jne 0x2ff80
movl $0x6, -0x4(%rbp)
jmp 0x3004c
movswl -0x2a(%rbp), %eax
cmpl $-0x67, %eax
jne 0x2ff95
movl $0x7, -0x4(%rbp)
jmp 0x3004c
movswl -0x2a(%rbp), %eax
cmpl $-0x68, %eax
jne 0x2ffaa
movl $0x8, -0x4(%rbp)
jmp 0x3004c
movl $0x9, -0x4(%rbp)
jmp 0x3004c
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0xc220
movw %ax, -0x2a(%rbp)
movswl -0x2a(%rbp), %eax
cmpl $0x0, %eax
je 0x30045
movq 0x4d021(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x38ce6(%rip), %rsi     # 0x68cc7
leaq 0x38a9c(%rip), %rdx     # 0x68a84
movl $0x741, %ecx            # imm = 0x741
movb $0x0, %al
callq 0xc8f0
movswl -0x2a(%rbp), %eax
cmpl $-0x1, %eax
jne 0x30006
movl $0x5, -0x4(%rbp)
jmp 0x3004c
movswl -0x2a(%rbp), %eax
cmpl $-0x66, %eax
jne 0x30018
movl $0x6, -0x4(%rbp)
jmp 0x3004c
movswl -0x2a(%rbp), %eax
cmpl $-0x67, %eax
jne 0x3002a
movl $0x7, -0x4(%rbp)
jmp 0x3004c
movswl -0x2a(%rbp), %eax
cmpl $-0x68, %eax
jne 0x3003c
movl $0x8, -0x4(%rbp)
jmp 0x3004c
movl $0x9, -0x4(%rbp)
jmp 0x3004c
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax,%rax)