// File: /workspace/github_c_makefile_star2_O0/Paxa[P]fast_excel/libxlsxwriter/src/worksheet.c
// Function: write_column_function
void
_write_column_function(lxw_worksheet *self, lxw_row_t row, lxw_col_t col,
                       lxw_table_column *column)
{
    size_t offset;
    char formula[LXW_MAX_ATTRIBUTE_LENGTH];
    lxw_format *format = column->format;
    uint8_t total_function = column->total_function;
    double value = column->total_value;
    const char *header = column->header;

    /* Write the subtotal formula number. */
    lxw_snprintf(formula, LXW_MAX_ATTRIBUTE_LENGTH, "SUBTOTAL(%d,[",
                 total_function);

    /* Copy the header string but escape any special characters. Note, this is
     * guaranteed to fit in the 2k buffer since the header is max 255
     * characters, checked in _set_custom_table_columns(). */
    offset = strlen(formula);
    while (*header) {
        switch (*header) {
            case '\'':
            case '#':
            case '[':
            case ']':
                formula[offset++] = '\'';
                formula[offset] = *header;
                break;
            default:
                formula[offset] = *header;
                break;
        }
        offset++;
        header++;
    }

    /* Write the end of the string. */
    memcpy(&formula[offset], "])\0", sizeof("])\0"));

    worksheet_write_formula_num(self, row, col, formula, format, value);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x870, %rsp            # imm = 0x870
movw %dx, %ax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movw %ax, -0xe(%rbp)
movq %rcx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x848(%rbp)
movq -0x18(%rbp), %rax
movb 0x18(%rax), %al
movb %al, -0x849(%rbp)
movq -0x18(%rbp), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, -0x858(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x860(%rbp)
leaq -0x840(%rbp), %rdi
movzbl -0x849(%rbp), %ecx
movl $0x820, %esi            # imm = 0x820
leaq 0x2486d(%rip), %rdx     # 0x6c6cf
movb $0x0, %al
callq 0xc5d0
leaq -0x840(%rbp), %rdi
callq 0xc4e0
movq %rax, -0x20(%rbp)
movq -0x860(%rbp), %rax
cmpb $0x0, (%rax)
je 0x47f2b
movq -0x860(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x864(%rbp)
subl $0x23, %eax
je 0x47ec7
jmp 0x47ea0
movl -0x864(%rbp), %eax
subl $0x27, %eax
je 0x47ec7
jmp 0x47ead
movl -0x864(%rbp), %eax
subl $0x5b, %eax
je 0x47ec7
jmp 0x47eba
movl -0x864(%rbp), %eax
subl $0x5d, %eax
jne 0x47ef4
jmp 0x47ec7
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x27, -0x840(%rbp,%rax)
movq -0x860(%rbp), %rax
movb (%rax), %cl
movq -0x20(%rbp), %rax
movb %cl, -0x840(%rbp,%rax)
jmp 0x47f08
movq -0x860(%rbp), %rax
movb (%rax), %cl
movq -0x20(%rbp), %rax
movb %cl, -0x840(%rbp,%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x860(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x860(%rbp)
jmp 0x47e79
movq -0x20(%rbp), %rax
movl 0x270f7(%rip), %ecx     # 0x6f02c
movl %ecx, -0x840(%rbp,%rax)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movw -0xe(%rbp), %ax
leaq -0x840(%rbp), %rcx
movq -0x848(%rbp), %r8
movsd -0x858(%rbp), %xmm0
movzwl %ax, %edx
callq 0xcdb0
addq $0x870, %rsp            # imm = 0x870
popq %rbp
retq
nop