// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x3e(%rbp), %rdi
xorl %esi, %esi
movl $0xe, %edx
callq 0xc6a0
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x10(%rbp), %rax
movw 0x4(%rax), %ax
movw %ax, -0x46(%rbp)
movl $0x0, -0x4c(%rbp)
leaq -0x3e(%rbp), %rdi
movl -0x44(%rbp), %esi
movzwl -0x46(%rbp), %edx
callq 0xca90
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x4befd
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xca40
movl %eax, -0x4c(%rbp)
jmp 0x4bf5a
cmpq $0x0, -0x18(%rbp)
je 0x4bf12
movq -0x18(%rbp), %rdi
callq 0xca40
movl %eax, -0x4c(%rbp)
jmp 0x4bf58
movzwl -0x46(%rbp), %eax
movq -0x8(%rbp), %rcx
movzwl 0x118(%rcx), %ecx
cmpl %ecx, %eax
jge 0x4bf56
movq -0x8(%rbp), %rax
movq 0x110(%rax), %rax
movzwl -0x46(%rbp), %ecx
cmpq $0x0, (%rax,%rcx,8)
je 0x4bf56
movq -0x8(%rbp), %rax
movq 0x110(%rax), %rax
movzwl -0x46(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
callq 0xca40
movl %eax, -0x4c(%rbp)
jmp 0x4bf58
jmp 0x4bf5a
movq -0x10(%rbp), %rax
cmpl $0x1, 0x8(%rax)
jne 0x4bf7d
movq -0x8(%rbp), %rdi
leaq -0x3e(%rbp), %rsi
movl -0x4c(%rbp), %edx
movq -0x10(%rbp), %rcx
callq 0x5ad80
jmp 0x4c308
movq -0x10(%rbp), %rax
cmpl $0x2, 0x8(%rax)
jne 0x4bfa0
movq -0x8(%rbp), %rdi
leaq -0x3e(%rbp), %rsi
movl -0x4c(%rbp), %edx
movq -0x10(%rbp), %rcx
callq 0x5adf0
jmp 0x4c308
movq -0x10(%rbp), %rax
cmpl $0x3, 0x8(%rax)
jne 0x4bfc3
movq -0x8(%rbp), %rdi
leaq -0x3e(%rbp), %rsi
movl -0x4c(%rbp), %edx
movq -0x10(%rbp), %rcx
callq 0x5ae60
jmp 0x4c308
movq -0x10(%rbp), %rax
cmpl $0x4, 0x8(%rax)
jne 0x4bfe6
movq -0x8(%rbp), %rdi
leaq -0x3e(%rbp), %rsi
movl -0x4c(%rbp), %edx
movq -0x10(%rbp), %rcx
callq 0x5af90
jmp 0x4c308
jmp 0x4bfe8
movq $0x0, -0x28(%rbp)
leaq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x4bffa
leaq -0x3e(%rbp), %rsi
leaq 0x1b0c4(%rip), %rdi     # 0x670c9
callq 0xc030
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq $0x0, 0x1040(%rax)
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
addq $0x1040, %rax           # imm = 0x1040
movq %rax, -0x20(%rbp)
jmp 0x4c038
cmpl $0x0, -0x4c(%rbp)
je 0x4c080
jmp 0x4c040
movslq -0x4c(%rbp), %rsi
leaq 0x2085a(%rip), %rdi     # 0x6c8a5
callq 0xc1b0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq $0x0, 0x1040(%rax)
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
addq $0x1040, %rax           # imm = 0x1040
movq %rax, -0x20(%rbp)
jmp 0x4c07e
jmp 0x4c080
movq -0x10(%rbp), %rax
cmpl $0x5, 0x8(%rax)
jne 0x4c134
movq -0x10(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x4c0de
jmp 0x4c09b
leaq 0x1b037(%rip), %rdi     # 0x670d9
leaq 0x1a0cf(%rip), %rsi     # 0x66178
callq 0xc030
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq $0x0, 0x1040(%rax)
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
addq $0x1040, %rax           # imm = 0x1040
movq %rax, -0x20(%rbp)
jmp 0x4c0dc
jmp 0x4c0de
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x1c814(%rip), %rsi     # 0x68900
leaq -0x28(%rbp), %rdx
callq 0xc390
movq -0x10(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x4c10f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x5b000
jmp 0x4c11c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x5b060
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x1c7d6(%rip), %rsi     # 0x68900
callq 0xc060
jmp 0x4c2c0
movq -0x10(%rbp), %rax
cmpl $0x8, 0x8(%rax)
jne 0x4c165
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x4c160
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x1c7a9(%rip), %rsi     # 0x68900
leaq -0x28(%rbp), %rdx
callq 0xcca0
jmp 0x4c2be
movq -0x10(%rbp), %rax
cmpl $0x9, 0x8(%rax)
jne 0x4c1ee
jmp 0x4c171
leaq 0x1af61(%rip), %rdi     # 0x670d9
leaq 0x19e86(%rip), %rsi     # 0x66005
callq 0xc030
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq $0x0, 0x1040(%rax)
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
addq $0x1040, %rax           # imm = 0x1040
movq %rax, -0x20(%rbp)
jmp 0x4c1b2
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x1c740(%rip), %rsi     # 0x68900
leaq -0x28(%rbp), %rdx
callq 0xc390
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x5b0d0
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x1c71c(%rip), %rsi     # 0x68900
callq 0xc060
jmp 0x4c2bc
movq -0x10(%rbp), %rax
cmpl $0x6, 0x8(%rax)
jne 0x4c234
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x1c6fa(%rip), %rsi     # 0x68900
leaq -0x28(%rbp), %rdx
callq 0xc390
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x5b130
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x1c6d6(%rip), %rsi     # 0x68900
callq 0xc060
jmp 0x4c2ba
movq -0x10(%rbp), %rax
cmpl $0x7, 0x8(%rax)
jne 0x4c2b8
jmp 0x4c240
leaq 0x21de8(%rip), %rdi     # 0x6e02f
leaq 0x1f222(%rip), %rsi     # 0x6b470
callq 0xc030
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq $0x0, 0x1040(%rax)
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
addq $0x1040, %rax           # imm = 0x1040
movq %rax, -0x20(%rbp)
jmp 0x4c281
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x1c671(%rip), %rsi     # 0x68900
leaq -0x28(%rbp), %rdx
callq 0xc390
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x5b130
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x1c64d(%rip), %rsi     # 0x68900
callq 0xc060
jmp 0x4c2ba
jmp 0x4c2bc
jmp 0x4c2be
jmp 0x4c2c0
jmp 0x4c2c2
jmp 0x4c2c4
cmpq $0x0, -0x28(%rbp)
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x4c2d4
jmp 0x4c306
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq 0x1040(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x4c2f9
leaq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x4c2fb
movq -0x30(%rbp), %rdi
callq 0xc0d0
jmp 0x4c2c4
jmp 0x4c308
addq $0x50, %rsp
popq %rbp
retq
nop