// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movw %dx, %ax
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movw %ax, -0x16(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
xorl %r8d, %r8d
movzwl -0x16(%rbp), %edx
movl %r8d, %ecx
callq 0x4ff90
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x51d48
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x51ed2
cmpq $0x0, -0x20(%rbp)
jne 0x51d5b
movl $0xc, -0x4(%rbp)
jmp 0x51ed2
movq -0x20(%rbp), %rdi
callq 0xd180
cmpq $0x7fff, %rax           # imm = 0x7FFF
jbe 0x51d78
movl $0x15, -0x4(%rbp)
jmp 0x51ed2
movl $0x1, %edi
movl $0xc0, %esi
callq 0xc870
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x51dbb
movq 0x2b25f(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x1432d(%rip), %rsi     # 0x660d0
leaq 0x1a64a(%rip), %rdx     # 0x6c3f4
movl $0x2181, %ecx           # imm = 0x2181
movb $0x0, %al
callq 0xc8f0
jmp 0x51ebb
jmp 0x51dbd
movq -0x20(%rbp), %rdi
callq 0xcd80
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x98(%rax)
movq -0x40(%rbp), %rax
cmpq $0x0, 0x98(%rax)
jne 0x51e0b
movq 0x2b20f(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x142dd(%rip), %rsi     # 0x660d0
leaq 0x1a5fa(%rip), %rdx     # 0x6c3f4
movl $0x2184, %ecx           # imm = 0x2184
movb $0x0, %al
callq 0xc8f0
jmp 0x51ebb
jmp 0x51e0d
movl -0x14(%rbp), %ecx
movq -0x40(%rbp), %rax
movl %ecx, (%rax)
movw -0x16(%rbp), %cx
movq -0x40(%rbp), %rax
movw %cx, 0x4(%rax)
movl -0x14(%rbp), %edi
movw -0x16(%rbp), %ax
movq -0x40(%rbp), %rdx
movzwl %ax, %esi
callq 0x51ee0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x51e66
movq 0x2b1b1(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x1427f(%rip), %rsi     # 0x660d0
leaq 0x1a59c(%rip), %rdx     # 0x6c3f4
movl $0x218a, %ecx           # imm = 0x218A
movb $0x0, %al
callq 0xc8f0
jmp 0x51ebb
jmp 0x51e68
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movw -0x16(%rbp), %ax
movq -0x30(%rbp), %rcx
movzwl %ax, %edx
callq 0x51f80
movq -0x40(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xcf40
movq -0x10(%rbp), %rax
movb $0x1, 0x2a0(%rax)
movq -0x10(%rbp), %rax
movb $0x1, 0x2a1(%rax)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movzwl -0x16(%rbp), %edx
callq 0x51fd0
movl $0x0, -0x4(%rbp)
jmp 0x51ed2
cmpq $0x0, -0x40(%rbp)
je 0x51ecb
movq -0x40(%rbp), %rdi
callq 0x465f0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)