// File: /workspace/github_c_makefile_star2_O2/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 %rsp, %rax
andq $0x0, 0x6(%rax)
movq %rdx, %r12
andq $0x0, (%rax)
movq %rsi, %r14
movq %rdi, %rbx
movl (%rsi), %esi
movzwl 0x4(%r14), %r15d
movq %rax, %rdi
movl %r15d, %edx
callq 0xca60
movq 0x10(%r14), %rdi
testq %rdi, %rdi
jne 0x3012c
movq %r12, %rdi
testq %r12, %r12
je 0x3034a
callq 0xca20
movl %eax, %ebp
movl 0x8(%r14), %eax
decl %eax
cmpl $0x3, %eax
ja 0x3021e
leaq 0x1364f(%rip), %rcx     # 0x43798
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%rbx), %rdi
movsd 0x20(%r14), %xmm0
testl %ebp, %ebp
je 0x3038c
leaq 0x154a8(%rip), %rsi     # 0x45612
movq %rsp, %rdx
movl %ebp, %ecx
movb $0x1, %al
callq 0xc8d0
jmp 0x30569
movq 0x20(%r14), %rdi
callq 0xc570
movq %rax, %r14
callq 0xd170
movq (%rax), %r15
movzbl (%r14), %eax
testb $0x20, 0x1(%r15,%rax,2)
jne 0x30324
movq %r14, %rdi
callq 0xc4c0
movzbl -0x1(%r14,%rax), %eax
testb $0x20, 0x1(%r15,%rax,2)
jne 0x30324
movq (%rbx), %rdi
testl %ebp, %ebp
je 0x304cd
leaq 0x15556(%rip), %rsi     # 0x45721
jmp 0x30336
movq 0x20(%r14), %r8
movq (%rbx), %rdi
testl %ebp, %ebp
je 0x30373
leaq 0x155a0(%rip), %rsi     # 0x45786
movq %rsp, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0xc8d0
jmp 0x30569
movq (%rbx), %rdi
movl 0x20(%r14), %r8d
testl %ebp, %ebp
je 0x303a2
leaq 0x15442(%rip), %rsi     # 0x4564f
movq %rsp, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0xc8d0
jmp 0x30569
leaq 0x10(%rsp), %r12
andq $0x0, (%r12)
movq %r12, 0x8(%r12)
leaq 0xe045(%rip), %rdi      # 0x3e279
movq %rsp, %rsi
callq 0xc030
leaq 0x1040(%rax), %rcx
andq $0x0, 0x1040(%rax)
movq 0x8(%r12), %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%r12)
testl %ebp, %ebp
je 0x30287
movslq %ebp, %rsi
leaq 0x13c2b(%rip), %rdi     # 0x43e91
callq 0xc1a0
andq $0x0, 0x1040(%rax)
leaq 0x1040(%rax), %rcx
movq 0x18(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x18(%rsp)
movl 0x8(%r14), %eax
addl $-0x5, %eax
cmpl $0x4, %eax
ja 0x3055f
leaq 0x1350a(%rip), %rcx     # 0x437a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpq $0x0, 0x38(%r14)
je 0x302dd
leaq 0xdfd4(%rip), %rdi      # 0x3e289
leaq 0xcecc(%rip), %rsi      # 0x3d188
callq 0xc030
andq $0x0, 0x1040(%rax)
leaq 0x1040(%rax), %rcx
movq 0x18(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x18(%rsp)
movq (%rbx), %rdi
leaq 0xf7d9(%rip), %rsi      # 0x3fac0
leaq 0x10(%rsp), %rdx
callq 0xc380
cmpq $0x0, 0x38(%r14)
je 0x304eb
movq (%rbx), %rdi
movq 0x20(%r14), %rdx
leaq 0xde13(%rip), %rsi      # 0x3e11d
xorl %ecx, %ecx
callq 0xcba0
movq (%rbx), %rdi
movq 0x38(%r14), %rdx
leaq 0xddf1(%rip), %rsi      # 0x3e110
jmp 0x3052c
movq (%rbx), %rdi
testl %ebp, %ebp
je 0x303bb
leaq 0x1535c(%rip), %rsi     # 0x45692
movq %rsp, %rdx
movl %ebp, %ecx
movq %r14, %r8
xorl %eax, %eax
callq 0xc8d0
jmp 0x304e1
xorl %ebp, %ebp
cmpw 0x118(%rbx), %r15w
jae 0x30133
movq 0x110(%rbx), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
jne 0x3012c
jmp 0x30133
leaq 0x1543b(%rip), %rsi     # 0x457b5
movq %rsp, %rdx
movq %r8, %rcx
xorl %eax, %eax
callq 0xc8d0
jmp 0x30569
leaq 0x152a1(%rip), %rsi     # 0x45634
movq %rsp, %rdx
movb $0x1, %al
callq 0xc8d0
jmp 0x30569
leaq 0x152cb(%rip), %rsi     # 0x45674
movq %rsp, %rdx
movl %r8d, %ecx
xorl %eax, %eax
callq 0xc8d0
jmp 0x30569
leaq 0x1531b(%rip), %rsi     # 0x456dd
jmp 0x304d4
leaq 0xdebb(%rip), %rdi      # 0x3e289
leaq 0xcc30(%rip), %rsi      # 0x3d005
callq 0xc030
leaq 0x1040(%rax), %rcx
andq $0x0, 0x1040(%rax)
leaq 0x10(%rsp), %rdx
movq 0x8(%rdx), %rsi
movq %rax, (%rsi)
movq %rcx, 0x8(%rdx)
movq (%rbx), %rdi
leaq 0xf6bd(%rip), %r15      # 0x3fac0
movq %r15, %rsi
callq 0xc380
xorpd %xmm0, %xmm0
ucomisd 0x20(%r14), %xmm0
setnp %al
sete %cl
andb %al, %cl
xorb $0x31, %cl
leaq 0x20(%rsp), %rdx
movb %cl, (%rdx)
movb $0x0, 0x1(%rdx)
movq (%rbx), %rdi
leaq 0xdcdb(%rip), %rsi      # 0x3e110
xorl %ecx, %ecx
callq 0xcba0
jmp 0x304c5
leaq 0x151c7(%rip), %rdi     # 0x4560f
leaq 0x122f9(%rip), %rsi     # 0x42748
callq 0xc030
leaq 0x1040(%rax), %rcx
andq $0x0, 0x1040(%rax)
leaq 0x10(%rsp), %rdx
movq 0x8(%rdx), %rsi
movq %rax, (%rsi)
movq %rcx, 0x8(%rdx)
movq (%rbx), %rdi
leaq 0xf643(%rip), %r15      # 0x3fac0
jmp 0x304b2
cmpq $0x0, 0x10(%r14)
je 0x3055f
movq (%rbx), %rdi
leaq 0xf62c(%rip), %rsi      # 0x3fac0
leaq 0x10(%rsp), %rdx
callq 0xcc70
jmp 0x3055f
movq (%rbx), %rdi
leaq 0xf613(%rip), %r15      # 0x3fac0
leaq 0x10(%rsp), %rdx
movq %r15, %rsi
callq 0xc380
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3b0cc
movq (%rbx), %rdi
movq %r15, %rsi
jmp 0x3053d
leaq 0x15283(%rip), %rsi     # 0x45757
movq %rsp, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0xc8d0
movq %r14, %rdi
callq 0xc0d0
jmp 0x30569
movsd 0x28(%r14), %xmm0
leaq 0xdc41(%rip), %rdx      # 0x3e139
leaq 0x20(%rsp), %r15
pushq $0x20
popq %rsi
movq %r15, %rdi
movb $0x1, %al
callq 0xc5b0
movq (%rbx), %rdi
movq 0x20(%r14), %rdx
leaq 0xdc05(%rip), %rsi      # 0x3e11d
xorl %ecx, %ecx
callq 0xcba0
movq (%rbx), %rdi
leaq 0xdbe7(%rip), %rsi      # 0x3e110
movq %r15, %rdx
xorl %ecx, %ecx
callq 0xcba0
movq (%rbx), %rdi
leaq 0xf583(%rip), %rsi      # 0x3fac0
callq 0xc060
jmp 0x3055f
movq 0x1040(%rdi), %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
jne 0x3055a
movq %r12, 0x18(%rsp)
callq 0xc0d0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
jne 0x30544
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq