// File: /workspace/github_c_makefile_star2_O0/Paxa[P]fast_excel/libxlsxwriter/src/packager.c
// Function: write_comment_files
STATIC lxw_error
_write_comment_files(lxw_packager *self)
{
    lxw_workbook *workbook = self->workbook;
    lxw_sheet *sheet;
    lxw_worksheet *worksheet;
    lxw_comment *comment;
    char filename[LXW_FILENAME_LENGTH] = { 0 };
    char *buffer = NULL;
    size_t buffer_size = 0;
    uint32_t index = 1;
    lxw_error err;

    STAILQ_FOREACH(sheet, workbook->sheets, list_pointers) {
        if (sheet->is_chartsheet)
            continue;
        else
            worksheet = sheet->u.worksheet;

        if (!worksheet->has_comments)
            continue;

        comment = lxw_comment_new();
        if (!comment)
            return LXW_ERROR_MEMORY_MALLOC_FAILED;

        lxw_snprintf(filename, LXW_FILENAME_LENGTH,
                     "xl/comments%d.xml", index++);

        comment->file = lxw_get_filehandle(&buffer, &buffer_size,
                                           self->tmpdir);
        if (!comment->file) {
            lxw_comment_free(comment);
            return LXW_ERROR_CREATING_TMPFILE;
        }

        comment->comment_objs = worksheet->comment_objs;
        comment->comment_author = worksheet->comment_author;

        lxw_comment_assemble_xml_file(comment);

        err = _add_to_zip(self, comment->file, &buffer, &buffer_size,
                          filename);

        fclose(comment->file);
        free(buffer);
        lxw_comment_free(comment);

        RETURN_ON_ERROR(err);
    }

    return LXW_NO_ERROR;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
leaq -0xb0(%rbp), %rdi
xorl %esi, %esi
movl $0x80, %edx
callq 0xc6a0
movq $0x0, -0xb8(%rbp)
movq $0x0, -0xc0(%rbp)
movl $0x1, -0xc4(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x2e4e3
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
je 0x2e396
jmp 0x2e4d2
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpb $0x0, 0x2a1(%rax)
jne 0x2e3b4
jmp 0x2e4d2
callq 0xcf10
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x2e3d0
movl $0x1, -0x4(%rbp)
jmp 0x2e4ea
leaq -0xb0(%rbp), %rdi
movl -0xc4(%rbp), %ecx
movl %ecx, %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
movl $0x80, %esi
leaq 0x3a845(%rip), %rdx     # 0x68c39
movb $0x0, %al
callq 0xc5d0
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rdx
leaq -0xb8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0xceb0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x2e43f
movq -0x30(%rbp), %rdi
callq 0xc2f0
movl $0x3, -0x4(%rbp)
jmp 0x2e4ea
movq -0x28(%rbp), %rax
movq 0x80(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movq 0x2c8(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x30(%rbp), %rdi
callq 0xc2d0
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rsi
leaq -0xb0(%rbp), %r8
leaq -0xb8(%rbp), %rdx
leaq -0xc0(%rbp), %rcx
callq 0x2fd50
movl %eax, -0xc8(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
callq 0xc460
movq -0xb8(%rbp), %rdi
callq 0xc0d0
movq -0x30(%rbp), %rdi
callq 0xc2f0
cmpl $0x0, -0xc8(%rbp)
je 0x2e4ce
movl -0xc8(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2e4ea
jmp 0x2e4d0
jmp 0x2e4d2
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x2e37d
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)