// File: /workspace/github_c_makefile_star2_O1/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 0x32dc5
movq %r12, %rdi
testq %r12, %r12
je 0x32ff7
callq 0xc9c0
movl %eax, %ebp
movl 0x8(%r14), %eax
decl %eax
cmpl $0x3, %eax
ja 0x32ebd
leaq 0x138de(%rip), %rcx     # 0x466c0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%rbx), %rdi
movsd 0x20(%r14), %xmm0
testl %ebp, %ebp
je 0x3303b
leaq 0x1573a(%rip), %rsi     # 0x4853d
leaq 0x10(%rsp), %rdx
movl %ebp, %ecx
movb $0x1, %al
callq 0xc870
jmp 0x331d7
movq 0x20(%r14), %rdi
callq 0xc530
movq %rax, %r14
callq 0xd0f0
movq (%rax), %r15
movzbl (%r14), %eax
testb $0x20, 0x1(%r15,%rax,2)
jne 0x32fcf
movq %r14, %rdi
callq 0xc480
movzbl -0x1(%r14,%rax), %eax
testb $0x20, 0x1(%r15,%rax,2)
jne 0x32fcf
movq (%rbx), %rdi
testl %ebp, %ebp
je 0x33178
leaq 0x157e6(%rip), %rsi     # 0x4864c
jmp 0x32fe1
movq 0x20(%r14), %r8
movq (%rbx), %rdi
testl %ebp, %ebp
je 0x33020
leaq 0x15830(%rip), %rsi     # 0x486b1
leaq 0x10(%rsp), %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0xc870
jmp 0x331d7
movq (%rbx), %rdi
movl 0x20(%r14), %r8d
testl %ebp, %ebp
je 0x33053
leaq 0x156d0(%rip), %rsi     # 0x4857a
leaq 0x10(%rsp), %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0xc870
jmp 0x331d7
xorl %r15d, %r15d
movq %rsp, %r12
movq %r15, (%r12)
movq %r12, 0x8(%r12)
leaq 0xe3ae(%rip), %rdi      # 0x41281
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 0x32f2a
movslq %ebp, %rsi
leaq 0x13eb3(%rip), %rdi     # 0x46db9
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 0x331ce
leaq 0x1378f(%rip), %rcx     # 0x466d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpq $0x0, 0x38(%r14)
je 0x32f83
leaq 0xe339(%rip), %rdi      # 0x41291
leaq 0xd229(%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 0xfb23(%rip), %rsi      # 0x42ab0
movq %rsp, %rdx
callq 0xc350
cmpq $0x0, 0x38(%r14)
je 0x33198
movq (%rbx), %rdi
movq 0x20(%r14), %rdx
leaq 0xe177(%rip), %rsi      # 0x41125
xorl %ecx, %ecx
callq 0xcb30
movq (%rbx), %rdi
movq 0x38(%r14), %rdx
leaq 0xe155(%rip), %rsi      # 0x41118
xorl %ecx, %ecx
callq 0xcb30
jmp 0x331a3
movq (%rbx), %rdi
testl %ebp, %ebp
je 0x3306e
leaq 0x155dc(%rip), %rsi     # 0x485bd
leaq 0x10(%rsp), %rdx
movl %ebp, %ecx
movq %r14, %r8
xorl %eax, %eax
callq 0xc870
jmp 0x3318e
xorl %ebp, %ebp
cmpw 0x118(%rbx), %r15w
jae 0x32dcc
movq 0x110(%rbx), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
jne 0x32dc5
jmp 0x32dcc
leaq 0x156b9(%rip), %rsi     # 0x486e0
leaq 0x10(%rsp), %rdx
movq %r8, %rcx
xorl %eax, %eax
callq 0xc870
jmp 0x331d7
leaq 0x1551d(%rip), %rsi     # 0x4855f
leaq 0x10(%rsp), %rdx
movb $0x1, %al
callq 0xc870
jmp 0x331d7
leaq 0x15545(%rip), %rsi     # 0x4859f
leaq 0x10(%rsp), %rdx
movl %r8d, %ecx
xorl %eax, %eax
callq 0xc870
jmp 0x331d7
leaq 0x15593(%rip), %rsi     # 0x48608
jmp 0x3317f
leaq 0xe210(%rip), %rdi      # 0x41291
leaq 0xcf7d(%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 0xf9f9(%rip), %r15      # 0x42ab0
movq %r15, %rsi
callq 0xc350
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 0xe02f(%rip), %rsi      # 0x41118
xorl %ecx, %ecx
callq 0xcb30
jmp 0x33170
leaq 0x15441(%rip), %rdi     # 0x4853a
leaq 0x12638(%rip), %rsi     # 0x45738
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 0xf981(%rip), %r15      # 0x42ab0
jmp 0x3315d
cmpq $0x0, 0x10(%r14)
je 0x331ce
movq (%rbx), %rdi
leaq 0xf96a(%rip), %rsi      # 0x42ab0
movq %rsp, %rdx
callq 0xcc00
jmp 0x331ce
movq (%rbx), %rdi
leaq 0xf956(%rip), %r15      # 0x42ab0
movq %rsp, %rdx
movq %r15, %rsi
callq 0xc350
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3dd98
movq (%rbx), %rdi
movq %r15, %rsi
jmp 0x331ad
leaq 0x15503(%rip), %rsi     # 0x48682
leaq 0x10(%rsp), %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0xc870
movq %r14, %rdi
callq 0xc0c0
jmp 0x331d7
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3dd38
movq (%rbx), %rdi
leaq 0xf903(%rip), %rsi      # 0x42ab0
callq 0xc060
jmp 0x331ce
movq 0x1040(%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x331c9
movq %r12, 0x8(%rsp)
callq 0xc0c0
movq (%rsp), %rdi
testq %rdi, %rdi
jne 0x331b4
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq