// File: /workspace/github_c_makefile_star2_O3/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 0xb390
movq %rax, %rbx
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0xe89d
testq %rbx, %rbx
je 0xe8ae
cmpq $0x0, 0x51b43(%rip)     # 0x60310
jne 0xe7e6
movq %rbx, %rdi
callq 0x2695e
movq %rax, %rdi
callq 0x6a8b
movq %rax, 0x51b2a(%rip)     # 0x60310
cmpq $0x0, 0x51b2a(%rip)     # 0x60318
jne 0xe7ff
movq %rbx, %rdi
callq 0x6a8b
movq %rax, 0x51b19(%rip)     # 0x60318
movq %rbx, %rdi
movl $0x78, %esi
callq 0x64db
movq %rax, %r14
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0xe8b9
testq %r14, %r14
je 0xe8ae
andb $-0x5, 0x66(%r14)
andb $-0x2, 0x70(%r14)
leaq 0x151(%rip), %rsi       # 0xe98a
movq %rbx, %rdi
callq 0x647b
leaq 0x31f(%rip), %rsi       # 0xeb67
movq %rbx, %rdi
callq 0x64ab
testq %r15, %r15
je 0xe8ca
movq %r15, %rdi
callq 0x6af7
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 0x2695e
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
callq 0xc5b1
leaq 0x766(%rip), %rsi       # 0xeff1
movq %r14, %rdi
callq 0x647b
movq %rbx, %rdi
callq 0x5e54
jmp 0xe8b0
leaq 0x3082c(%rip), %rdi     # 0x3f0d0
movq %rbx, %rsi
callq 0x8294
jmp 0xe8ac
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x30810(%rip), %rdi     # 0x3f0d0
movq %r14, %rsi
callq 0x8294
jmp 0xe8c8
movq %rbx, %rdi
callq 0x2695e
movq %rax, %r15
movq %rax, %rdi
movl $0x1, %esi
callq 0x606c
movq %rbx, %rdi
callq 0x2695e
movq %rax, %rdi
movl $0x1, %esi
movl $0x1, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x22d84
movq %rbx, %rdi
xorl %esi, %esi
callq 0xc5b1
movq %rbx, %rdi
movl $0xc8, %esi
callq 0x2698a
movq %rbx, %rdi
movl $0x1, %esi
callq 0xc339
movq %rbx, %rdi
movl $0x3, %esi
callq 0xef82
movq 0x50(%r14), %rdi
movl $0x1, %esi
callq 0x1a95d
leaq 0x6aa(%rip), %rsi       # 0xeff1
movq %r15, %rdi
callq 0x647b
callq 0x2e91c
testq %rax, %rax
je 0xe893
movq %rax, %r14
movq 0x2b0(%rax), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xf150
movq 0x2b8(%r14), %rdx
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf150
jmp 0xe8b0