// File: /workspace/github_c_makefile_star2_O1/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 *0x44183(%rip)          # 0x603c0
movl %eax, %ebx
cmpb $0x1, %al
jne 0x1c3f3
movzbl %bpl, %eax
cmpl $0x9, %eax
jg 0x1c27e
testl %eax, %eax
je 0x1c39f
cmpl $0x7, %eax
jne 0x1c3f3
leaq 0x27165(%rip), %rsi     # 0x433cd
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6bf5
cmpl $0xa, %eax
je 0x1c3d7
cmpl $0xb, %eax
jne 0x1c3f3
movq %r14, %rdi
callq 0x4abf
movq %rax, %rdi
callq 0x4abf
movq %rax, %r12
movq %rax, %rdi
callq 0x6ad8
movq %rax, %r15
andb $-0x3, 0x4a(%rax)
movq %r12, %rdi
callq 0x4ea3
movq %rax, %rdi
callq 0x2a39
cmpq %r12, %rax
jne 0x1c32d
callq 0x3784
movq %rax, %rdi
callq 0x3863
testb %al, %al
jne 0x1c32d
movq %r12, %rdi
xorl %esi, %esi
callq 0x1c5a9
testq %rax, %rax
je 0x1c322
movq %rax, %r13
movq %r13, %rdi
callq 0x136de
cmpb $0x1, %al
je 0x1c302
movzbl %al, %eax
cmpl $0x3, %eax
jne 0x1c30f
movb $0x2, %al
jmp 0x1c304
xorl %eax, %eax
movzbl %al, %esi
movq %r13, %rdi
callq 0x135d2
movq %r12, %rdi
movq %r13, %rsi
callq 0x1c5a9
movq %rax, %r13
testq %rax, %rax
jne 0x1c2ea
movq %r12, %rdi
movq %r14, %rsi
callq 0x1c404
movq %r14, 0x98(%r15)
callq 0x3784
movq %rax, %rdi
callq 0x3863
testb %al, %al
jne 0x1c3f3
testb $0x1, 0x82(%r15)
je 0x1c3f3
movq %r14, %rdi
callq 0x4abf
movq %rax, %rdi
callq 0x4abf
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
callq 0x1be72
movq %rax, %r12
xorl %esi, %esi
cmpq %r14, %r12
sete %sil
addl %esi, %esi
movq %r12, %rdi
callq 0x135d2
movq %r15, %rdi
movq %r12, %rsi
callq 0x1be72
movq %rax, %r12
testq %rax, %rax
jne 0x1c377
jmp 0x1c3f3
movq %r14, %rdi
callq 0x4abf
movq %rax, %rdi
callq 0x4abf
movq %rax, %r15
movq %rax, %rdi
callq 0x1c8dc
cmpq %r14, %rax
jne 0x1c3f3
movq %r15, %rdi
movq %r14, %rsi
callq 0x1be72
movq %r15, %rdi
movq %rax, %rsi
callq 0x1c404
jmp 0x1c3f3
movq %r14, %rdi
callq 0x4abf
movq %rax, %rdi
callq 0x4abf
movq %rax, %rdi
callq 0x6ad8
andb $-0x3, 0x4a(%rax)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq