// File: /workspace/github_c_makefile_star2_O2/Paxa[P]fast_excel/libxlsxwriter/src/worksheet.c
// Function: get_comment_params
void
_get_comment_params(lxw_vml_obj *comment, lxw_comment_options *options)
{

    lxw_row_t start_row;
    lxw_col_t start_col;
    int32_t x_offset;
    int32_t y_offset;
    uint32_t height = 74;
    uint32_t width = 128;
    double x_scale = 1.0;
    double y_scale = 1.0;
    lxw_row_t row = comment->row;
    lxw_col_t col = comment->col;;

    /* Set the default start cell and offsets for the comment. These are
     * generally fixed in relation to the parent cell. However there are some
     * edge cases for cells at the, well yes, edges. */
    if (row == 0)
        y_offset = 2;
    else if (row == LXW_ROW_MAX - 3)
        y_offset = 16;
    else if (row == LXW_ROW_MAX - 2)
        y_offset = 16;
    else if (row == LXW_ROW_MAX - 1)
        y_offset = 14;
    else
        y_offset = 10;

    if (col == LXW_COL_MAX - 3)
        x_offset = 49;
    else if (col == LXW_COL_MAX - 2)
        x_offset = 49;
    else if (col == LXW_COL_MAX - 1)
        x_offset = 49;
    else
        x_offset = 15;

    if (row == 0)
        start_row = 0;
    else if (row == LXW_ROW_MAX - 3)
        start_row = LXW_ROW_MAX - 7;
    else if (row == LXW_ROW_MAX - 2)
        start_row = LXW_ROW_MAX - 6;
    else if (row == LXW_ROW_MAX - 1)
        start_row = LXW_ROW_MAX - 5;
    else
        start_row = row - 1;

    if (col == LXW_COL_MAX - 3)
        start_col = LXW_COL_MAX - 6;
    else if (col == LXW_COL_MAX - 2)
        start_col = LXW_COL_MAX - 5;
    else if (col == LXW_COL_MAX - 1)
        start_col = LXW_COL_MAX - 4;
    else
        start_col = col + 1;

    /* Set the default font properties. */
    comment->font_size = 8;
    comment->font_family = 2;

    /* Set any user defined options. */
    if (options) {

        if (options->width > 0.0)
            width = options->width;

        if (options->height > 0.0)
            height = options->height;

        if (options->x_scale > 0.0)
            x_scale = options->x_scale;

        if (options->y_scale > 0.0)
            y_scale = options->y_scale;

        if (options->x_offset != 0)
            x_offset = options->x_offset;

        if (options->y_offset != 0)
            y_offset = options->y_offset;

        if (options->start_row > 0 || options->start_col > 0) {
            start_row = options->start_row;
            start_col = options->start_col;
        }

        if (options->font_size > 0.0)
            comment->font_size = options->font_size;

        if (options->font_family > 0)
            comment->font_family = options->font_family;

        comment->visible = options->visible;
        comment->color = options->color;
        comment->author = lxw_strdup(options->author);
        comment->font_name = lxw_strdup(options->font_name);
    }

    /* Scale the width/height to the default/user scale and round to the
     * nearest pixel. */
    width = (uint32_t) (0.5 + x_scale * width);
    height = (uint32_t) (0.5 + y_scale * height);

    comment->width = width;
    comment->height = height;
    comment->start_col = start_col;
    comment->start_row = start_row;
    comment->x_offset = x_offset;
    comment->y_offset = y_offset;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl (%rdi), %r15d
movzwl 0x4(%rdi), %eax
testl %r15d, %r15d
je 0x2d608
leal -0xffffd(%r15), %ecx
cmpl $0x2, %ecx
ja 0x2d60c
movl %ecx, %ecx
leaq 0x16365(%rip), %rdx     # 0x43968
movl (%rdx,%rcx,4), %ebp
jmp 0x2d60f
pushq $0x2
jmp 0x2d60e
pushq $0xa
popq %rbp
movl %eax, %ecx
andl $-0x2, %ecx
cmpw $0x3ffe, %cx            # imm = 0x3FFE
pushq $0x31
popq %rcx
pushq $0xf
popq %r12
cmovel %ecx, %r12d
cmpl $0x3ffd, %eax           # imm = 0x3FFD
cmovel %ecx, %r12d
testl %r15d, %r15d
je 0x2d644
leal -0xffffd(%r15), %ecx
cmpl $0x3, %ecx
jae 0x2d649
addl $-0x4, %r15d
jmp 0x2d64c
xorl %r15d, %r15d
jmp 0x2d64c
decl %r15d
movw $0x3ffa, %r13w          # imm = 0x3FFA
cmpl $0x3ffd, %eax           # imm = 0x3FFD
je 0x2d679
cmpl $0x3ffe, %eax           # imm = 0x3FFE
je 0x2d66d
cmpl $0x3fff, %eax           # imm = 0x3FFF
jne 0x2d674
movw $0x3ffc, %r13w          # imm = 0x3FFC
jmp 0x2d679
movw $0x3ffb, %r13w          # imm = 0x3FFB
jmp 0x2d679
incl %eax
movl %eax, %r13d
movabsq $0x4020000000000000, %rax # imm = 0x4020000000000000
movq %rax, 0x50(%rbx)
movb $0x2, 0x44(%rbx)
testq %r14, %r14
je 0x2d69f
movzwl 0x10(%r14), %eax
testl %eax, %eax
je 0x2d6bc
cvtsi2sd %eax, %xmm0
jmp 0x2d6c4
movapd 0x15f59(%rip), %xmm3    # 0x43600
movsd 0x16011(%rip), %xmm1    # 0x436c0
movsd 0x16011(%rip), %xmm2    # 0x436c8
jmp 0x2d7a3
movsd 0x15ffc(%rip), %xmm0    # 0x436c0
movzwl 0x12(%r14), %eax
testl %eax, %eax
movsd %xmm0, 0x8(%rsp)
je 0x2d6d9
cvtsi2sd %eax, %xmm0
jmp 0x2d6e1
movsd 0x15fe7(%rip), %xmm0    # 0x436c8
movsd %xmm0, (%rsp)
movupd 0x18(%r14), %xmm3
xorpd %xmm0, %xmm0
movl 0x4c(%r14), %eax
testl %eax, %eax
cmovnel %eax, %r12d
movl 0x50(%r14), %eax
testl %eax, %eax
cmovnel %eax, %ebp
cmpltpd %xmm3, %xmm0
movl 0x44(%r14), %eax
movl 0x48(%r14), %ecx
xorl %edx, %edx
testw %cx, %cx
sete %sil
cmovnel %edx, %r15d
testb $0x1, %sil
cmovel %ecx, %r13d
testl %eax, %eax
cmovnel %ecx, %r13d
cmovnel %eax, %r15d
movsd 0x38(%r14), %xmm1
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm1
jbe 0x2d744
movsd %xmm1, 0x50(%rbx)
andpd %xmm0, %xmm3
andnpd 0x15eb0(%rip), %xmm0    # 0x43600
movb 0x40(%r14), %al
testb %al, %al
je 0x2d75b
movb %al, 0x44(%rbx)
orpd %xmm0, %xmm3
movapd %xmm3, 0x10(%rsp)
movb (%r14), %al
movb %al, 0x45(%rbx)
movl 0x28(%r14), %eax
movl %eax, 0x40(%rbx)
movq 0x8(%r14), %rdi
callq 0xcd50
movq %rax, 0x88(%rbx)
movq 0x30(%r14), %rdi
callq 0xcd50
movapd 0x10(%rsp), %xmm3
movq %rax, 0x90(%rbx)
movsd 0x8(%rsp), %xmm1
movsd (%rsp), %xmm2
mulsd %xmm3, %xmm1
movsd 0xfd19(%rip), %xmm0     # 0x3d4c8
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
unpckhpd %xmm3, %xmm3            # xmm3 = xmm3[1,1]
mulsd %xmm2, %xmm3
addsd %xmm0, %xmm3
cvttsd2si %xmm3, %rcx
movl %eax, 0x28(%rbx)
movl %ecx, 0x2c(%rbx)
movw %r13w, 0xc(%rbx)
movl %r15d, 0x8(%rbx)
movl %r12d, 0x10(%rbx)
movl %ebp, 0x14(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq