// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
callq 0xaa44
movq %rax, %rbx
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0xddc9
testq %rbx, %rbx
je 0xddda
cmpq $0x0, 0x50615(%rip)     # 0x5e310
jne 0xdd14
movq %rbx, %rdi
callq 0x245d9
movq %rax, %rdi
callq 0x66db
movq %rax, 0x505fc(%rip)     # 0x5e310
cmpq $0x0, 0x505fc(%rip)     # 0x5e318
jne 0xdd2d
movq %rbx, %rdi
callq 0x66db
movq %rax, 0x505eb(%rip)     # 0x5e318
pushq $0x78
popq %rsi
movq %rbx, %rdi
callq 0x6146
movq %rax, %r14
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0xddea
testq %r14, %r14
je 0xddda
andb $-0x5, 0x66(%r14)
andb $-0x2, 0x70(%r14)
leaq 0x146(%rip), %rsi       # 0xdeab
movq %rbx, %rdi
callq 0x60e6
leaq 0x31b(%rip), %rsi       # 0xe08f
movq %rbx, %rdi
callq 0x6116
testq %r15, %r15
je 0xddfb
movq %r15, %rdi
callq 0x6747
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 0x245d9
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
callq 0xbbaf
leaq 0x752(%rip), %rsi       # 0xe509
movq %r14, %rdi
callq 0x60e6
movq %rbx, %rdi
callq 0x5ae7
jmp 0xdddc
leaq 0x2d270(%rip), %rdi     # 0x3b040
movq %rbx, %rsi
callq 0x7b01
jmp 0xddd8
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2d24f(%rip), %rdi     # 0x3b040
movq %r14, %rsi
callq 0x7b01
jmp 0xddf9
movq %rbx, %rdi
callq 0x245d9
movq %rax, %r15
pushq $0x1
popq %rbp
movq %rax, %rdi
movl %ebp, %esi
callq 0x5ce4
movq %rbx, %rdi
callq 0x245d9
movq %rax, %rdi
movl %ebp, %esi
movl %ebp, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x20c30
movq %rbx, %rdi
xorl %esi, %esi
callq 0xbbaf
movq %rbx, %rdi
movl $0xc8, %esi
callq 0x24605
movq %rbx, %rdi
movl %ebp, %esi
callq 0xb961
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0xe49c
movq 0x50(%r14), %rdi
movl %ebp, %esi
callq 0x18d16
leaq 0x69f(%rip), %rsi       # 0xe509
movq %r15, %rdi
callq 0x60e6
callq 0x2be75
testq %rax, %rax
je 0xddbf
movq %rax, %r14
movq 0x2b0(%rax), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xe669
movq 0x2b8(%r14), %rdx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xe669
jmp 0xdddc