// File: /workspace/github_c_makefile_star2_O2/Paxa[P]fast_excel/libxlsxwriter/src/worksheet.c
// Function: worksheet_write_comment_opt
lxw_error
worksheet_write_comment_opt(lxw_worksheet *self,
                            lxw_row_t row_num, lxw_col_t col_num,
                            const char *text, lxw_comment_options *options)
{
    lxw_cell *cell;
    lxw_error err;
    lxw_vml_obj *comment;

    err = _check_dimensions(self, row_num, col_num, LXW_FALSE, LXW_FALSE);
    if (err)
        return err;

    if (!text)
        return LXW_ERROR_NULL_PARAMETER_IGNORED;

    if (lxw_utf8_strlen(text) > LXW_STR_MAX)
        return LXW_ERROR_MAX_STRING_LENGTH_EXCEEDED;

    comment = calloc(1, sizeof(lxw_vml_obj));
    GOTO_LABEL_ON_MEM_ERROR(comment, mem_error);

    comment->text = lxw_strdup(text);
    GOTO_LABEL_ON_MEM_ERROR(comment->text, mem_error);

    comment->row = row_num;
    comment->col = col_num;

    cell = _new_comment_cell(row_num, col_num, comment);
    GOTO_LABEL_ON_MEM_ERROR(cell, mem_error);

    _insert_comment(self, row_num, col_num, cell);

    /* Set user and default parameters for the comment. */
    _get_comment_params(comment, options);

    self->has_vml = LXW_TRUE;
    self->has_comments = LXW_TRUE;

    /* Insert a placeholder in the cell RB table in the same position so
     * that the worksheet row "spans" calculations are correct. */
    _insert_cell_placeholder(self, row_num, col_num);

    return LXW_NO_ERROR;

mem_error:
    if (comment)
        _free_vml_object(comment);

    return LXW_ERROR_MEMORY_MALLOC_FAILED;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r15
movq %rcx, %r13
movl %edx, %ebp
movl %esi, %ebx
movq %rdi, %r14
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x36a6c
movl %eax, %r12d
testl %eax, %eax
jne 0x37bef
testq %r13, %r13
je 0x37beb
movq %r13, %rdi
callq 0xd150
cmpq $0x7fff, %rax           # imm = 0x7FFF
jbe 0x37c01
pushq $0x15
jmp 0x37bed
pushq $0xc
popq %r12
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rdi
movl $0xc0, %esi
callq 0xc850
testq %rax, %rax
je 0x37cfe
movq %rax, %r12
movq %r13, %rdi
callq 0xcd50
movq %rax, 0x98(%r12)
testq %rax, %rax
je 0x37d24
movl %ebx, (%r12)
movw %bp, 0x4(%r12)
pushq $0x1
popq %rdi
pushq $0x68
popq %rsi
callq 0xc850
testq %rax, %rax
je 0x37d2b
movq %rax, %r13
movl %ebx, (%rax)
movw %bp, 0x4(%rax)
movl $0xa, 0x8(%rax)
movq %r12, 0x18(%rax)
movq 0x30(%r14), %rdi
movl %ebx, %esi
callq 0x3c198
movq 0x20(%rax), %rdi
movzwl %bp, %ebp
movq %r13, %rsi
movl %ebp, %edx
callq 0x3bf07
movq %r12, %rdi
movq %r15, %rsi
callq 0xcf10
movw $0x101, 0x2a0(%r14)     # imm = 0x101
xorl %r12d, %r12d
cmpb $0x0, 0x11c(%r14)
jne 0x37bef
xorl %r12d, %r12d
movl %ebx, %edi
movl %ebp, %esi
xorl %edx, %edx
callq 0x37072
testq %rax, %rax
je 0x37bef
movq %rax, %r15
movq %r14, %rdi
movl %ebx, %esi
callq 0x3819f
movq 0x20(%rax), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2a760
testq %rax, %rax
je 0x37cec
movq %r15, %rdi
callq 0x2caea
jmp 0x37bef
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x3bf07
jmp 0x37bef
movq 0x1b2f3(%rip), %rax     # 0x52ff8
movq (%rax), %rdi
leaq 0x53d1(%rip), %rsi      # 0x3d0e0
leaq 0xbcca(%rip), %rdx      # 0x439e0
movl $0x2181, %ecx           # imm = 0x2181
xorl %eax, %eax
callq 0xc8d0
jmp 0x37d7b
movl $0x2184, %ecx           # imm = 0x2184
jmp 0x37d54
movq 0x1b2c6(%rip), %rax     # 0x52ff8
movq (%rax), %rdi
leaq 0x53a4(%rip), %rsi      # 0x3d0e0
leaq 0xbc9d(%rip), %rdx      # 0x439e0
movl $0x3e9, %ecx            # imm = 0x3E9
xorl %eax, %eax
callq 0xc8d0
movl $0x218a, %ecx           # imm = 0x218A
movq 0x1b29d(%rip), %rax     # 0x52ff8
movq (%rax), %rdi
leaq 0x537b(%rip), %rsi      # 0x3d0e0
leaq 0xbc74(%rip), %rdx      # 0x439e0
xorl %eax, %eax
callq 0xc8d0
movq %r12, %rdi
callq 0x2c8bc
pushq $0x1
jmp 0x37bed