// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_ddlist.c
// Function: lv_ddlist_signal
static lv_res_t lv_ddlist_signal(lv_obj_t * ddlist, lv_signal_t sign, void * param)
{
    lv_res_t res;
    /* Include the ancient signal function */
    res = ancestor_signal(ddlist, 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_ddlist_ext_t * ext = lv_obj_get_ext_attr(ddlist);

    if(sign == LV_SIGNAL_STYLE_CHG) {
        lv_ddlist_refr_size(ddlist, 0);
    } else if(sign == LV_SIGNAL_BASE_DIR_CHG) {
        lv_label_align_t align = lv_label_get_align(ext->label);
        switch(align) {
            case LV_LABEL_ALIGN_LEFT: lv_obj_align(ext->label, NULL, LV_ALIGN_IN_LEFT_MID, 0, 0); break;
            case LV_LABEL_ALIGN_CENTER: lv_obj_align(ext->label, NULL, LV_ALIGN_CENTER, 0, 0); break;
            case LV_LABEL_ALIGN_RIGHT: lv_obj_align(ext->label, NULL, LV_ALIGN_IN_RIGHT_MID, 0, 0); break;
        }

        lv_ddlist_refr_size(ddlist, 0);
    } else if(sign == LV_SIGNAL_CLEANUP) {
        ext->label = NULL;
    } else if(sign == LV_SIGNAL_FOCUS) {
#if LV_USE_GROUP
        lv_group_t * g             = lv_obj_get_group(ddlist);
        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) {
            /*Open the list if editing*/
            if(editing) {
                ext->opened         = true;
                ext->sel_opt_id_ori = ext->sel_opt_id;
                lv_ddlist_refr_size(ddlist, true);
            }
            /*Close the lift if navigating*/
            else {
                ext->opened     = false;
                ext->sel_opt_id = ext->sel_opt_id_ori;
                lv_ddlist_refr_size(ddlist, true);
            }
        } else {
            /*Open the list if closed*/
            if(!ext->opened) {
                ext->opened         = true;
                ext->sel_opt_id_ori = ext->sel_opt_id; /*Save the current value. Used to revert this
                                                          state if ENER wont't be pressed*/
                lv_ddlist_refr_size(ddlist, true);
            }
        }
#endif
    } else if(sign == LV_SIGNAL_RELEASED) {
        release_handler(ddlist);
    } else if(sign == LV_SIGNAL_DEFOCUS) {
        if(ext->opened) {
            ext->opened     = false;
            ext->sel_opt_id = ext->sel_opt_id_ori;
            lv_ddlist_refr_size(ddlist, true);
        }
    } else if(sign == LV_SIGNAL_CONTROL) {
        char c = *((char *)param);
        if(c == LV_KEY_RIGHT || c == LV_KEY_DOWN) {
            if(!ext->opened) {
                ext->opened = 1;
                lv_ddlist_refr_size(ddlist, true);
            }

            if(ext->sel_opt_id + 1 < ext->option_cnt) {
                ext->sel_opt_id++;
                lv_ddlist_pos_current_option(ddlist);
                lv_obj_invalidate(ddlist);
            }
        } else if(c == LV_KEY_LEFT || c == LV_KEY_UP) {
            if(!ext->opened) {
                ext->opened = 1;
                lv_ddlist_refr_size(ddlist, true);
            }
            if(ext->sel_opt_id > 0) {
                ext->sel_opt_id--;
                lv_ddlist_pos_current_option(ddlist);
                lv_obj_invalidate(ddlist);
            }
        } else if(c == LV_KEY_ESC) {
            if(ext->opened) {
                ext->opened     = 0;
                ext->sel_opt_id = ext->sel_opt_id_ori;
                lv_ddlist_refr_size(ddlist, true);
            }
        }
    } else if(sign == LV_SIGNAL_GET_EDITABLE) {
        bool * editable = (bool *)param;
        *editable       = true;
    }

    return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movb %sil, %al
movq %rdi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq %rdx, -0x20(%rbp)
movq 0x762d3(%rip), %rax     # 0x893a0
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 0x130f4
movb -0x21(%rbp), %al
movb %al, -0x1(%rbp)
jmp 0x134b9
movzbl -0x11(%rbp), %eax
cmpl $0x7, %eax
jne 0x13115
movq -0x20(%rbp), %rdi
leaq 0x550a2(%rip), %rsi     # 0x681aa
callq 0xaa80
movb %al, -0x1(%rbp)
jmp 0x134b9
movq -0x10(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x30(%rbp)
movzbl -0x11(%rbp), %eax
cmpl $0x4, %eax
jne 0x1313b
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x140b0
jmp 0x134b3
movzbl -0x11(%rbp), %eax
cmpl $0x5, %eax
jne 0x131df
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x2ab50
movb %al, -0x31(%rbp)
movzbl -0x31(%rbp), %eax
movl %eax, -0x54(%rbp)
testl %eax, %eax
je 0x13179
jmp 0x13165
movl -0x54(%rbp), %eax
subl $0x1, %eax
je 0x13197
jmp 0x1316f
movl -0x54(%rbp), %eax
subl $0x2, %eax
je 0x131b3
jmp 0x131cf
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x7, %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x8500
jmp 0x131cf
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %r8d, %r8d
movl %r8d, %edx
movl %r8d, %ecx
callq 0x8500
jmp 0x131cf
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x8, %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x8500
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x140b0
jmp 0x134b1
movzbl -0x11(%rbp), %eax
cmpl $0x0, %eax
jne 0x131f9
movq -0x30(%rbp), %rax
movq $0x0, 0x50(%rax)
jmp 0x134af
movzbl -0x11(%rbp), %eax
cmpl $0x10, %eax
jne 0x132e2
movq -0x10(%rbp), %rdi
callq 0x77c0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0x32e0
andb $0x1, %al
movb %al, -0x41(%rbp)
callq 0x4b70
movq %rax, %rdi
callq 0x4b80
movb %al, -0x42(%rbp)
movzbl -0x42(%rbp), %eax
cmpl $0x4, %eax
jne 0x132a0
testb $0x1, -0x41(%rbp)
je 0x13270
movq -0x30(%rbp), %rax
movb 0x66(%rax), %cl
andb $-0x2, %cl
orb $0x1, %cl
movb %cl, 0x66(%rax)
movq -0x30(%rbp), %rax
movw 0x62(%rax), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x64(%rax)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x140b0
jmp 0x1329e
movq -0x30(%rbp), %rax
movb 0x66(%rax), %cl
andb $-0x2, %cl
orb $0x0, %cl
movb %cl, 0x66(%rax)
movq -0x30(%rbp), %rax
movw 0x64(%rax), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x62(%rax)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x140b0
jmp 0x132dd
movq -0x30(%rbp), %rax
movb 0x66(%rax), %al
andb $0x1, %al
cmpb $0x0, %al
jne 0x132db
movq -0x30(%rbp), %rax
movb 0x66(%rax), %cl
andb $-0x2, %cl
orb $0x1, %cl
movb %cl, 0x66(%rax)
movq -0x30(%rbp), %rax
movw 0x62(%rax), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x64(%rax)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x140b0
jmp 0x132dd
jmp 0x134ad
movzbl -0x11(%rbp), %eax
cmpl $0xb, %eax
jne 0x132f9
movq -0x10(%rbp), %rdi
callq 0x14c60
jmp 0x134ab
movzbl -0x11(%rbp), %eax
cmpl $0x11, %eax
jne 0x13342
movq -0x30(%rbp), %rax
movb 0x66(%rax), %al
andb $0x1, %al
cmpb $0x0, %al
je 0x1333d
movq -0x30(%rbp), %rax
movb 0x66(%rax), %cl
andb $-0x2, %cl
orb $0x0, %cl
movb %cl, 0x66(%rax)
movq -0x30(%rbp), %rax
movw 0x64(%rax), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x62(%rax)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x140b0
jmp 0x134a9
movzbl -0x11(%rbp), %eax
cmpl $0x12, %eax
jne 0x1348d
movq -0x20(%rbp), %rax
movb (%rax), %al
movb %al, -0x43(%rbp)
movsbl -0x43(%rbp), %eax
cmpl $0x13, %eax
je 0x1336a
movsbl -0x43(%rbp), %eax
cmpl $0x12, %eax
jne 0x133d3
movq -0x30(%rbp), %rax
movb 0x66(%rax), %al
andb $0x1, %al
cmpb $0x0, %al
jne 0x13395
movq -0x30(%rbp), %rax
movb 0x66(%rax), %cl
andb $-0x2, %cl
orb $0x1, %cl
movb %cl, 0x66(%rax)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x140b0
movq -0x30(%rbp), %rax
movzwl 0x62(%rax), %eax
addl $0x1, %eax
movq -0x30(%rbp), %rcx
movzwl 0x60(%rcx), %ecx
cmpl %ecx, %eax
jge 0x133ce
movq -0x30(%rbp), %rax
movw 0x62(%rax), %cx
addw $0x1, %cx
movw %cx, 0x62(%rax)
movq -0x10(%rbp), %rdi
callq 0x14360
movq -0x10(%rbp), %rdi
callq 0x7430
jmp 0x1348b
movsbl -0x43(%rbp), %eax
cmpl $0x14, %eax
je 0x133e5
movsbl -0x43(%rbp), %eax
cmpl $0x11, %eax
jne 0x13441
movq -0x30(%rbp), %rax
movb 0x66(%rax), %al
andb $0x1, %al
cmpb $0x0, %al
jne 0x13410
movq -0x30(%rbp), %rax
movb 0x66(%rax), %cl
andb $-0x2, %cl
orb $0x1, %cl
movb %cl, 0x66(%rax)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x140b0
movq -0x30(%rbp), %rax
movzwl 0x62(%rax), %eax
cmpl $0x0, %eax
jle 0x1343f
movq -0x30(%rbp), %rax
movw 0x62(%rax), %cx
addw $-0x1, %cx
movw %cx, 0x62(%rax)
movq -0x10(%rbp), %rdi
callq 0x14360
movq -0x10(%rbp), %rdi
callq 0x7430
jmp 0x13489
movsbl -0x43(%rbp), %eax
cmpl $0x1b, %eax
jne 0x13487
movq -0x30(%rbp), %rax
movb 0x66(%rax), %al
andb $0x1, %al
cmpb $0x0, %al
je 0x13485
movq -0x30(%rbp), %rax
movb 0x66(%rax), %cl
andb $-0x2, %cl
orb $0x0, %cl
movb %cl, 0x66(%rax)
movq -0x30(%rbp), %rax
movw 0x64(%rax), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x62(%rax)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x140b0
jmp 0x13487
jmp 0x13489
jmp 0x1348b
jmp 0x134a7
movzbl -0x11(%rbp), %eax
cmpl $0x13, %eax
jne 0x134a5
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movb $0x1, (%rax)
jmp 0x134a7
jmp 0x134a9
jmp 0x134ab
jmp 0x134ad
jmp 0x134af
jmp 0x134b1
jmp 0x134b3
movb -0x21(%rbp), %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)