// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_roller.c
// Function: lv_roller_create
lv_obj_t * lv_roller_create(lv_obj_t * par, const lv_obj_t * copy)
{
    LV_LOG_TRACE("roller create started");

    /*Create the ancestor of roller*/
    lv_obj_t * new_roller = lv_ddlist_create(par, copy);
    LV_ASSERT_MEM(new_roller);
    if(new_roller == NULL) return NULL;

    if(ancestor_scrl_signal == NULL) ancestor_scrl_signal = lv_obj_get_signal_cb(lv_page_get_scrl(new_roller));
    if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_roller);

    /*Allocate the roller type specific extended data*/
    lv_roller_ext_t * ext = lv_obj_allocate_ext_attr(new_roller, sizeof(lv_roller_ext_t));
    LV_ASSERT_MEM(ext);
    if(ext == NULL) return NULL;
    ext->ddlist.draw_arrow = 0; /*Do not draw arrow by default*/
    ext->mode = LV_ROLLER_MODE_NORMAL;

    /*The signal and design functions are not copied so set them here*/
    lv_obj_set_signal_cb(new_roller, lv_roller_signal);
    lv_obj_set_design_cb(new_roller, lv_roller_design);

    /*Init the new roller roller*/
    if(copy == NULL) {
        lv_obj_t * scrl = lv_page_get_scrl(new_roller);
        lv_obj_set_drag(scrl, true);                                  /*In ddlist it might be disabled*/
        lv_page_set_scrl_fit2(new_roller, LV_FIT_TIGHT, LV_FIT_NONE); /*Height is specified directly*/
        lv_ddlist_open(new_roller, false);
        lv_ddlist_set_anim_time(new_roller, LV_ROLLER_DEF_ANIM_TIME);
        lv_ddlist_set_stay_open(new_roller, true);
        lv_roller_set_visible_row_count(new_roller, 3);
        lv_label_set_align(ext->ddlist.label, LV_LABEL_ALIGN_CENTER);

        lv_obj_set_signal_cb(scrl, lv_roller_scrl_signal);

        /*Set the default styles*/
        lv_theme_t * th = lv_theme_get_current();
        if(th) {
            lv_roller_set_style(new_roller, LV_ROLLER_STYLE_BG, th->style.roller.bg);
            lv_roller_set_style(new_roller, LV_ROLLER_STYLE_SEL, th->style.roller.sel);
        } else {
            /*Refresh the roller's style*/
            lv_obj_refresh_style(new_roller); /*To set scrollable size automatically*/
        }
    }
    /*Copy an existing roller*/
    else {
        lv_roller_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
        ext->mode                  = copy_ext->mode;

        lv_obj_t * scrl = lv_page_get_scrl(new_roller);
        lv_ddlist_open(new_roller, false);
        lv_obj_set_signal_cb(scrl, lv_roller_scrl_signal);

        /*Refresh the roller's style*/
        lv_obj_refresh_style(new_roller); /*Refresh the style with new signal function*/
    }

    LV_LOG_INFO("roller created");

    return new_roller;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
callq 0xb418
movq %rax, %rbx
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0xe979
testq %rbx, %rbx
je 0xe98a
cmpq $0x0, 0x51a67(%rip)     # 0x60310
jne 0xe8c2
movq %rbx, %rdi
callq 0x26288
movq %rax, %rdi
callq 0x6a6c
movq %rax, 0x51a4e(%rip)     # 0x60310
cmpq $0x0, 0x51a4e(%rip)     # 0x60318
jne 0xe8db
movq %rbx, %rdi
callq 0x6a6c
movq %rax, 0x51a3d(%rip)     # 0x60318
movq %rbx, %rdi
movl $0x78, %esi
callq 0x64bc
movq %rax, %r14
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0xe995
testq %r14, %r14
je 0xe98a
andb $-0x5, 0x66(%r14)
andb $-0x2, 0x70(%r14)
leaq 0x151(%rip), %rsi       # 0xea66
movq %rbx, %rdi
callq 0x645c
leaq 0x328(%rip), %rsi       # 0xec4c
movq %rbx, %rdi
callq 0x648c
testq %r15, %r15
je 0xe9a6
movq %r15, %rdi
callq 0x6ad8
movb 0x70(%rax), %al
andb $0x1, %al
movb 0x70(%r14), %cl
andb $-0x2, %cl
orb %al, %cl
movb %cl, 0x70(%r14)
movq %rbx, %rdi
callq 0x26288
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
callq 0xc678
leaq 0x71f(%rip), %rsi       # 0xf086
movq %r14, %rdi
callq 0x645c
movq %rbx, %rdi
callq 0x5e38
jmp 0xe98c
leaq 0x306c0(%rip), %rdi     # 0x3f040
movq %rbx, %rsi
callq 0x829e
jmp 0xe988
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x306a4(%rip), %rdi     # 0x3f040
movq %r14, %rsi
callq 0x829e
jmp 0xe9a4
movq %rbx, %rdi
callq 0x26288
movq %rax, %r15
movq %rax, %rdi
movl $0x1, %esi
callq 0x604d
movq %rbx, %rdi
callq 0x26288
movq %rax, %rdi
movl $0x1, %esi
movl $0x1, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x22602
movq %rbx, %rdi
xorl %esi, %esi
callq 0xc678
movq %rbx, %rdi
movl $0xc8, %esi
callq 0x262b4
movq %rbx, %rdi
movl $0x1, %esi
callq 0xc400
movq %rbx, %rdi
movl $0x3, %esi
callq 0xf017
movq 0x50(%r14), %rdi
movl $0x1, %esi
callq 0x1a196
leaq 0x663(%rip), %rsi       # 0xf086
movq %r15, %rdi
callq 0x645c
callq 0x2e244
testq %rax, %rax
je 0xe96f
movq %rax, %r14
movq 0x2b0(%rax), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xf1f4
movq 0x2b8(%r14), %rdx
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf1f4
jmp 0xe98c