// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x306f0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x34a10
movq -0x20(%rbp), %rsi
leaq 0x3363b(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x34a0e
cmpq $0x0, -0x20(%rbp)
jne 0x34a24
movq $0x0, -0x8(%rbp)
jmp 0x34c6d
movq -0x20(%rbp), %rdi
movl $0xb8, %esi
callq 0x9d60
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x34a55
movq -0x28(%rbp), %rsi
leaq 0x335f6(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x34a53
cmpq $0x0, -0x28(%rbp)
jne 0x34a69
movq $0x0, -0x8(%rbp)
jmp 0x34c6d
cmpq $0x0, 0x54a6f(%rip)     # 0x894e0
jne 0x34a83
movq -0x20(%rbp), %rdi
callq 0xa830
movq %rax, 0x54a5d(%rip)     # 0x894e0
cmpq $0x0, 0x54a5d(%rip)     # 0x894e8
jne 0x34a9d
movq -0x20(%rbp), %rdi
callq 0xa870
movq %rax, 0x54a4b(%rip)     # 0x894e8
movq -0x28(%rbp), %rax
movl $0x0, 0xa0(%rax)
movq -0x28(%rbp), %rax
movw 0xb0(%rax), %cx
andw $0xff0f, %cx            # imm = 0xFF0F
orw $0x0, %cx
movw %cx, 0xb0(%rax)
movq -0x28(%rbp), %rax
movw 0xb0(%rax), %cx
andw $-0x10, %cx
orw $0x5, %cx
movw %cx, 0xb0(%rax)
movq -0x28(%rbp), %rax
movw 0xb0(%rax), %cx
andw $0xf0ff, %cx            # imm = 0xF0FF
orw $0x0, %cx
movw %cx, 0xb0(%rax)
movq -0x28(%rbp), %rax
movl $0x1, 0xac(%rax)
movq -0x28(%rbp), %rax
movl $0x1869f, 0xa4(%rax)    # imm = 0x1869F
movq -0x28(%rbp), %rax
movl $0xfffe7961, 0xa8(%rax) # imm = 0xFFFE7961
movq -0x20(%rbp), %rdi
movl $0x2, %esi
callq 0x339f0
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x31b60
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x33a80
movq -0x20(%rbp), %rdi
leaq 0x129(%rip), %rsi       # 0x34c80
callq 0x9cc0
movq -0x20(%rbp), %rdi
movq 0x54981(%rip), %rsi     # 0x894e8
callq 0x9d10
cmpq $0x0, -0x18(%rbp)
jne 0x34bd0
callq 0x4cfc0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x34bcb
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x240(%rax), %rdx
xorl %esi, %esi
callq 0x34f00
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x248(%rax), %rdx
movl $0x2, %esi
callq 0x34f00
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x250(%rax), %rdx
movl $0x1, %esi
callq 0x34f00
jmp 0x34c5c
movq -0x18(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movl 0xa0(%rax), %esi
callq 0x34f30
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movw 0xb0(%rax), %ax
andw $0xf, %ax
movb %al, %cl
movq -0x38(%rbp), %rax
movw 0xb0(%rax), %ax
shrw $0x4, %ax
andw $0xf, %ax
movzbl %cl, %esi
movzbl %al, %edx
callq 0x34fd0
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movl 0xa8(%rax), %esi
movq -0x38(%rbp), %rax
movl 0xa4(%rax), %edx
callq 0x350a0
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movl 0xac(%rax), %esi
callq 0x35170
movq -0x20(%rbp), %rdi
callq 0x9250
movq -0x20(%rbp), %rdi
callq 0x351d0
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)