// File: /workspace/github_c_makefile_star2_O2/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
movq %rdi, %r14
movzwl 0x32(%rdi), %r12d
movq 0x18(%rsi), %rax
movq %rax, (%rsp)
xorl %ebp, %ebp
cmpq %rbp, %r12
je 0x2d015
movq (%rsp), %rax
movq (%rax,%rbp,8), %rbx
testq %rbx, %rbx
je 0x2d015
movq 0x10(%r14), %rax
movq (%rax,%rbp,8), %r13
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x2cfbc
callq 0xd150
cmpq $0x100, %rax            # imm = 0x100
jae 0x2d026
movq (%rbx), %rdi
callq 0xcd50
testq %rax, %rax
je 0x2d046
movq %rax, %r15
movq (%r13), %rdi
callq 0xc0d0
movq %r15, (%r13)
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x2cfd7
callq 0xcd50
testq %rax, %rax
je 0x2d065
movq %rax, 0x10(%r13)
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x2cff2
callq 0xd0e0
testq %rax, %rax
je 0x2d084
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
jmp 0x2cf60
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x25fcb(%rip), %rax     # 0x52ff8
movq (%rax), %rcx
leaq 0x16c24(%rip), %rdi     # 0x43c5b
pushq $0x5f
popq %rsi
pushq $0x1
popq %rdx
callq 0xd000
pushq $0x14
jmp 0x2d0aa
movq 0x25fab(%rip), %rax     # 0x52ff8
movq (%rax), %rdi
leaq 0x10089(%rip), %rsi     # 0x3d0e0
leaq 0x16982(%rip), %rdx     # 0x439e0
movl $0x6d9, %ecx            # imm = 0x6D9
jmp 0x2d0a1
movq 0x25f8c(%rip), %rax     # 0x52ff8
movq (%rax), %rdi
leaq 0x1006a(%rip), %rsi     # 0x3d0e0
leaq 0x16963(%rip), %rdx     # 0x439e0
movl $0x6e2, %ecx            # imm = 0x6E2
jmp 0x2d0a1
movq 0x25f6d(%rip), %rax     # 0x52ff8
movq (%rax), %rdi
leaq 0x1004b(%rip), %rsi     # 0x3d0e0
leaq 0x16944(%rip), %rdx     # 0x439e0
movl $0x6e9, %ecx            # imm = 0x6E9
xorl %eax, %eax
callq 0xc8d0
pushq $0x1
popq %rax
jmp 0x2d017