// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
leaq -0xc0(%rbp), %rdi
xorl %esi, %esi
movl $0x80, %edx
callq 0xc6a0
movq $0x0, -0xc8(%rbp)
movq $0x0, -0xd0(%rbp)
movl $0x1, -0xd4(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x2e6e7
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
je 0x2e576
jmp 0x2e6d6
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x98(%rax), %rax
cmpq $0x0, (%rax)
jne 0x2e598
jmp 0x2e6d6
movq -0x28(%rbp), %rax
movq 0x98(%rax), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x2e6d4
leaq -0xc0(%rbp), %rdi
movl -0xd4(%rbp), %ecx
movl %ecx, %eax
addl $0x1, %eax
movl %eax, -0xd4(%rbp)
movl $0x80, %esi
leaq 0x3a649(%rip), %rdx     # 0x68c22
movb $0x0, %al
callq 0xc5d0
callq 0xc4c0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x2e60c
movl $0x1, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x2e608
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2e6ee
jmp 0x2e60a
jmp 0x2e60c
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rdx
leaq -0xc8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0xceb0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x2e650
movq -0x30(%rbp), %rdi
callq 0xc930
movl $0x3, -0x4(%rbp)
jmp 0x2e6ee
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rdi
callq 0xc9d0
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rsi
leaq -0xc0(%rbp), %r8
leaq -0xc8(%rbp), %rdx
leaq -0xd0(%rbp), %rcx
callq 0x2fd50
movl %eax, -0x3c(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
callq 0xc460
movq -0xc8(%rbp), %rdi
callq 0xc0d0
movq -0x30(%rbp), %rdi
callq 0xc930
cmpl $0x0, -0x3c(%rbp)
je 0x2e6bc
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2e6ee
jmp 0x2e6be
jmp 0x2e6c0
movq -0x38(%rbp), %rax
movq 0x1078(%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x2e5aa
jmp 0x2e6d6
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x2e55d
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xe0, %rsp
popq %rbp
retq
nopw (%rax,%rax)