// File: /workspace/github_c_makefile_star2_O1/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, %r12
movq %rcx, %r13
movl %edx, %ebp
movl %esi, %ebx
movq %rdi, %r14
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x39aa6
movl %eax, %r15d
testl %eax, %eax
je 0x3a9f7
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %r13, %r13
je 0x3ab33
movq %r13, %rdi
callq 0xd0d0
movl $0x15, %r15d
cmpq $0x7fff, %rax           # imm = 0x7FFF
ja 0x3a9e5
movl $0x1, %edi
movl $0xc0, %esi
callq 0xc7f0
testq %rax, %rax
je 0x3ab3e
movq %rax, %r15
movq %r13, %rdi
callq 0xcce0
movq %rax, 0x98(%r15)
testq %rax, %rax
movq %r15, %r13
je 0x3ab4e
movl %ebx, (%r13)
movw %bp, 0x4(%r13)
movl $0x1, %edi
movl $0x68, %esi
callq 0xc7f0
movq %rax, %r15
testq %rax, %rax
je 0x3ab55
movl %ebx, (%r15)
movw %bp, 0x4(%r15)
movl $0xa, 0x8(%r15)
movq %r13, 0x18(%r15)
testq %r15, %r15
je 0x3ab5f
movq 0x30(%r14), %rdi
movl %ebx, %esi
callq 0x3ee08
movq 0x20(%rax), %rdi
movzwl %bp, %ebp
movq %r15, %rsi
movl %ebp, %edx
callq 0x3eb8f
movq %r13, %rdi
movq %r12, %rsi
callq 0xce90
movw $0x101, 0x2a0(%r14)     # imm = 0x101
xorl %r15d, %r15d
cmpb $0x0, 0x11c(%r14)
jne 0x3a9e5
xorl %r15d, %r15d
movl %ebx, %edi
movl %ebp, %esi
xorl %edx, %edx
callq 0x3a049
testq %rax, %rax
je 0x3a9e5
movq %rax, %r12
movq %r14, %rdi
movl %ebx, %esi
callq 0x3b01b
movq 0x20(%rax), %rdi
movq (%rdi), %rax
testq %rax, %rax
je 0x3ab24
movzwl 0x4(%r12), %ecx
movl $0x48, %edx
cmpw 0x4(%rax), %cx
jb 0x3ab1b
movl $0x50, %edx
je 0x3ab9f
movq (%rax,%rdx), %rax
testq %rax, %rax
jne 0x3ab05
movq %r12, %rsi
movl %ebp, %edx
callq 0x3eb8f
jmp 0x3a9e5
movl $0xc, %r15d
jmp 0x3a9e5
callq 0xf1f8
movl $0x1, %r15d
jmp 0x3a9e5
movl $0x2184, %ecx           # imm = 0x2184
jmp 0x3ab64
callq 0xf1d4
jmp 0x3aa84
movl $0x218a, %ecx           # imm = 0x218A
movq 0x1b48d(%rip), %rax     # 0x55ff8
movq (%rax), %rdi
leaq 0x556b(%rip), %rsi      # 0x400e0
leaq 0xbd8c(%rip), %rdx      # 0x46908
xorl %eax, %eax
callq 0xc870
movl $0x1, %r15d
testq %r13, %r13
je 0x3a9e5
movq %r13, %rdi
callq 0x2f96b
jmp 0x3a9e5
movq %r12, %rdi
callq 0x2fbaa
jmp 0x3a9e5