// File: /workspace/github_c_makefile_star2_O2/Paxa[P]fast_excel/libxlsxwriter/src/worksheet.c
// Function: get_button_params
lxw_error
_get_button_params(lxw_vml_obj *button, uint16_t button_number,
                   lxw_button_options *options)
{

    int32_t x_offset = 0;
    int32_t y_offset = 0;
    uint32_t height = LXW_DEF_ROW_HEIGHT_PIXELS;
    uint32_t width = LXW_DEF_COL_WIDTH_PIXELS;
    double x_scale = 1.0;
    double y_scale = 1.0;
    lxw_row_t row = button->row;
    lxw_col_t col = button->col;
    char buffer[LXW_ATTR_32];
    uint8_t has_caption = LXW_FALSE;
    uint8_t has_macro = LXW_FALSE;
    size_t len;

    /* 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->caption) {
            button->name = lxw_strdup(options->caption);
            RETURN_ON_MEM_ERROR(button->name, LXW_ERROR_MEMORY_MALLOC_FAILED);
            has_caption = LXW_TRUE;
        }

        if (options->macro) {
            len = sizeof("[0]!") + strlen(options->macro);
            button->macro = calloc(1, len);
            RETURN_ON_MEM_ERROR(button->macro,
                                LXW_ERROR_MEMORY_MALLOC_FAILED);

            if (button->macro)
                lxw_snprintf(button->macro, len, "[0]!%s", options->macro);

            has_macro = LXW_TRUE;
        }

        if (options->description) {
            button->text = lxw_strdup(options->description);
            RETURN_ON_MEM_ERROR(button->text, LXW_ERROR_MEMORY_MALLOC_FAILED);
        }
    }

    if (!has_caption) {
        lxw_snprintf(buffer, LXW_ATTR_32, "Button %d", button_number);
        button->name = lxw_strdup(buffer);
        RETURN_ON_MEM_ERROR(button->name, LXW_ERROR_MEMORY_MALLOC_FAILED);
    }

    if (!has_macro) {
        lxw_snprintf(buffer, LXW_ATTR_32, "[0]!Button%d_Click",
                     button_number);
        button->macro = lxw_strdup(buffer);
        RETURN_ON_MEM_ERROR(button->macro, LXW_ERROR_MEMORY_MALLOC_FAILED);
    }

    /* 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);

    button->width = width;
    button->height = height;
    button->start_col = col;
    button->start_row = row;
    button->x_offset = x_offset;
    button->y_offset = y_offset;

    return LXW_NO_ERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movl (%rdi), %r13d
movzwl 0x4(%rdi), %ebp
movzwl %si, %eax
movl %eax, 0xc(%rsp)
testq %rdx, %rdx
je 0x2d8ba
movq %rdx, %r15
movsd 0x18(%rdx), %xmm0
movaps %xmm0, 0x10(%rsp)
movups 0x20(%rdx), %xmm0
movaps %xmm0, 0x20(%rsp)
movsd 0x30(%rdx), %xmm0
movapd %xmm0, 0x30(%rsp)
movq (%rdx), %r14
testq %r14, %r14
je 0x2d857
movq %r14, %rdi
callq 0xcd50
movq %rax, 0xa8(%rbx)
testq %rax, %rax
je 0x2da62
movq 0x8(%r15), %r12
testq %r12, %r12
je 0x2d8e4
movw %bp, 0xa(%rsp)
movl %r13d, %ebp
movq %r12, %rdi
callq 0xc4c0
movq %rax, %r13
addq $0x5, %r13
pushq $0x1
popq %rdi
movq %r13, %rsi
callq 0xc850
movq %rax, 0xb0(%rbx)
testq %rax, %rax
je 0x2da81
leaq 0x165ef(%rip), %rdx     # 0x43e8c
movq %rax, %rdi
movq %r13, %rsi
movq %r12, %rcx
xorl %eax, %eax
callq 0xc5b0
movb $0x1, %r12b
movl %ebp, %r13d
movzwl 0xa(%rsp), %ebp
jmp 0x2d8e7
movsd 0x15d4e(%rip), %xmm0    # 0x43610
movaps %xmm0, 0x10(%rsp)
movapd 0x15d31(%rip), %xmm0    # 0x43600
movapd %xmm0, 0x20(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
xorl %r12d, %r12d
jmp 0x2d95b
xorl %r12d, %r12d
movq 0x10(%r15), %rdi
testq %rdi, %rdi
je 0x2d905
callq 0xcd50
movq %rax, 0x98(%rbx)
testq %rax, %rax
je 0x2daa0
pxor %xmm1, %xmm1
movdqa 0x10(%rsp), %xmm3
movdqa %xmm3, %xmm2
pcmpeqw %xmm1, %xmm2
movdqa %xmm2, %xmm0
pandn %xmm3, %xmm0
pand 0x15cf9(%rip), %xmm2    # 0x43620
por %xmm0, %xmm2
punpcklwd %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1],xmm2[2],xmm1[2],xmm2[3],xmm1[3]
movdqa %xmm2, 0x10(%rsp)
movapd 0x20(%rsp), %xmm0
cmpltpd %xmm0, %xmm1
andpd %xmm1, %xmm0
andnpd 0x15cb4(%rip), %xmm1    # 0x43600
orpd %xmm0, %xmm1
movapd %xmm1, 0x20(%rsp)
testq %r14, %r14
jne 0x2d990
leaq 0x16531(%rip), %rdx     # 0x43e93
leaq 0x40(%rsp), %r14
pushq $0x20
popq %rsi
movq %r14, %rdi
movl 0xc(%rsp), %ecx
xorl %eax, %eax
callq 0xc5b0
movq %r14, %rdi
callq 0xcd50
movq %rax, 0xa8(%rbx)
testq %rax, %rax
je 0x2da43
testb %r12b, %r12b
jne 0x2d9ca
leaq 0x16501(%rip), %rdx     # 0x43e9d
leaq 0x40(%rsp), %r14
pushq $0x20
popq %rsi
movq %r14, %rdi
movl 0xc(%rsp), %ecx
xorl %eax, %eax
callq 0xc5b0
movq %r14, %rdi
callq 0xcd50
movq %rax, 0xb0(%rbx)
testq %rax, %rax
je 0x2dabf
xorpd %xmm0, %xmm0
movapd 0x10(%rsp), %xmm1
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0x15c51(%rip), %xmm0    # 0x43630
orpd %xmm0, %xmm1
subpd %xmm0, %xmm1
movapd 0x20(%rsp), %xmm2
mulpd %xmm1, %xmm2
addpd 0x15c47(%rip), %xmm2    # 0x43640
cvttpd2dq %xmm2, %xmm0
movapd %xmm0, %xmm1
addpd 0x15c47(%rip), %xmm2    # 0x43650
cvttpd2dq %xmm2, %xmm2
psrad $0x1f, %xmm1
andpd %xmm1, %xmm2
orpd %xmm0, %xmm2
movlpd %xmm2, 0x28(%rbx)
movw %bp, 0xc(%rbx)
movl %r13d, 0x8(%rbx)
movapd 0x30(%rsp), %xmm0
movlpd %xmm0, 0x10(%rbx)
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x255ae(%rip), %rax     # 0x52ff8
movq (%rax), %rdi
leaq 0xf68c(%rip), %rsi      # 0x3d0e0
leaq 0x15f85(%rip), %rdx     # 0x439e0
movl $0xc8c, %ecx            # imm = 0xC8C
jmp 0x2dadc
movq 0x2558f(%rip), %rax     # 0x52ff8
movq (%rax), %rdi
leaq 0xf66d(%rip), %rsi      # 0x3d0e0
leaq 0x15f66(%rip), %rdx     # 0x439e0
movl $0xc73, %ecx            # imm = 0xC73
jmp 0x2dadc
movq 0x25570(%rip), %rax     # 0x52ff8
movq (%rax), %rdi
leaq 0xf64e(%rip), %rsi      # 0x3d0e0
leaq 0x15f47(%rip), %rdx     # 0x439e0
movl $0xc7b, %ecx            # imm = 0xC7B
jmp 0x2dadc
movq 0x25551(%rip), %rax     # 0x52ff8
movq (%rax), %rdi
leaq 0xf62f(%rip), %rsi      # 0x3d0e0
leaq 0x15f28(%rip), %rdx     # 0x439e0
movl $0xc85, %ecx            # imm = 0xC85
jmp 0x2dadc
movq 0x25532(%rip), %rax     # 0x52ff8
movq (%rax), %rdi
leaq 0xf610(%rip), %rsi      # 0x3d0e0
leaq 0x15f09(%rip), %rdx     # 0x439e0
movl $0xc93, %ecx            # imm = 0xC93
xorl %eax, %eax
callq 0xc8d0
pushq $0x1
popq %rax
jmp 0x2da34