// File: /workspace/github_c_makefile_star2_O3/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 0x30253
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 0x30253
movq 0x10(%r14), %rax
movq (%rax,%rbp,8), %r13
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x301fe
callq 0xd0d0
cmpq $0x100, %rax            # imm = 0x100
jae 0x30264
movq (%rbx), %rdi
callq 0xcce0
testq %rax, %rax
je 0x30270
movq %rax, %r15
movq (%r13), %rdi
callq 0xc0c0
movq %r15, (%r13)
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x30215
callq 0xcce0
testq %rax, %rax
je 0x30277
movq %rax, 0x10(%r13)
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x3022c
callq 0xd060
testq %rax, %rax
je 0x3027e
movq %rax, 0x8(%r13)
movsd 0x30(%rbx), %xmm0
movsd %xmm0, 0x30(%r13)
movups 0x20(%rbx), %xmm0
movups %xmm0, 0x20(%r13)
movb 0x18(%rbx), %al
movb %al, 0x18(%r13)
incq %rbp
cmpq %rbp, %r12
jne 0x301ab
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xe91d
movl $0x14, %eax
jmp 0x30255
callq 0xe8f9
jmp 0x30283
callq 0xe939
jmp 0x30283
callq 0xe95d
movl $0x1, %eax
jmp 0x30255