// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_mbox.c
// Function: lv_mbox_signal
static lv_res_t lv_mbox_signal(lv_obj_t * mbox, lv_signal_t sign, void * param)
{
    lv_res_t res;

    /*Translate LV_KEY_UP/DOWN to LV_KEY_LEFT/RIGHT */
    char c_trans = 0;
    if(sign == LV_SIGNAL_CONTROL) {
        c_trans = *((char *)param);
        if(c_trans == LV_KEY_DOWN) c_trans = LV_KEY_LEFT;
        if(c_trans == LV_KEY_UP) c_trans = LV_KEY_RIGHT;

        param = &c_trans;
    }

    /* Include the ancient signal function */
    res = ancestor_signal(mbox, 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_mbox_ext_t * ext = lv_obj_get_ext_attr(mbox);
    if(sign == LV_SIGNAL_CORD_CHG) {
        if(lv_obj_get_width(mbox) != lv_area_get_width(param)) {
            mbox_realign(mbox);
        }
    } else if(sign == LV_SIGNAL_STYLE_CHG) {
        mbox_realign(mbox);
    } else if(sign == LV_SIGNAL_RELEASED) {
        if(ext->btnm) {
            uint32_t btn_id = lv_btnm_get_active_btn(ext->btnm);
            if(btn_id != LV_BTNM_BTN_NONE) lv_event_send(mbox, LV_EVENT_VALUE_CHANGED, &btn_id);
        }
    } else if(sign == LV_SIGNAL_FOCUS || sign == LV_SIGNAL_DEFOCUS || sign == LV_SIGNAL_CONTROL ||
              sign == LV_SIGNAL_GET_EDITABLE) {
        if(ext->btnm) {
            ext->btnm->signal_cb(ext->btnm, sign, param);
        }

        /* The button matrix with ENCODER input supposes it's in a group but in this case it isn't
         * (Only the message box's container) So so some actions here instead*/
        if(sign == LV_SIGNAL_FOCUS) {
#if LV_USE_GROUP
            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_ENCODER) {
                /*In navigation mode don't select any button but in edit mode select the fist*/
                lv_btnm_ext_t * btnm_ext = lv_obj_get_ext_attr(ext->btnm);
                if(lv_group_get_editing(lv_obj_get_group(mbox)))
                    btnm_ext->btn_id_pr = 0;
                else
                    btnm_ext->btn_id_pr = LV_BTNM_BTN_NONE;
            }
#endif
        }
    }

    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)
movb $0x0, -0x22(%rbp)
movzbl -0x11(%rbp), %eax
cmpl $0x12, %eax
jne 0x16a1e
movq -0x20(%rbp), %rax
movb (%rax), %al
movb %al, -0x22(%rbp)
movsbl -0x22(%rbp), %eax
cmpl $0x12, %eax
jne 0x16a09
movb $0x14, -0x22(%rbp)
movsbl -0x22(%rbp), %eax
cmpl $0x11, %eax
jne 0x16a16
movb $0x13, -0x22(%rbp)
leaq -0x22(%rbp), %rax
movq %rax, -0x20(%rbp)
movq 0x729a3(%rip), %rax     # 0x893c8
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 0x16a4c
movb -0x21(%rbp), %al
movb %al, -0x1(%rbp)
jmp 0x16bde
movzbl -0x11(%rbp), %eax
cmpl $0x7, %eax
jne 0x16a6d
movq -0x20(%rbp), %rdi
leaq 0x519a0(%rip), %rsi     # 0x68400
callq 0xaa80
movb %al, -0x1(%rbp)
jmp 0x16bde
movq -0x10(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x30(%rbp)
movzbl -0x11(%rbp), %eax
cmpl $0x2, %eax
jne 0x16ab4
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movl %eax, -0x54(%rbp)
movq -0x20(%rbp), %rdi
callq 0x17750
movw %ax, %cx
movl -0x54(%rbp), %eax
movswl %cx, %ecx
cmpl %ecx, %eax
je 0x16aaf
movq -0x10(%rbp), %rdi
callq 0x16f80
jmp 0x16bd8
movzbl -0x11(%rbp), %eax
cmpl $0x4, %eax
jne 0x16acb
movq -0x10(%rbp), %rdi
callq 0x16f80
jmp 0x16bd6
movzbl -0x11(%rbp), %eax
cmpl $0xb, %eax
jne 0x16b14
movq -0x30(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x16b0f
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x37c40
movzwl %ax, %eax
movl %eax, -0x34(%rbp)
cmpl $0xffff, -0x34(%rbp)    # imm = 0xFFFF
je 0x16b0d
movq -0x10(%rbp), %rdi
movl $0xe, %esi
leaq -0x34(%rbp), %rdx
callq 0x7990
jmp 0x16b0f
jmp 0x16bd4
movzbl -0x11(%rbp), %eax
cmpl $0x10, %eax
je 0x16b3c
movzbl -0x11(%rbp), %eax
cmpl $0x11, %eax
je 0x16b3c
movzbl -0x11(%rbp), %eax
cmpl $0x12, %eax
je 0x16b3c
movzbl -0x11(%rbp), %eax
cmpl $0x13, %eax
jne 0x16bd2
movq -0x30(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x16b67
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x30(%rax), %rax
movq -0x30(%rbp), %rcx
movq 0x10(%rcx), %rdi
movb -0x11(%rbp), %cl
movq -0x20(%rbp), %rdx
movzbl %cl, %esi
callq *%rax
movzbl -0x11(%rbp), %eax
cmpl $0x10, %eax
jne 0x16bd0
callq 0x4b70
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0x4b80
movb %al, -0x41(%rbp)
movzbl -0x41(%rbp), %eax
cmpl $0x4, %eax
jne 0x16bce
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xa8f0
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
callq 0x77c0
movq %rax, %rdi
callq 0x32e0
testb $0x1, %al
jne 0x16bb6
jmp 0x16bc2
movq -0x50(%rbp), %rax
movw $0x0, 0x42(%rax)
jmp 0x16bcc
movq -0x50(%rbp), %rax
movw $0xffff, 0x42(%rax)     # imm = 0xFFFF
jmp 0x16bce
jmp 0x16bd0
jmp 0x16bd2
jmp 0x16bd4
jmp 0x16bd6
jmp 0x16bd8
movb -0x21(%rbp), %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)