// File: /workspace/github_c_makefile_star2_O3/Paxa[P]fast_excel/libxlsxwriter/src/packager.c
// Function: write_table_files
STATIC lxw_error
_write_table_files(lxw_packager *self)
{
    lxw_workbook *workbook = self->workbook;
    lxw_sheet *sheet;
    lxw_worksheet *worksheet;
    lxw_table *table;
    lxw_table_obj *table_obj;
    lxw_error err;

    char filename[LXW_FILENAME_LENGTH] = { 0 };
    char *buffer = NULL;
    size_t buffer_size = 0;
    uint32_t index = 1;

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

        if (STAILQ_EMPTY(worksheet->table_objs))
            continue;

        STAILQ_FOREACH(table_obj, worksheet->table_objs, list_pointers) {

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

            table = lxw_table_new();
            if (!table) {
                err = LXW_ERROR_MEMORY_MALLOC_FAILED;
                RETURN_ON_ERROR(err);
            }

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

            table->table_obj = table_obj;

            lxw_table_assemble_xml_file(table);

            err = _add_to_zip(self, table->file, &buffer, &buffer_size,
                              filename);
            fclose(table->file);
            free(buffer);
            lxw_table_free(table);
            RETURN_ON_ERROR(err);
        }
    }

    return LXW_NO_ERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq 0x8(%rdi), %rax
xorps %xmm0, %xmm0
movaps %xmm0, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
xorl %ebx, %ebx
movq %rbx, 0x10(%rsp)
movq %rbx, 0x28(%rsp)
movq 0x8(%rax), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x214d1
movq %rdi, %r12
movl $0x1, %ecx
leaq 0x30(%rsp), %rbx
leaq 0x10(%rsp), %r15
leaq 0x28(%rsp), %rbp
movq %rdi, 0x20(%rsp)
cmpb $0x0, (%rax)
movq %rax, 0x18(%rsp)
je 0x213fd
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
testq %rax, %rax
jne 0x213e0
jmp 0x214cf
movq 0x8(%rax), %rax
movq 0x98(%rax), %rax
movq (%rax), %r13
testq %r13, %r13
je 0x213ea
movl $0x80, %esi
movq %rbx, %rdi
leaq 0x219df(%rip), %rdx     # 0x42dfe
movl %ecx, 0xc(%rsp)
xorl %eax, %eax
callq 0xc570
callq 0xc460
testq %rax, %rax
je 0x214b9
movq %rax, %r14
movq 0x70(%r12), %rdx
movq %r15, %rdi
movq %rbp, %rsi
callq 0xce00
movq %rax, (%r14)
testq %rax, %rax
je 0x214c0
movq %r13, 0x8(%r14)
movq %r14, %rdi
callq 0xc950
movq (%r14), %rsi
movq %r15, %rdx
movq %rbp, %rcx
movq %r12, %rdi
movq %rbx, %r12
movq %rbx, %r8
callq 0x224f6
movl %eax, %ebx
movq (%r14), %rdi
callq 0xc420
movq 0x10(%rsp), %rdi
callq 0xc0c0
movq %r14, %rdi
callq 0xc8b0
testl %ebx, %ebx
jne 0x214d1
movq 0x1078(%r13), %r13
movl 0xc(%rsp), %ecx
incl %ecx
testq %r13, %r13
movq %r12, %rbx
movq 0x20(%rsp), %r12
jne 0x21410
jmp 0x213ea
movl $0x1, %ebx
jmp 0x214d1
movq %r14, %rdi
callq 0xc8b0
movl $0x3, %ebx
jmp 0x214d1
xorl %ebx, %ebx
movl %ebx, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq