// File: /workspace/github_c_makefile_star2_O3/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_spinbox.c
// Function: lv_spinbox_create
lv_obj_t * lv_spinbox_create(lv_obj_t * par, const lv_obj_t * copy)
{
    LV_LOG_TRACE("spinbox create started");

    /*Create the ancestor of spinbox*/
    lv_obj_t * new_spinbox = lv_ta_create(par, copy);
    LV_ASSERT_MEM(new_spinbox);
    if(new_spinbox == NULL) return NULL;

    /*Allocate the spinbox type specific extended data*/
    lv_spinbox_ext_t * ext = lv_obj_allocate_ext_attr(new_spinbox, sizeof(lv_spinbox_ext_t));
    LV_ASSERT_MEM(ext);
    if(ext == NULL) return NULL;
    if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_spinbox);
    if(ancestor_design == NULL) ancestor_design = lv_obj_get_design_cb(new_spinbox);

    /*Initialize the allocated 'ext'*/
    ext->value              = 0;
    ext->dec_point_pos      = 0;
    ext->digit_count        = 5;
    ext->digit_padding_left = 0;
    ext->step               = 1;
    ext->range_max          = 99999;
    ext->range_min          = -99999;

    lv_ta_set_cursor_type(new_spinbox, LV_CURSOR_BLOCK);
    lv_ta_set_one_line(new_spinbox, true);
    lv_ta_set_cursor_click_pos(new_spinbox, false);

    /*The signal and design functions are not copied so set them here*/
    lv_obj_set_signal_cb(new_spinbox, lv_spinbox_signal);
    lv_obj_set_design_cb(new_spinbox, ancestor_design); /*Leave the Text area's design function*/

    /*Init the new spinbox spinbox*/
    if(copy == NULL) {
        /*Set the default styles*/
        lv_theme_t * th = lv_theme_get_current();
        if(th) {
            lv_spinbox_set_style(new_spinbox, LV_SPINBOX_STYLE_BG, th->style.spinbox.bg);
            lv_spinbox_set_style(new_spinbox, LV_SPINBOX_STYLE_CURSOR, th->style.spinbox.cursor);
            lv_spinbox_set_style(new_spinbox, LV_SPINBOX_STYLE_SB, th->style.spinbox.sb);
        }
    }
    /*Copy an existing spinbox*/
    else {
        lv_spinbox_ext_t * copy_ext = lv_obj_get_ext_attr(copy);

        lv_spinbox_set_value(new_spinbox, copy_ext->value);
        lv_spinbox_set_digit_format(new_spinbox, (uint8_t)copy_ext->digit_count, (uint8_t)copy_ext->dec_point_pos);
        lv_spinbox_set_range(new_spinbox, copy_ext->range_min, copy_ext->range_max);
        lv_spinbox_set_step(new_spinbox, copy_ext->step);

        /*Refresh the style with new signal function*/
        lv_obj_refresh_style(new_spinbox);
    }

    lv_spinbox_updatevalue(new_spinbox);

    LV_LOG_INFO("spinbox created");

    return new_spinbox;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
callq 0x1e1b0
movq %rax, %rbx
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0x20d48
testq %rbx, %rbx
je 0x20d59
movq %rbx, %rdi
movl $0xb8, %esi
callq 0x64db
movq %rax, %r15
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0x20d5d
testq %r15, %r15
je 0x20d59
cmpq $0x0, 0x3f7c6(%rip)     # 0x60410
jne 0x20c5b
movq %rbx, %rdi
callq 0x6a8b
movq %rax, 0x3f7b5(%rip)     # 0x60410
cmpq $0x0, 0x3f7b5(%rip)     # 0x60418
jne 0x20c74
movq %rbx, %rdi
callq 0x6aaf
movq %rax, 0x3f7a4(%rip)     # 0x60418
movl $0xfffff000, %eax       # imm = 0xFFFFF000
andl 0xb0(%r15), %eax
orl $0x5, %eax
movw %ax, 0xb0(%r15)
movaps 0x1ed8e(%rip), %xmm0    # 0x3fa20
movups %xmm0, 0xa0(%r15)
movq %rbx, %rdi
movl $0x2, %esi
callq 0x202c7
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1ee01
movq %rbx, %rdi
xorl %esi, %esi
callq 0x20326
leaq 0x100(%rip), %rsi       # 0x20dc5
movq %rbx, %rdi
callq 0x647b
movq 0x3f744(%rip), %rsi     # 0x60418
movq %rbx, %rdi
callq 0x64ab
testq %r14, %r14
je 0x20d6e
movq %r14, %rdi
callq 0x6af7
movq %rax, %r14
movl 0xa0(%rax), %esi
movq %rbx, %rdi
callq 0x20f29
movzwl 0xb0(%r14), %esi
movl %esi, %eax
shrb $0x4, %al
andl $0xf, %esi
movzbl %al, %edx
movq %rbx, %rdi
callq 0x20f89
movl 0xa4(%r14), %edx
movl 0xa8(%r14), %esi
movq %rbx, %rdi
callq 0x20ff5
movl 0xac(%r14), %esi
movq %rbx, %rdi
callq 0x2108b
movq %rbx, %rdi
callq 0x5e54
jmp 0x20db4
leaq 0x1e381(%rip), %rdi     # 0x3f0d0
movq %rbx, %rsi
callq 0x8294
jmp 0x20d57
xorl %ebx, %ebx
jmp 0x20dbc
leaq 0x1e36c(%rip), %rdi     # 0x3f0d0
movq %r15, %rsi
callq 0x8294
jmp 0x20d6c
callq 0x2e91c
testq %rax, %rax
je 0x20db4
movq %rax, %r14
movq 0x240(%rax), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1ecf4
movq 0x248(%r14), %rdx
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1ecf4
movq 0x250(%r14), %rdx
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1ecf4
movq %rbx, %rdi
callq 0x210c9
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq