// File: /workspace/github_c_makefile_star2_O3/Paxa[P]fast_excel/libxlsxwriter/src/worksheet.c
// Function: write_cell
STATIC void
_write_cell(lxw_worksheet *self, lxw_cell *cell, lxw_format *row_format)
{
    struct xml_attribute_list attributes;
    struct xml_attribute *attribute;
    char range[LXW_MAX_CELL_NAME_LENGTH] = { 0 };
    lxw_row_t row_num = cell->row_num;
    lxw_col_t col_num = cell->col_num;
    int32_t style_index = 0;

    lxw_rowcol_to_cell(range, row_num, col_num);

    if (cell->format) {
        style_index = lxw_format_get_xf_index(cell->format);
    }
    else if (row_format) {
        style_index = lxw_format_get_xf_index(row_format);
    }
    else if (col_num < self->col_formats_max && self->col_formats[col_num]) {
        style_index = lxw_format_get_xf_index(self->col_formats[col_num]);
    }

    /* Unrolled optimization for most commonly written cell types. */
    if (cell->type == NUMBER_CELL) {
        _write_number_cell(self, range, style_index, cell);
        return;
    }

    if (cell->type == STRING_CELL) {
        _write_string_cell(self, range, style_index, cell);
        return;
    }

    if (cell->type == INLINE_STRING_CELL) {
        _write_inline_string_cell(self, range, style_index, cell);
        return;
    }

    if (cell->type == INLINE_RICH_STRING_CELL) {
        _write_inline_rich_string_cell(self, range, style_index, cell);
        return;
    }

    /* For other cell types use the general functions. */
    LXW_INIT_ATTRIBUTES();
    LXW_PUSH_ATTRIBUTES_STR("r", range);

    if (style_index)
        LXW_PUSH_ATTRIBUTES_INT("s", style_index);

    if (cell->type == FORMULA_CELL) {
        /* If user_data2 is set then the formula has a string result. */
        if (cell->user_data2)
            LXW_PUSH_ATTRIBUTES_STR("t", "str");

        lxw_xml_start_tag(self->file, "c", &attributes);

        if (cell->user_data2)
            _write_formula_str_cell(self, cell);
        else
            _write_formula_num_cell(self, cell);

        lxw_xml_end_tag(self->file, "c");
    }
    else if (cell->type == BLANK_CELL) {
        if (cell->format)
            lxw_xml_empty_tag(self->file, "c", &attributes);
    }
    else if (cell->type == BOOLEAN_CELL) {
        LXW_PUSH_ATTRIBUTES_STR("t", "b");
        lxw_xml_start_tag(self->file, "c", &attributes);
        _write_boolean_cell(self, cell);
        lxw_xml_end_tag(self->file, "c");
    }
    else if (cell->type == ARRAY_FORMULA_CELL) {
        lxw_xml_start_tag(self->file, "c", &attributes);
        _write_array_formula_num_cell(self, cell);
        lxw_xml_end_tag(self->file, "c");
    }
    else if (cell->type == DYNAMIC_ARRAY_FORMULA_CELL) {
        LXW_PUSH_ATTRIBUTES_STR("cm", "1");
        lxw_xml_start_tag(self->file, "c", &attributes);
        _write_array_formula_num_cell(self, cell);
        lxw_xml_end_tag(self->file, "c");
    }

    LXW_FREE_ATTRIBUTES();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
xorl %eax, %eax
leaq 0x10(%rsp), %rdi
movq %rax, 0x6(%rdi)
movq %rax, (%rdi)
movl (%rsi), %esi
movzwl 0x4(%r14), %r15d
movl %r15d, %edx
callq 0xca00
movq 0x10(%r14), %rdi
testq %rdi, %rdi
jne 0x330a8
movq %r12, %rdi
testq %r12, %r12
je 0x332da
callq 0xc9c0
movl %eax, %ebp
movl 0x8(%r14), %eax
decl %eax
cmpl $0x3, %eax
ja 0x331a0
leaq 0x136f3(%rip), %rcx     # 0x467b8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%rbx), %rdi
movsd 0x20(%r14), %xmm0
testl %ebp, %ebp
je 0x3331e
leaq 0x15540(%rip), %rsi     # 0x48626
leaq 0x10(%rsp), %rdx
movl %ebp, %ecx
movb $0x1, %al
callq 0xc870
jmp 0x334ba
movq 0x20(%r14), %rdi
callq 0xc530
movq %rax, %r14
callq 0xd0f0
movq (%rax), %r15
movzbl (%r14), %eax
testb $0x20, 0x1(%r15,%rax,2)
jne 0x332b2
movq %r14, %rdi
callq 0xc480
movzbl -0x1(%r14,%rax), %eax
testb $0x20, 0x1(%r15,%rax,2)
jne 0x332b2
movq (%rbx), %rdi
testl %ebp, %ebp
je 0x3345b
leaq 0x155ec(%rip), %rsi     # 0x48735
jmp 0x332c4
movq 0x20(%r14), %r8
movq (%rbx), %rdi
testl %ebp, %ebp
je 0x33303
leaq 0x15636(%rip), %rsi     # 0x4879a
leaq 0x10(%rsp), %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0xc870
jmp 0x334ba
movq (%rbx), %rdi
movl 0x20(%r14), %r8d
testl %ebp, %ebp
je 0x33336
leaq 0x154d6(%rip), %rsi     # 0x48663
leaq 0x10(%rsp), %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0xc870
jmp 0x334ba
xorl %r15d, %r15d
movq %rsp, %r12
movq %r15, (%r12)
movq %r12, 0x8(%r12)
leaq 0xe0c3(%rip), %rdi      # 0x41279
leaq 0x10(%rsp), %rsi
callq 0xc030
leaq 0x1040(%rax), %rcx
movq %r15, 0x1040(%rax)
movq 0x8(%r12), %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%r12)
testl %ebp, %ebp
je 0x3320d
movslq %ebp, %rsi
leaq 0x13cbc(%rip), %rdi     # 0x46ea5
callq 0xc180
leaq 0x1040(%rax), %rcx
movq $0x0, 0x1040(%rax)
movq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rsp)
movl 0x8(%r14), %eax
addl $-0x5, %eax
cmpl $0x4, %eax
ja 0x334b1
leaq 0x135a4(%rip), %rcx     # 0x467c8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpq $0x0, 0x38(%r14)
je 0x33266
leaq 0xe04e(%rip), %rdi      # 0x41289
leaq 0xcf46(%rip), %rsi      # 0x40188
callq 0xc030
leaq 0x1040(%rax), %rcx
movq $0x0, 0x1040(%rax)
movq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rsp)
movq (%rbx), %rdi
leaq 0xf850(%rip), %rsi      # 0x42ac0
movq %rsp, %rdx
callq 0xc350
cmpq $0x0, 0x38(%r14)
je 0x3347b
movq (%rbx), %rdi
movq 0x20(%r14), %rdx
leaq 0xde8c(%rip), %rsi      # 0x4111d
xorl %ecx, %ecx
callq 0xcb30
movq (%rbx), %rdi
movq 0x38(%r14), %rdx
leaq 0xde6a(%rip), %rsi      # 0x41110
xorl %ecx, %ecx
callq 0xcb30
jmp 0x33486
movq (%rbx), %rdi
testl %ebp, %ebp
je 0x33351
leaq 0x153e2(%rip), %rsi     # 0x486a6
leaq 0x10(%rsp), %rdx
movl %ebp, %ecx
movq %r14, %r8
xorl %eax, %eax
callq 0xc870
jmp 0x33471
xorl %ebp, %ebp
cmpw 0x118(%rbx), %r15w
jae 0x330af
movq 0x110(%rbx), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
jne 0x330a8
jmp 0x330af
leaq 0x154bf(%rip), %rsi     # 0x487c9
leaq 0x10(%rsp), %rdx
movq %r8, %rcx
xorl %eax, %eax
callq 0xc870
jmp 0x334ba
leaq 0x15323(%rip), %rsi     # 0x48648
leaq 0x10(%rsp), %rdx
movb $0x1, %al
callq 0xc870
jmp 0x334ba
leaq 0x1534b(%rip), %rsi     # 0x48688
leaq 0x10(%rsp), %rdx
movl %r8d, %ecx
xorl %eax, %eax
callq 0xc870
jmp 0x334ba
leaq 0x15399(%rip), %rsi     # 0x486f1
jmp 0x33462
leaq 0xdf25(%rip), %rdi      # 0x41289
leaq 0xcc9a(%rip), %rsi      # 0x40005
callq 0xc030
leaq 0x1040(%rax), %rcx
movq $0x0, 0x1040(%rax)
movq %rsp, %rdx
movq 0x8(%rdx), %rsi
movq %rax, (%rsi)
movq %rcx, 0x8(%rdx)
movq (%rbx), %rdi
leaq 0xf726(%rip), %r15      # 0x42ac0
movq %r15, %rsi
callq 0xc350
xorpd %xmm0, %xmm0
ucomisd 0x20(%r14), %xmm0
movq (%rbx), %rdi
setnp %al
sete %cl
andb %al, %cl
xorb $0x31, %cl
leaq 0x20(%rsp), %rdx
movb %cl, (%rdx)
movb $0x0, 0x1(%rdx)
leaq 0xdd44(%rip), %rsi      # 0x41110
xorl %ecx, %ecx
callq 0xcb30
jmp 0x33453
leaq 0x15247(%rip), %rdi     # 0x48623
leaq 0x12365(%rip), %rsi     # 0x45748
callq 0xc030
leaq 0x1040(%rax), %rcx
movq $0x0, 0x1040(%rax)
movq %rsp, %rdx
movq 0x8(%rdx), %rsi
movq %rax, (%rsi)
movq %rcx, 0x8(%rdx)
movq (%rbx), %rdi
leaq 0xf6ae(%rip), %r15      # 0x42ac0
jmp 0x33440
cmpq $0x0, 0x10(%r14)
je 0x334b1
movq (%rbx), %rdi
leaq 0xf697(%rip), %rsi      # 0x42ac0
movq %rsp, %rdx
callq 0xcc00
jmp 0x334b1
movq (%rbx), %rdi
leaq 0xf683(%rip), %r15      # 0x42ac0
movq %rsp, %rdx
movq %r15, %rsi
callq 0xc350
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3df79
movq (%rbx), %rdi
movq %r15, %rsi
jmp 0x33490
leaq 0x15309(%rip), %rsi     # 0x4876b
leaq 0x10(%rsp), %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0xc870
movq %r14, %rdi
callq 0xc0c0
jmp 0x334ba
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3df19
movq (%rbx), %rdi
leaq 0xf630(%rip), %rsi      # 0x42ac0
callq 0xc060
jmp 0x334b1
movq 0x1040(%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x334ac
movq %r12, 0x8(%rsp)
callq 0xc0c0
movq (%rsp), %rdi
testq %rdi, %rdi
jne 0x33497
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq