// File: /workspace/github_c_makefile_star2_O1/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 $0x38, %rsp
movq %rcx, %rbx
movl %edx, %r14d
movq %rdi, %r15
testq %r8, %r8
je 0x3abe4
movb (%r8), %dil
movb 0x1(%r8), %al
movl %eax, (%rsp)
movb 0x2(%r8), %al
movl %eax, 0x4(%rsp)
jmp 0x3abf5
movl $0x0, 0x4(%rsp)
movl $0x0, (%rsp)
xorl %edi, %edi
cmpw %r14w, %si
movl %r14d, %r12d
cmoval %esi, %r12d
cmovbl %esi, %r14d
testq %rbx, %rbx
jne 0x3ac28
ucomisd 0xba3f(%rip), %xmm0     # 0x46650
setp %al
setne %cl
orb %al, %cl
testb %dil, %dil
setne %dl
andb %cl, %dl
movb $0x1, %al
cmpb $0x1, %dl
jne 0x3ac2a
xorl %eax, %eax
movl %edi, 0x24(%rsp)
movsd %xmm0, 0x30(%rsp)
movzwl %r14w, %edx
movzbl %al, %r13d
movq %r15, %rdi
xorl %esi, %esi
movq %rdx, 0x28(%rsp)
movl $0x1, %ecx
movl %r13d, %r8d
callq 0x39aa6
movl %eax, %ebp
testl %eax, %eax
jne 0x3ac71
movzwl %r12w, %edx
movq %r15, %rdi
xorl %esi, %esi
movl $0x1, %ecx
movl %r13d, %r8d
callq 0x39aa6
movl %eax, %ebp
testl %ebp, %ebp
jne 0x3ae85
movzwl 0xf8(%r15), %eax
cmpw %ax, %r14w
jb 0x3ad29
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
shrl %eax
orl %r14d, %eax
movl $0xffff, %esi           # imm = 0xFFFF
movl %eax, %ecx
andl %esi, %ecx
shrl $0x2, %ecx
orl %eax, %ecx
movl %ecx, %eax
andl %esi, %eax
shrl $0x4, %eax
orl %ecx, %eax
movzbl %ah, %ecx
orl %eax, %ecx
movq %rcx, 0x10(%rsp)
leal 0x1(%rcx), %r13d
movq 0xf0(%r15), %rdi
andl %r13d, %esi
shll $0x3, %esi
callq 0xcbf0
movl $0x1, %ebp
testq %rax, %rax
je 0x3ae85
movq 0x18(%rsp), %rsi
cmpw %r13w, %si
jae 0x3ad11
leaq (%rax,%rsi,8), %rdi
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rdx
subl %esi, %edx
movzwl %dx, %eax
leaq 0x8(,%rax,8), %rdx
xorl %esi, %esi
callq 0xc640
movq 0x8(%rsp), %rax
movq %rax, 0xf0(%r15)
movw %r13w, 0xf8(%r15)
testq %rax, %rax
je 0x3ae85
movzwl 0x118(%r15), %eax
cmpw %ax, %r12w
jb 0x3add8
movq %rax, 0x18(%rsp)
movzwl %r12w, %eax
shrl %eax
orl %r12d, %eax
movl $0xffff, %esi           # imm = 0xFFFF
movl %eax, %ecx
andl %esi, %ecx
shrl $0x2, %ecx
orl %eax, %ecx
movl %ecx, %eax
andl %esi, %eax
shrl $0x4, %eax
orl %ecx, %eax
movzbl %ah, %ecx
orl %eax, %ecx
movq %rcx, 0x10(%rsp)
leal 0x1(%rcx), %r13d
movq 0x110(%r15), %rdi
andl %r13d, %esi
shll $0x3, %esi
callq 0xcbf0
movl $0x1, %ebp
testq %rax, %rax
je 0x3ae85
movq 0x18(%rsp), %rsi
cmpw %r13w, %si
jae 0x3adc0
leaq (%rax,%rsi,8), %rdi
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rdx
subl %esi, %edx
movzwl %dx, %eax
leaq 0x8(,%rax,8), %rdx
xorl %esi, %esi
callq 0xc640
movq 0x8(%rsp), %rax
movq %rax, 0x110(%r15)
movw %r13w, 0x118(%r15)
testq %rax, %rax
je 0x3ae85
movl $0x1, %edi
movl $0x20, %esi
callq 0xc7f0
testq %rax, %rax
je 0x3ae96
movq %rax, %r13
movzbl (%rsp), %ecx
cmpb $0x7, %cl
movl $0x7, %eax
cmovbl %ecx, %eax
cmpb 0x1ab(%r15), %al
jbe 0x3ae12
movb %al, 0x1ab(%r15)
movw %r14w, (%r13)
movw %r12w, 0x2(%r13)
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x8(%r13)
movq %rbx, 0x10(%r13)
movl 0x24(%rsp), %ecx
movb %cl, 0x18(%r13)
movb %al, 0x19(%r13)
movl 0x4(%rsp), %eax
movb %al, 0x1a(%r13)
movq 0xf0(%r15), %rax
movq 0x28(%rsp), %rbp
shll $0x3, %ebp
movq (%rax,%rbp), %rdi
callq 0xc0c0
movq 0xf0(%r15), %rax
movq %r13, (%rax,%rbp)
movq 0x110(%r15), %rax
movzwl %r14w, %ecx
movq %rbx, (%rax,%rcx,8)
incl %r14d
cmpw %r12w, %r14w
jbe 0x3ae63
movb $0x1, 0x11a(%r15)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xf21c
movl $0x1, %ebp
jmp 0x3ae85