// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_slider.c
// Function: lv_slider_create
lv_obj_t * lv_slider_create(lv_obj_t * par, const lv_obj_t * copy)
{
    LV_LOG_TRACE("slider create started");

    /*Create the ancestor slider*/
    lv_obj_t * new_slider = lv_bar_create(par, copy);
    LV_ASSERT_MEM(new_slider);
    if(new_slider == NULL) return NULL;

    if(ancestor_design_f == NULL) ancestor_design_f = lv_obj_get_design_cb(new_slider);
    if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_slider);

    /*Allocate the slider type specific extended data*/
    lv_slider_ext_t * ext = lv_obj_allocate_ext_attr(new_slider, sizeof(lv_slider_ext_t));
    LV_ASSERT_MEM(ext);
    if(ext == NULL) return NULL;

    /*Initialize the allocated 'ext' */
    ext->drag_value = LV_SLIDER_NOT_PRESSED;
    ext->style_knob = &lv_style_pretty;
    ext->knob_in    = 0;

    /*The signal and design functions are not copied so set them here*/
    lv_obj_set_signal_cb(new_slider, lv_slider_signal);
    lv_obj_set_design_cb(new_slider, lv_slider_design);

    /*Init the new slider slider*/
    if(copy == NULL) {
        lv_obj_set_click(new_slider, true);
        lv_obj_set_protect(new_slider, LV_PROTECT_PRESS_LOST);

        /*Set the default styles*/
        lv_theme_t * th = lv_theme_get_current();
        if(th) {
            lv_slider_set_style(new_slider, LV_SLIDER_STYLE_BG, th->style.slider.bg);
            lv_slider_set_style(new_slider, LV_SLIDER_STYLE_INDIC, th->style.slider.indic);
            lv_slider_set_style(new_slider, LV_SLIDER_STYLE_KNOB, th->style.slider.knob);
        } else {
            lv_slider_set_style(new_slider, LV_SLIDER_STYLE_KNOB, ext->style_knob);
        }
    }
    /*Copy an existing slider*/
    else {
        lv_slider_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
        ext->style_knob            = copy_ext->style_knob;
        ext->knob_in               = copy_ext->knob_in;
        /*Refresh the style with new signal function*/
        lv_obj_refresh_style(new_slider);
    }

    LV_LOG_INFO("slider created");

    return new_slider;
}

// 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 0xe820
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x2ed50
movq -0x20(%rbp), %rsi
leaq 0x392fb(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x2ed4e
cmpq $0x0, -0x20(%rbp)
jne 0x2ed64
movq $0x0, -0x8(%rbp)
jmp 0x2ef09
cmpq $0x0, 0x5a73c(%rip)     # 0x894a8
jne 0x2ed7e
movq -0x20(%rbp), %rdi
callq 0xa870
movq %rax, 0x5a72a(%rip)     # 0x894a8
cmpq $0x0, 0x5a72a(%rip)     # 0x894b0
jne 0x2ed98
movq -0x20(%rbp), %rdi
callq 0xa830
movq %rax, 0x5a718(%rip)     # 0x894b0
movq -0x20(%rbp), %rdi
movl $0x28, %esi
callq 0x9d60
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x2edc9
movq -0x28(%rbp), %rsi
leaq 0x39282(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x2edc7
cmpq $0x0, -0x28(%rbp)
jne 0x2eddd
movq $0x0, -0x8(%rbp)
jmp 0x2ef09
movq -0x28(%rbp), %rax
movw $0x8000, 0x20(%rax)     # imm = 0x8000
movq -0x28(%rbp), %rax
leaq 0x5a286(%rip), %rcx     # 0x89078
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
movb 0x22(%rax), %cl
andb $-0x2, %cl
orb $0x0, %cl
movb %cl, 0x22(%rax)
movq -0x20(%rbp), %rdi
leaq 0x10f(%rip), %rsi       # 0x2ef20
callq 0x9cc0
movq -0x20(%rbp), %rdi
leaq 0x76f(%rip), %rsi       # 0x2f590
callq 0x9d10
cmpq $0x0, -0x18(%rbp)
jne 0x2eebf
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x94b0
movq -0x20(%rbp), %rdi
movl $0x10, %esi
callq 0x9a50
callq 0x4cfc0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x2eea7
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0xb8(%rax), %rdx
xorl %esi, %esi
callq 0x302e0
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0xc0(%rax), %rdx
movl $0x1, %esi
callq 0x302e0
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0xc8(%rax), %rdx
movl $0x2, %esi
callq 0x302e0
jmp 0x2eebd
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdx
movl $0x2, %esi
callq 0x302e0
jmp 0x2ef01
movq -0x18(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x38(%rbp), %rax
movb 0x22(%rax), %dl
andb $0x1, %dl
movq -0x28(%rbp), %rax
movb 0x22(%rax), %cl
andb $0x1, %dl
andb $-0x2, %cl
orb %dl, %cl
movb %cl, 0x22(%rax)
movq -0x20(%rbp), %rdi
callq 0x9250
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)