// File: /workspace/github_c_makefile_star2_O1/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
movl %esi, 0x10(%rsp)
movq %rdi, %rbx
movl (%rdi), %r12d
movzwl 0x4(%rdi), %r15d
testq %rdx, %rdx
movw %r15w, 0xa(%rsp)
je 0x30906
movq %rdx, %r14
movl 0x18(%rdx), %eax
testw %ax, %ax
movl $0x40, %r13d
cmovnel %eax, %r13d
movzwl 0x1a(%rdx), %eax
testw %ax, %ax
movl $0x14, %ebp
cmovnel %eax, %ebp
movsd 0x20(%rdx), %xmm0
movaps %xmm0, 0x20(%rsp)
movsd 0x28(%rdx), %xmm0
movapd %xmm0, 0x30(%rsp)
movl 0x30(%rdx), %eax
movl %eax, 0x14(%rsp)
movl 0x34(%rdx), %eax
movl %eax, 0x18(%rsp)
movq (%rdx), %rdi
testq %rdi, %rdi
je 0x3093d
callq 0xcce0
movq %rax, 0xa8(%rbx)
movb $0x1, %cl
testq %rax, %rax
jne 0x3093f
callq 0xe6f3
jmp 0x30b18
movl $0x0, 0x18(%rsp)
movsd 0x1212a(%rip), %xmm0    # 0x42a40
movw $0x40, %r13w
movw $0x14, %bp
movapd %xmm0, 0x20(%rsp)
movapd %xmm0, 0x30(%rsp)
movl $0x0, 0x14(%rsp)
xorl %eax, %eax
xorl %r15d, %r15d
jmp 0x30a17
xorl %ecx, %ecx
movl %ecx, 0xc(%rsp)
movq 0x8(%r14), %r15
testq %r15, %r15
je 0x3099e
movl %r12d, 0x1c(%rsp)
movq %r15, %rdi
callq 0xc480
movq %rax, %r12
addq $0x5, %r12
movl $0x1, %edi
movq %r12, %rsi
callq 0xc7f0
movq %rax, 0xb0(%rbx)
testq %rax, %rax
je 0x30b05
leaq 0x16430(%rip), %rdx     # 0x46db4
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rcx
xorl %eax, %eax
callq 0xc570
movb $0x1, %r15b
movl 0x1c(%rsp), %r12d
jmp 0x309a1
xorl %r15d, %r15d
xorpd %xmm1, %xmm1
xorpd %xmm2, %xmm2
movapd 0x20(%rsp), %xmm3
cmpltsd %xmm3, %xmm2
andpd %xmm2, %xmm3
movsd 0x12080(%rip), %xmm0    # 0x42a40
andnpd %xmm0, %xmm2
orpd %xmm3, %xmm2
movapd %xmm2, 0x20(%rsp)
movapd 0x30(%rsp), %xmm2
cmpltsd %xmm2, %xmm1
andpd %xmm1, %xmm2
andnpd %xmm0, %xmm1
orpd %xmm2, %xmm1
movapd %xmm1, 0x30(%rsp)
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x30a13
callq 0xcce0
movq %rax, 0x98(%rbx)
testq %rax, %rax
movl 0xc(%rsp), %eax
jne 0x30a17
callq 0xe73b
jmp 0x30b18
movl 0xc(%rsp), %eax
testb %al, %al
jne 0x30a53
movzwl 0x10(%rsp), %ecx
leaq 0x16394(%rip), %rdx     # 0x46dbb
leaq 0x40(%rsp), %r14
movl $0x20, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0xc570
movq %r14, %rdi
callq 0xcce0
movq %rax, 0xa8(%rbx)
testq %rax, %rax
je 0x30b0c
testb %r15b, %r15b
jne 0x30a90
movzwl 0x10(%rsp), %ecx
leaq 0x16361(%rip), %rdx     # 0x46dc5
leaq 0x40(%rsp), %r14
movl $0x20, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0xc570
movq %r14, %rdi
callq 0xcce0
movq %rax, 0xb0(%rbx)
testq %rax, %rax
je 0x30b13
movzwl %r13w, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movapd 0x20(%rsp), %xmm1
mulsd %xmm0, %xmm1
movsd 0xfa23(%rip), %xmm0     # 0x404d0
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movzwl %bp, %ecx
xorps %xmm1, %xmm1
cvtsi2sd %ecx, %xmm1
movapd 0x30(%rsp), %xmm2
mulsd %xmm1, %xmm2
addsd %xmm0, %xmm2
cvttsd2si %xmm2, %rcx
movl %eax, 0x28(%rbx)
movl %ecx, 0x2c(%rbx)
movzwl 0xa(%rsp), %eax
movw %ax, 0xc(%rbx)
movl %r12d, 0x8(%rbx)
movl 0x14(%rsp), %eax
movl %eax, 0x10(%rbx)
movl 0x18(%rsp), %eax
movl %eax, 0x14(%rbx)
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xe717
jmp 0x30b18
callq 0xe789
jmp 0x30b18
callq 0xe75f
movl $0x1, %eax
jmp 0x30af6