// File: /workspace/github_c_makefile_star2_O2/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 *0x4376c(%rip)          # 0x5e3c0
movl %eax, %ebx
cmpb $0x1, %al
jne 0x1ae04
movb $0x1, %bl
testb %bpl, %bpl
je 0x1ad55
movzbl %bpl, %eax
cmpl $0xb, %eax
je 0x1aca1
cmpl $0xa, %eax
je 0x1ad34
cmpl $0x7, %eax
jne 0x1ae04
leaq 0x247ba(%rip), %rsi     # 0x3f445
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x684b
movq %r14, %rdi
callq 0x47bc
movq %rax, %rdi
callq 0x47bc
movq %rax, %r12
movq %rax, %rdi
callq 0x6747
movq %rax, %r15
andb $-0x3, 0x4a(%rax)
movq %r12, %rdi
callq 0x4b8e
movq %rax, %rdi
callq 0x29b8
cmpq %r12, %rax
jne 0x1ad9c
callq 0x35b3
movq %rax, %rdi
callq 0x3691
testb %al, %al
jne 0x1ad9c
movq %r12, %rdi
xorl %esi, %esi
callq 0x1afa5
movq %rax, %r13
testq %rax, %rax
je 0x1ad91
movq %r13, %rdi
callq 0x1289a
cmpb $0x1, %al
je 0x1ad1f
movzbl %al, %eax
cmpl $0x3, %eax
jne 0x1ad2c
movb $0x2, %al
jmp 0x1ad21
xorl %eax, %eax
movzbl %al, %esi
movq %r13, %rdi
callq 0x1278e
movq %r12, %rdi
movq %r13, %rsi
jmp 0x1acf6
movq %r14, %rdi
callq 0x47bc
movq %rax, %rdi
callq 0x47bc
movq %rax, %rdi
callq 0x6747
andb $-0x3, 0x4a(%rax)
jmp 0x1ae04
movq %r14, %rdi
callq 0x47bc
movq %rax, %rdi
callq 0x47bc
movq %rax, %r15
movq %rax, %rdi
callq 0x1b2d2
cmpq %r14, %rax
jne 0x1ae04
movq %r15, %rdi
movq %r14, %rsi
callq 0x1a8ac
movq %r15, %rdi
movq %rax, %rsi
callq 0x1ae15
jmp 0x1ae04
movq %r12, %rdi
movq %r14, %rsi
callq 0x1ae15
movq %r14, 0x98(%r15)
callq 0x35b3
movq %rax, %rdi
callq 0x3691
testb %al, %al
jne 0x1ae04
testb $0x1, 0x82(%r15)
je 0x1ae04
movq %r14, %rdi
callq 0x47bc
movq %rax, %rdi
callq 0x47bc
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
callq 0x1a8ac
movq %rax, %r12
xorl %esi, %esi
cmpq %r14, %r12
sete %sil
addl %esi, %esi
movq %r12, %rdi
callq 0x1278e
movq %r15, %rdi
movq %r12, %rsi
callq 0x1a8ac
movq %rax, %r12
testq %rax, %rax
jne 0x1adde
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq