// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x12bd0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x18340
movq -0x20(%rbp), %rsi
leaq 0x4fd0b(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x1833e
cmpq $0x0, -0x20(%rbp)
jne 0x18354
movq $0x0, -0x8(%rbp)
jmp 0x18550
cmpq $0x0, 0x71084(%rip)     # 0x893e0
jne 0x18376
movq -0x20(%rbp), %rdi
callq 0x3e970
movq %rax, %rdi
callq 0xa830
movq %rax, 0x7106a(%rip)     # 0x893e0
cmpq $0x0, 0x7106a(%rip)     # 0x893e8
jne 0x18390
movq -0x20(%rbp), %rdi
callq 0xa830
movq %rax, 0x71058(%rip)     # 0x893e8
movq -0x20(%rbp), %rdi
movl $0x78, %esi
callq 0x9d60
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x183c1
movq -0x28(%rbp), %rsi
leaq 0x4fc8a(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x183bf
cmpq $0x0, -0x28(%rbp)
jne 0x183d5
movq $0x0, -0x8(%rbp)
jmp 0x18550
movq -0x28(%rbp), %rax
movb 0x66(%rax), %cl
andb $-0x5, %cl
orb $0x0, %cl
movb %cl, 0x66(%rax)
movq -0x28(%rbp), %rax
movb 0x70(%rax), %cl
andb $-0x2, %cl
orb $0x0, %cl
movb %cl, 0x70(%rax)
movq -0x20(%rbp), %rdi
leaq 0x160(%rip), %rsi       # 0x18560
callq 0x9cc0
movq -0x20(%rbp), %rdi
leaq 0x470(%rip), %rsi       # 0x18880
callq 0x9d10
cmpq $0x0, -0x18(%rbp)
jne 0x184ee
movq -0x20(%rbp), %rdi
callq 0x3e970
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0x95a0
movq -0x20(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x18ca0
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x14b00
movq -0x20(%rbp), %rdi
movl $0xc8, %esi
callq 0x18ce0
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x14660
movq -0x20(%rbp), %rdi
movl $0x3, %esi
callq 0x18d10
movq -0x28(%rbp), %rax
movq 0x50(%rax), %rdi
movl $0x1, %esi
callq 0x2aac0
movq -0x30(%rbp), %rdi
leaq 0x933(%rip), %rsi       # 0x18dd0
callq 0x9cc0
callq 0x4cfc0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x184e3
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x2b0(%rax), %rdx
xorl %esi, %esi
callq 0x19010
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x2b8(%rax), %rdx
movl $0x1, %esi
callq 0x19010
jmp 0x184ec
movq -0x20(%rbp), %rdi
callq 0x9250
jmp 0x18548
movq -0x18(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movb 0x70(%rax), %dl
andb $0x1, %dl
movq -0x28(%rbp), %rax
movb 0x70(%rax), %cl
andb $0x1, %dl
andb $-0x2, %cl
orb %dl, %cl
movb %cl, 0x70(%rax)
movq -0x20(%rbp), %rdi
callq 0x3e970
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x14b00
movq -0x48(%rbp), %rdi
leaq 0x896(%rip), %rsi       # 0x18dd0
callq 0x9cc0
movq -0x20(%rbp), %rdi
callq 0x9250
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)