// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_roller.c
// Function: lv_roller_signal
static lv_res_t lv_roller_signal(lv_obj_t * roller, lv_signal_t sign, void * param)
{
    lv_res_t res = LV_RES_OK;

    /*Don't let the drop down list to handle the control signals. It works differently*/
    if(sign != LV_SIGNAL_CONTROL && sign != LV_SIGNAL_FOCUS && sign != LV_SIGNAL_DEFOCUS) {
        /* Include the ancient signal function */
        res = ancestor_signal(roller, sign, param);
        if(res != LV_RES_OK) return res;
    }
    if(sign == LV_SIGNAL_GET_TYPE) return lv_obj_handle_get_type_signal(param, LV_OBJX_NAME);

    lv_roller_ext_t * ext = lv_obj_get_ext_attr(roller);

    if(sign == LV_SIGNAL_STYLE_CHG) {
        refr_height(roller);

        refr_position(roller, false);
    } else if(sign == LV_SIGNAL_CORD_CHG) {

        if(lv_obj_get_width(roller) != lv_area_get_width(param) ||
           lv_obj_get_height(roller) != lv_area_get_height(param)) {

            refr_height(roller);
#if LV_USE_ANIMATION
            lv_anim_del(lv_page_get_scrl(roller), (lv_anim_exec_xcb_t)lv_obj_set_y);
#endif
            lv_ddlist_set_selected(roller, ext->ddlist.sel_opt_id);
            refr_position(roller, false);
        }
    } else if(sign == LV_SIGNAL_FOCUS) {
#if LV_USE_GROUP
        lv_group_t * g             = lv_obj_get_group(roller);
        bool editing               = lv_group_get_editing(g);
        lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act());

        /*Encoders need special handling*/
        if(indev_type == LV_INDEV_TYPE_ENCODER) {
            /*In navigate mode revert the original value*/
            if(!editing) {
                if(ext->ddlist.sel_opt_id != ext->ddlist.sel_opt_id_ori) {
                    ext->ddlist.sel_opt_id = ext->ddlist.sel_opt_id_ori;
                    refr_position(roller, true);
                }
            }
            /*Save the current state when entered to edit mode*/
            else {
                ext->ddlist.sel_opt_id_ori = ext->ddlist.sel_opt_id;
            }
        } else {
            ext->ddlist.sel_opt_id_ori = ext->ddlist.sel_opt_id; /*Save the current value. Used to revert this state if
                                                                    ENER wont't be pressed*/
        }
#endif
    } else if(sign == LV_SIGNAL_DEFOCUS) {
#if LV_USE_GROUP
        /*Revert the original state*/
        if(ext->ddlist.sel_opt_id != ext->ddlist.sel_opt_id_ori) {
            ext->ddlist.sel_opt_id = ext->ddlist.sel_opt_id_ori;
            refr_position(roller, true);
        }
#endif
    } else if(sign == LV_SIGNAL_CONTROL) {
        char c = *((char *)param);
        if(c == LV_KEY_RIGHT || c == LV_KEY_DOWN) {
            if(ext->ddlist.sel_opt_id + 1 < ext->ddlist.option_cnt) {
                uint16_t ori_id = ext->ddlist.sel_opt_id_ori; /*lv_roller_set_selceted will overwrite this*/
                lv_roller_set_selected(roller, ext->ddlist.sel_opt_id + 1, true);
                ext->ddlist.sel_opt_id_ori = ori_id;
            }
        } else if(c == LV_KEY_LEFT || c == LV_KEY_UP) {
            if(ext->ddlist.sel_opt_id > 0) {
                uint16_t ori_id = ext->ddlist.sel_opt_id_ori; /*lv_roller_set_selceted will overwrite this*/
                lv_roller_set_selected(roller, ext->ddlist.sel_opt_id - 1, true);
                ext->ddlist.sel_opt_id_ori = ori_id;
            }
        }
    }

    return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb %sil, %al
movq %rdi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq %rdx, -0x20(%rbp)
movb $0x1, -0x21(%rbp)
movzbl -0x11(%rbp), %eax
cmpl $0x12, %eax
je 0x185c5
movzbl -0x11(%rbp), %eax
cmpl $0x10, %eax
je 0x185c5
movzbl -0x11(%rbp), %eax
cmpl $0x11, %eax
je 0x185c5
movq 0x70e4c(%rip), %rax     # 0x893e8
movq -0x10(%rbp), %rdi
movb -0x11(%rbp), %cl
movq -0x20(%rbp), %rdx
movzbl %cl, %esi
callq *%rax
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %eax
cmpl $0x1, %eax
je 0x185c3
movb -0x21(%rbp), %al
movb %al, -0x1(%rbp)
jmp 0x18868
jmp 0x185c5
movzbl -0x11(%rbp), %eax
cmpl $0x7, %eax
jne 0x185e6
movq -0x20(%rbp), %rdi
leaq 0x4fe3c(%rip), %rsi     # 0x68415
callq 0xaa80
movb %al, -0x1(%rbp)
jmp 0x18868
movq -0x10(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x30(%rbp)
movzbl -0x11(%rbp), %eax
cmpl $0x4, %eax
jne 0x18615
movq -0x10(%rbp), %rdi
callq 0x19210
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x194e0
jmp 0x18862
movzbl -0x11(%rbp), %eax
cmpl $0x2, %eax
jne 0x186aa
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movl %eax, -0x44(%rbp)
movq -0x20(%rbp), %rdi
callq 0x19b00
movw %ax, %cx
movl -0x44(%rbp), %eax
movswl %cx, %ecx
cmpl %ecx, %eax
jne 0x18668
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movl %eax, -0x48(%rbp)
movq -0x20(%rbp), %rdi
callq 0x19b20
movw %ax, %cx
movl -0x48(%rbp), %eax
movswl %cx, %ecx
cmpl %ecx, %eax
je 0x186a5
movq -0x10(%rbp), %rdi
callq 0x19210
movq -0x10(%rbp), %rdi
callq 0x3e970
movq %rax, %rdi
leaq -0x10564(%rip), %rsi    # 0x8120
callq 0x44560
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzwl 0x62(%rax), %esi
callq 0x14290
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x194e0
jmp 0x18860
movzbl -0x11(%rbp), %eax
cmpl $0x10, %eax
jne 0x1874c
movq -0x10(%rbp), %rdi
callq 0x77c0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0x32e0
andb $0x1, %al
movb %al, -0x39(%rbp)
callq 0x4b70
movq %rax, %rdi
callq 0x4b80
movb %al, -0x3a(%rbp)
movzbl -0x3a(%rbp), %eax
cmpl $0x4, %eax
jne 0x18737
testb $0x1, -0x39(%rbp)
jne 0x18725
movq -0x30(%rbp), %rax
movzwl 0x62(%rax), %eax
movq -0x30(%rbp), %rcx
movzwl 0x64(%rcx), %ecx
cmpl %ecx, %eax
je 0x18723
movq -0x30(%rbp), %rax
movw 0x64(%rax), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x62(%rax)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x194e0
jmp 0x18735
movq -0x30(%rbp), %rax
movw 0x62(%rax), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x64(%rax)
jmp 0x18747
movq -0x30(%rbp), %rax
movw 0x62(%rax), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x64(%rax)
jmp 0x1885e
movzbl -0x11(%rbp), %eax
cmpl $0x11, %eax
jne 0x1878c
movq -0x30(%rbp), %rax
movzwl 0x62(%rax), %eax
movq -0x30(%rbp), %rcx
movzwl 0x64(%rcx), %ecx
cmpl %ecx, %eax
je 0x18787
movq -0x30(%rbp), %rax
movw 0x64(%rax), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x62(%rax)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x194e0
jmp 0x1885c
movzbl -0x11(%rbp), %eax
cmpl $0x12, %eax
jne 0x1885a
movq -0x20(%rbp), %rax
movb (%rax), %al
movb %al, -0x3b(%rbp)
movsbl -0x3b(%rbp), %eax
cmpl $0x13, %eax
je 0x187b4
movsbl -0x3b(%rbp), %eax
cmpl $0x12, %eax
jne 0x18801
movq -0x30(%rbp), %rax
movzwl 0x62(%rax), %eax
addl $0x1, %eax
movq -0x30(%rbp), %rcx
movzwl 0x60(%rcx), %ecx
cmpl %ecx, %eax
jge 0x187ff
movq -0x30(%rbp), %rax
movw 0x64(%rax), %ax
movw %ax, -0x3e(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzwl 0x62(%rax), %eax
addl $0x1, %eax
movl $0x1, %edx
movzwl %ax, %esi
callq 0x19300
movw -0x3e(%rbp), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x64(%rax)
jmp 0x18858
movsbl -0x3b(%rbp), %eax
cmpl $0x14, %eax
je 0x18813
movsbl -0x3b(%rbp), %eax
cmpl $0x11, %eax
jne 0x18856
movq -0x30(%rbp), %rax
movzwl 0x62(%rax), %eax
cmpl $0x0, %eax
jle 0x18854
movq -0x30(%rbp), %rax
movw 0x64(%rax), %ax
movw %ax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movzwl 0x62(%rax), %eax
subl $0x1, %eax
movl $0x1, %edx
movzwl %ax, %esi
callq 0x19300
movw -0x40(%rbp), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x64(%rax)
jmp 0x18856
jmp 0x18858
jmp 0x1885a
jmp 0x1885c
jmp 0x1885e
jmp 0x18860
jmp 0x18862
movb -0x21(%rbp), %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)