// File: /workspace/github_c_makefile_star2_O2/Paxa[P]fast_excel/libxlsxwriter/src/worksheet.c
// Function: worksheet_set_column_opt
lxw_error
worksheet_set_column_opt(lxw_worksheet *self,
                         lxw_col_t firstcol,
                         lxw_col_t lastcol,
                         double width,
                         lxw_format *format,
                         lxw_row_col_options *user_options)
{
    lxw_col_options *copied_options;
    uint8_t ignore_row = LXW_TRUE;
    uint8_t ignore_col = LXW_TRUE;
    uint8_t hidden = LXW_FALSE;
    uint8_t level = 0;
    uint8_t collapsed = LXW_FALSE;
    lxw_col_t col;
    lxw_error err;

    if (user_options) {
        hidden = user_options->hidden;
        level = user_options->level;
        collapsed = user_options->collapsed;
    }

    /* Ensure second col is larger than first. */
    if (firstcol > lastcol) {
        lxw_col_t tmp = firstcol;
        firstcol = lastcol;
        lastcol = tmp;
    }

    /* Ensure that the cols are valid and store max and min values.
     * NOTE: The check shouldn't modify the row dimensions and should only
     *       modify the column dimensions in certain cases. */
    if (format != NULL || (width != LXW_DEF_COL_WIDTH && hidden))
        ignore_col = LXW_FALSE;

    err = _check_dimensions(self, 0, firstcol, ignore_row, ignore_col);

    if (!err)
        err = _check_dimensions(self, 0, lastcol, ignore_row, ignore_col);

    if (err)
        return err;

    /* Resize the col_options array if required. */
    if (firstcol >= self->col_options_max) {
        lxw_col_t col_tmp;
        lxw_col_t old_size = self->col_options_max;
        lxw_col_t new_size = _next_power_of_two(firstcol + 1);
        lxw_col_options **new_ptr = realloc(self->col_options,
                                            new_size *
                                            sizeof(lxw_col_options *));

        if (new_ptr) {
            for (col_tmp = old_size; col_tmp < new_size; col_tmp++)
                new_ptr[col_tmp] = NULL;

            self->col_options = new_ptr;
            self->col_options_max = new_size;
        }
        else {
            return LXW_ERROR_MEMORY_MALLOC_FAILED;
        }
    }

    /* Resize the col_formats array if required. */
    if (lastcol >= self->col_formats_max) {
        lxw_col_t col;
        lxw_col_t old_size = self->col_formats_max;
        lxw_col_t new_size = _next_power_of_two(lastcol + 1);
        lxw_format **new_ptr = realloc(self->col_formats,
                                       new_size * sizeof(lxw_format *));

        if (new_ptr) {
            for (col = old_size; col < new_size; col++)
                new_ptr[col] = NULL;

            self->col_formats = new_ptr;
            self->col_formats_max = new_size;
        }
        else {
            return LXW_ERROR_MEMORY_MALLOC_FAILED;
        }
    }

    /* Store the column options. */
    copied_options = calloc(1, sizeof(lxw_col_options));
    RETURN_ON_MEM_ERROR(copied_options, LXW_ERROR_MEMORY_MALLOC_FAILED);

    /* Ensure the level is <= 7). */
    if (level > 7)
        level = 7;

    if (level > self->outline_col_level)
        self->outline_col_level = level;

    /* Set the column properties. */
    copied_options->firstcol = firstcol;
    copied_options->lastcol = lastcol;
    copied_options->width = width;
    copied_options->format = format;
    copied_options->hidden = hidden;
    copied_options->level = level;
    copied_options->collapsed = collapsed;

    free(self->col_options[firstcol]);
    self->col_options[firstcol] = copied_options;

    /* Store the column formats for use when writing cell data. */
    for (col = firstcol; col <= lastcol; col++) {
        self->col_formats[col] = format;
    }

    /* Store the column change to allow optimizations. */
    self->col_size_changed = LXW_TRUE;

    return LXW_NO_ERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rbx
movl %edx, %r14d
movq %rdi, %r15
testq %r8, %r8
je 0x37dbb
movb (%r8), %dil
movb 0x1(%r8), %al
movl %eax, 0x4(%rsp)
movb 0x2(%r8), %al
movl %eax, 0x8(%rsp)
jmp 0x37dcd
movl $0x0, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
xorl %edi, %edi
cmpw %r14w, %si
movl %r14d, %r12d
cmoval %esi, %r12d
cmovbl %esi, %r14d
testq %rbx, %rbx
jne 0x37e00
ucomisd 0xb93f(%rip), %xmm0     # 0x43728
setp %al
setne %cl
orb %al, %cl
testb %dil, %dil
setne %dl
andb %cl, %dl
movb $0x1, %al
cmpb $0x1, %dl
jne 0x37e02
xorl %eax, %eax
movl %edi, 0xc(%rsp)
movsd %xmm0, 0x20(%rsp)
movzwl %r14w, %ebp
movzbl %al, %r13d
pushq $0x1
popq %rcx
movq %r15, %rdi
xorl %esi, %esi
movl %ebp, %edx
movl %r13d, %r8d
callq 0x36a6c
testl %eax, %eax
jne 0x37fe1
movq %rbp, 0x18(%rsp)
movzwl %r12w, %edx
pushq $0x1
popq %rbp
movq %r15, %rdi
xorl %esi, %esi
movl %ebp, %ecx
movl %r13d, %r8d
callq 0x36a6c
testl %eax, %eax
jne 0x37fe1
movzwl 0xf8(%r15), %r13d
cmpw %r13w, %r14w
movq %rbx, 0x10(%rsp)
jb 0x37eb2
leal 0x1(%r14), %eax
movzwl %ax, %edi
callq 0x37ff0
movq 0xf0(%r15), %rdi
movzwl %ax, %ebx
leal (,%rbx,8), %esi
callq 0xcc60
testq %rax, %rax
je 0x37fdf
cmpq %rbx, %r13
jae 0x37e9e
andq $0x0, (%rax,%r13,8)
incq %r13
jmp 0x37e8f
movq %rax, 0xf0(%r15)
movw %bx, 0xf8(%r15)
movq 0x10(%rsp), %rbx
movzwl 0x118(%r15), %r13d
cmpw %r13w, %r12w
jb 0x37f0f
leal 0x1(%r12), %eax
movzwl %ax, %edi
callq 0x37ff0
movq 0x110(%r15), %rdi
movzwl %ax, %ebx
leal (,%rbx,8), %esi
callq 0xcc60
testq %rax, %rax
je 0x37fdf
cmpq %rbx, %r13
jae 0x37efb
andq $0x0, (%rax,%r13,8)
incq %r13
jmp 0x37eec
movq %rax, 0x110(%r15)
movw %bx, 0x118(%r15)
movq 0x10(%rsp), %rbx
pushq $0x1
popq %rdi
pushq $0x20
popq %rsi
callq 0xc850
testq %rax, %rax
je 0x37fbb
movq %rax, %r13
movzbl 0x4(%rsp), %ecx
cmpb $0x7, %cl
pushq $0x7
popq %rax
cmovbl %ecx, %eax
cmpb 0x1ab(%r15), %al
jbe 0x37f44
movb %al, 0x1ab(%r15)
movw %r14w, (%r13)
movw %r12w, 0x2(%r13)
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x8(%r13)
movq %rbx, 0x10(%r13)
movl 0xc(%rsp), %ecx
movb %cl, 0x18(%r13)
movb %al, 0x19(%r13)
movl 0x8(%rsp), %eax
movb %al, 0x1a(%r13)
movq 0xf0(%r15), %rax
movq 0x18(%rsp), %rbp
shll $0x3, %ebp
movq (%rax,%rbp), %rdi
callq 0xc0d0
movq 0xf0(%r15), %rax
movq %r13, (%rax,%rbp)
cmpw %r12w, %r14w
ja 0x37faf
movq 0x110(%r15), %rax
movzwl %r14w, %ecx
movq %rbx, (%rax,%rcx,8)
incl %r14d
jmp 0x37f95
movb $0x1, 0x11a(%r15)
xorl %eax, %eax
jmp 0x37fe1
movq 0x1b036(%rip), %rax     # 0x52ff8
movq (%rax), %rdi
leaq 0x5114(%rip), %rsi      # 0x3d0e0
leaq 0xba0d(%rip), %rdx      # 0x439e0
movl $0x2206, %ecx           # imm = 0x2206
xorl %eax, %eax
callq 0xc8d0
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq