// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
callq 0x84f4
movq %rax, %rbx
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0x1b6b8
testq %rbx, %rbx
je 0x1b6c9
cmpq $0x0, 0x42dd3(%rip)     # 0x5e3d8
jne 0x1b616
movq %rbx, %rdi
callq 0x66ff
movq %rax, 0x42dc2(%rip)     # 0x5e3d8
cmpq $0x0, 0x42dc2(%rip)     # 0x5e3e0
jne 0x1b62f
movq %rbx, %rdi
callq 0x66db
movq %rax, 0x42db1(%rip)     # 0x5e3e0
pushq $0x28
popq %rsi
movq %rbx, %rdi
callq 0x6146
movq %rax, %r15
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0x1b6d4
testq %r15, %r15
je 0x1b6c9
movw $0x8000, 0x20(%r15)     # imm = 0x8000
leaq 0x42948(%rip), %rax     # 0x5dfa8
movq %rax, 0x18(%r15)
andb $-0x2, 0x22(%r15)
leaq 0xd5(%rip), %rsi        # 0x1b745
movq %rbx, %rdi
callq 0x60e6
leaq 0x403(%rip), %rsi       # 0x1ba82
movq %rbx, %rdi
callq 0x6116
testq %r14, %r14
je 0x1b6e5
movq %r14, %rdi
callq 0x6747
movq 0x18(%rax), %rcx
movq %rcx, 0x18(%r15)
movb 0x22(%rax), %al
andb $0x1, %al
movb 0x22(%r15), %cl
andb $-0x2, %cl
orb %al, %cl
movb %cl, 0x22(%r15)
movq %rbx, %rdi
callq 0x5ae7
jmp 0x1b6cb
leaq 0x1f981(%rip), %rdi     # 0x3b040
movq %rbx, %rsi
callq 0x7b01
jmp 0x1b6c7
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1f965(%rip), %rdi     # 0x3b040
movq %r15, %rsi
callq 0x7b01
jmp 0x1b6e3
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x5c6f
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x5f71
callq 0x2be75
testq %rax, %rax
je 0x1b734
movq %rax, %r14
movq 0xb8(%rax), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1c13f
movq 0xc0(%r14), %rdx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x1c13f
movq 0xc8(%r14), %rdx
jmp 0x1b738
movq 0x18(%r15), %rdx
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x1c13f
jmp 0x1b6cb