// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_tabview.c
// Function: lv_tabview_signal
static lv_res_t lv_tabview_signal(lv_obj_t * tabview, lv_signal_t sign, void * param)
{
    lv_res_t res;

    /* Include the ancient signal function */
    res = ancestor_signal(tabview, 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_tabview_ext_t * ext = lv_obj_get_ext_attr(tabview);
    if(sign == LV_SIGNAL_CLEANUP) {
        uint8_t i;
        for(i = 0; ext->tab_name_ptr[i][0] != '\0'; i++) lv_mem_free(ext->tab_name_ptr[i]);

        lv_mem_free(ext->tab_name_ptr);
        ext->tab_name_ptr = NULL;
        ext->btns         = NULL; /*These objects were children so they are already invalid*/
        ext->content      = NULL;
    } else if(sign == LV_SIGNAL_CORD_CHG) {
        if(ext->content != NULL && (lv_obj_get_width(tabview) != lv_area_get_width(param) ||
                                    lv_obj_get_height(tabview) != lv_area_get_height(param))) {
            tabview_realign(tabview);
        }
    } else if(sign == LV_SIGNAL_RELEASED) {
#if LV_USE_GROUP
        /*If released by a KEYPAD or ENCODER then really the tab buttons should be released.
         * So simulate a CLICK on the tab buttons*/
        lv_indev_t * indev         = lv_indev_get_act();
        lv_indev_type_t indev_type = lv_indev_get_type(indev);
        if(indev_type == LV_INDEV_TYPE_KEYPAD ||
           (indev_type == LV_INDEV_TYPE_ENCODER && lv_group_get_editing(lv_obj_get_group(tabview)))) {
            lv_event_send(ext->btns, LV_EVENT_CLICKED, lv_event_get_data());
        }
#endif
    } else if(sign == LV_SIGNAL_FOCUS || sign == LV_SIGNAL_DEFOCUS || sign == LV_SIGNAL_CONTROL) {
        /* The button matrix is not in a group (the tab view is in it) but it should handle the
         * group signals. So propagate the related signals to the button matrix manually*/
        if(ext->btns) {
            ext->btns->signal_cb(ext->btns, sign, param);
        }

        if(sign == LV_SIGNAL_FOCUS) {
            lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act());
            /*If not focused by an input device assume the last input device*/
            if(indev_type == LV_INDEV_TYPE_NONE) {
                indev_type = lv_indev_get_type(lv_indev_get_next(NULL));
            }

            /*With ENCODER select the first button only in edit mode*/
            if(indev_type == LV_INDEV_TYPE_ENCODER) {
#if LV_USE_GROUP
                lv_group_t * g = lv_obj_get_group(tabview);
                if(lv_group_get_editing(g)) {
                    lv_btnm_set_pressed(ext->btns, ext->tab_cur);
                }
#endif
            } else {
                lv_btnm_set_pressed(ext->btns, ext->tab_cur);
            }
        }
    } else if(sign == LV_SIGNAL_GET_EDITABLE) {
        bool * editable = (bool *)param;
        *editable       = true;
    }

    return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r12
movl %esi, %ebp
movq %rdi, %r15
callq *0x4f422(%rip)          # 0x60330
movl %eax, %ebx
cmpb $0x1, %al
jne 0x110ac
cmpb $0x7, %bpl
jne 0x10f35
leaq 0x2e67b(%rip), %rsi     # 0x3f5a0
movq %r12, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6bf5
movq %r15, %rdi
callq 0x6ad8
movq %rax, %r14
cmpb $0xb, %bpl
je 0x10ff0
movzbl %bpl, %esi
cmpl $0x2, %esi
je 0x10f9f
testl %esi, %esi
jne 0x1103f
movq 0x18(%r14), %rax
movq (%rax), %rdi
cmpb $0x0, (%rdi)
je 0x10f83
movb $0x1, %r15b
callq 0x29984
movq 0x18(%r14), %rax
movzbl %r15b, %r15d
movq (%rax,%r15,8), %rdi
incb %r15b
cmpb $0x0, (%rdi)
jne 0x10f6a
movq %rax, %rdi
callq 0x29984
movq $0x0, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
jmp 0x110ac
cmpq $0x0, 0x10(%r14)
je 0x110ac
movq %r15, %rdi
callq 0x5651
movzwl 0x4(%r12), %ecx
subw (%r12), %cx
incl %ecx
cmpw %cx, %ax
jne 0x10fe3
movq %r15, %rdi
callq 0x567b
movzwl 0x6(%r12), %ecx
subw 0x2(%r12), %cx
incl %ecx
cmpw %cx, %ax
je 0x110ac
movq %r15, %rdi
callq 0x117cf
jmp 0x110ac
callq 0x3784
movq %rax, %rdi
callq 0x378c
cmpb $0x2, %al
je 0x11025
movzbl %al, %eax
cmpl $0x4, %eax
jne 0x110ac
movq %r15, %rdi
callq 0x4ea3
movq %rax, %rdi
callq 0x2b2b
testb %al, %al
je 0x110ac
movq (%r14), %r14
callq 0x6454
movq %r14, %rdi
movl $0x6, %esi
movq %rax, %rdx
callq 0x4fea
jmp 0x110ac
leal -0x10(%rsi), %eax
cmpl $0x3, %eax
jae 0x110a2
movq (%r14), %rdi
testq %rdi, %rdi
je 0x11055
movq %r12, %rdx
callq *0x30(%rdi)
cmpb $0x10, %bpl
jne 0x110ac
callq 0x3784
movq %rax, %rdi
callq 0x378c
testb %al, %al
jne 0x1107b
xorl %edi, %edi
callq 0x87d5
movq %rax, %rdi
callq 0x378c
cmpb $0x4, %al
jne 0x11093
movq %r15, %rdi
callq 0x4ea3
movq %rax, %rdi
callq 0x2b2b
testb %al, %al
je 0x110ac
movq (%r14), %rdi
movzwl 0x24(%r14), %esi
callq 0x21d9a
jmp 0x110ac
cmpl $0x13, %esi
jne 0x110ac
movb $0x1, (%r12)
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq