// File: /workspace/github_c_makefile_star2_O1/Paxa[P]fast_excel/libxlsxwriter/src/worksheet.c
// Function: set_custom_table_columns
lxw_error
_set_custom_table_columns(lxw_table_obj *table_obj,
                          lxw_table_options *user_options)
{
    char *str;
    uint16_t i;
    lxw_table_column *table_column;
    lxw_table_column *user_column;
    uint16_t num_cols = table_obj->num_cols;
    lxw_table_column **user_columns = user_options->columns;

    for (i = 0; i < num_cols; i++) {

        user_column = user_columns[i];
        table_column = table_obj->columns[i];

        /* NULL indicates end of user input array. */
        if (user_column == NULL)
            return LXW_NO_ERROR;

        if (user_column->header) {
            if (lxw_utf8_strlen(user_column->header) > 255) {
                LXW_WARN_FORMAT("worksheet_add_table(): column parameter "
                                "'header' exceeds Excel length limit of 255.");
                return LXW_ERROR_255_STRING_LENGTH_EXCEEDED;
            }

            str = lxw_strdup(user_column->header);
            RETURN_ON_MEM_ERROR(str, LXW_ERROR_MEMORY_MALLOC_FAILED);

            /* Free the default column header. */
            free((void *) table_column->header);
            table_column->header = str;
        }

        if (user_column->total_string) {
            str = lxw_strdup(user_column->total_string);
            RETURN_ON_MEM_ERROR(str, LXW_ERROR_MEMORY_MALLOC_FAILED);

            table_column->total_string = str;
        }

        if (user_column->formula) {
            str = _expand_table_formula(user_column->formula);
            RETURN_ON_MEM_ERROR(str, LXW_ERROR_MEMORY_MALLOC_FAILED);

            table_column->formula = str;
        }

        table_column->format = user_column->format;
        table_column->total_value = user_column->total_value;
        table_column->header_format = user_column->header_format;
        table_column->total_function = user_column->total_function;
    }

    return LXW_NO_ERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movzwl 0x32(%rdi), %r12d
testq %r12, %r12
je 0x300e6
movq %rdi, %r14
movq 0x18(%rsi), %rax
movq %rax, (%rsp)
xorl %ebp, %ebp
movq (%rsp), %rax
movq (%rax,%rbp,8), %rbx
testq %rbx, %rbx
je 0x300e6
movq 0x10(%r14), %rax
movq (%rax,%rbp,8), %r13
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x30089
callq 0xd0d0
cmpq $0x100, %rax            # imm = 0x100
jae 0x300f7
movq (%rbx), %rdi
callq 0xcce0
testq %rax, %rax
je 0x30103
movq %rax, %r15
movq (%r13), %rdi
callq 0xc0c0
movq %r15, (%r13)
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x300a0
callq 0xcce0
testq %rax, %rax
je 0x3010a
movq %rax, 0x10(%r13)
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x300b7
callq 0xd060
testq %rax, %rax
je 0x30111
movq %rax, 0x8(%r13)
movq 0x28(%rbx), %rax
movq %rax, 0x28(%r13)
movsd 0x30(%rbx), %xmm0
movsd %xmm0, 0x30(%r13)
movq 0x20(%rbx), %rax
movq %rax, 0x20(%r13)
movb 0x18(%rbx), %al
movb %al, 0x18(%r13)
incq %rbp
cmpw %bp, %r12w
jne 0x30036
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xe633
movl $0x14, %eax
jmp 0x300e8
callq 0xe60f
jmp 0x30116
callq 0xe64f
jmp 0x30116
callq 0xe673
movl $0x1, %eax
jmp 0x300e8