// File: /workspace/github_c_makefile_star2_O3/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_list.c
// Function: lv_list_btn_signal
static lv_res_t lv_list_btn_signal(lv_obj_t * btn, lv_signal_t sign, void * param)
{
    lv_res_t res;

    /* Include the ancient signal function */
    res = ancestor_btn_signal(btn, sign, param);
    if(res != LV_RES_OK) return res;
    if(sign == LV_SIGNAL_GET_TYPE) return lv_obj_handle_get_type_signal(param, "");

    if(sign == LV_SIGNAL_RELEASED) {
        lv_obj_t * list          = lv_obj_get_parent(lv_obj_get_parent(btn));
        lv_list_ext_t * ext      = lv_obj_get_ext_attr(list);
        ext->page.scroll_prop_ip = 0;

#if LV_USE_GROUP
        lv_group_t * g = lv_obj_get_group(list);
        if(lv_group_get_focused(g) == list && lv_indev_is_dragging(lv_indev_get_act()) == false) {
            /* Is the list is focused then be sure only the button being released
             * has a pressed state to indicate the selected state on the list*/
            lv_obj_t * btn_i = lv_list_get_prev_btn(list, NULL);
            while(btn_i) {
                lv_btn_state_t s = lv_btn_get_state(btn_i);
                if(s == LV_BTN_STATE_PR)
                    lv_btn_set_state(btn_i, LV_BTN_STATE_REL);
                else if(s == LV_BTN_STATE_TGL_PR)
                    lv_btn_set_state(btn_i, LV_BTN_STATE_TGL_REL);
                btn_i = lv_list_get_prev_btn(list, btn_i);
            }

            /*Make the released button "selected"*/
            lv_list_set_btn_selected(list, btn);
        }

        /* If `click_focus == 1` then LV_SIGNAL_FOCUS need to know which button triggered the focus
         * to mark it as selected (pressed state)*/
        ext->last_clicked_btn = btn;
#endif
        if(lv_indev_is_dragging(lv_indev_get_act()) == false && ext->single_mode) {
            lv_list_btn_single_select(btn);
        }
    } else if(sign == LV_SIGNAL_PRESS_LOST) {
        lv_obj_t * list          = lv_obj_get_parent(lv_obj_get_parent(btn));
        lv_list_ext_t * ext      = lv_obj_get_ext_attr(list);
        ext->page.scroll_prop_ip = 0;
    } else if(sign == LV_SIGNAL_CLEANUP) {

#if LV_USE_GROUP
        lv_obj_t * list = lv_obj_get_parent(lv_obj_get_parent(btn));
        lv_obj_t * sel  = lv_list_get_btn_selected(list);
        if(sel == btn) lv_list_set_btn_selected(list, lv_list_get_next_btn(list, btn));
#endif
    }

    return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r14
callq *0x43988(%rip)          # 0x603c0
movl %eax, %ebx
cmpb $0x1, %al
jne 0x1cbf0
movzbl %bpl, %eax
movb $0x1, %bl
cmpl $0x9, %eax
jg 0x1ca7b
testl %eax, %eax
je 0x1cb9c
cmpl $0x7, %eax
jne 0x1cbf0
leaq 0x26b58(%rip), %rsi     # 0x435bd
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6c02
cmpl $0xa, %eax
je 0x1cbd4
cmpl $0xb, %eax
jne 0x1cbf0
movq %r14, %rdi
callq 0x4ab5
movq %rax, %rdi
callq 0x4ab5
movq %rax, %r12
movq %rax, %rdi
callq 0x6af7
movq %rax, %r15
andb $-0x3, 0x4a(%rax)
movq %r12, %rdi
callq 0x4ed1
movq %rax, %rdi
callq 0x2a19
cmpq %r12, %rax
jne 0x1cb2a
callq 0x378a
movq %rax, %rdi
callq 0x3869
testb %al, %al
jne 0x1cb2a
movq %r12, %rdi
xorl %esi, %esi
callq 0x1cdad
testq %rax, %rax
je 0x1cb1f
movq %rax, %r13
movq %r13, %rdi
callq 0x136d6
cmpb $0x1, %al
je 0x1caff
movzbl %al, %eax
cmpl $0x3, %eax
jne 0x1cb0c
movb $0x2, %al
jmp 0x1cb01
xorl %eax, %eax
movzbl %al, %esi
movq %r13, %rdi
callq 0x135ca
movq %r12, %rdi
movq %r13, %rsi
callq 0x1cdad
movq %rax, %r13
testq %rax, %rax
jne 0x1cae7
movq %r12, %rdi
movq %r14, %rsi
callq 0x1cc01
movq %r14, 0x98(%r15)
callq 0x378a
movq %rax, %rdi
callq 0x3869
testb %al, %al
jne 0x1cbf0
testb $0x1, 0x82(%r15)
je 0x1cbf0
movq %r14, %rdi
callq 0x4ab5
movq %rax, %rdi
callq 0x4ab5
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
callq 0x1c66d
movq %rax, %r12
xorl %esi, %esi
cmpq %r14, %r12
sete %sil
addl %esi, %esi
movq %r12, %rdi
callq 0x135ca
movq %r15, %rdi
movq %r12, %rsi
callq 0x1c66d
movq %rax, %r12
testq %rax, %rax
jne 0x1cb74
jmp 0x1cbf0
movq %r14, %rdi
callq 0x4ab5
movq %rax, %rdi
callq 0x4ab5
movq %rax, %r15
movq %rax, %rdi
callq 0x1d0e0
cmpq %r14, %rax
jne 0x1cbf0
movq %r15, %rdi
movq %r14, %rsi
callq 0x1c66d
movq %r15, %rdi
movq %rax, %rsi
callq 0x1cc01
jmp 0x1cbf0
movq %r14, %rdi
callq 0x4ab5
movq %rax, %rdi
callq 0x4ab5
movq %rax, %rdi
callq 0x6af7
andb $-0x3, 0x4a(%rax)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq