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

    /* Include the ancient signal function */
    res = ancestor_signal(ta, 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_ta_ext_t * ext = lv_obj_get_ext_attr(ta);
    if(sign == LV_SIGNAL_CLEANUP) {
        if(ext->pwd_tmp != NULL) lv_mem_free(ext->pwd_tmp);

        /* (The created label will be deleted automatically) */
    } else if(sign == LV_SIGNAL_STYLE_CHG) {
        if(ext->label) {
            lv_obj_t * scrl               = lv_page_get_scrl(ta);
            const lv_style_t * style_ta   = lv_obj_get_style(ta);
            const lv_style_t * style_scrl = lv_obj_get_style(scrl);
            if(ext->one_line) {
                /*In one line mode refresh the Text Area height because 'vpad' can modify it*/
                const lv_style_t * style_label = lv_obj_get_style(ext->label);
                lv_coord_t font_h              = lv_font_get_line_height(style_label->text.font);
                lv_obj_set_height(ext->label, font_h);
                lv_obj_set_height(ta, font_h + style_ta->body.padding.top + style_ta->body.padding.bottom +
                                          style_scrl->body.padding.top + style_scrl->body.padding.bottom);
            } else {
                /*In not one line mode refresh the Label width because 'hpad' can modify it*/
                lv_obj_set_width(ext->label, lv_page_get_fit_width(ta));
                lv_obj_set_pos(ext->label, style_scrl->body.padding.left,
                               style_scrl->body.padding.right); /*Be sure the Label is in the correct position*/

                if(ext->placeholder) {
                    lv_obj_set_width(ext->placeholder, lv_page_get_fit_width(ta));
                    lv_obj_set_pos(ext->placeholder, style_scrl->body.padding.left,
                                   style_scrl->body.padding.top); /*Be sure the placeholder is in the correct position*/
                }
            }
            lv_label_set_text(ext->label, NULL);
        }
    } else if(sign == LV_SIGNAL_CORD_CHG) {
        /*Set the label width according to the text area width*/
        if(ext->label) {
            if(lv_obj_get_width(ta) != lv_area_get_width(param) || lv_obj_get_height(ta) != lv_area_get_height(param)) {
                lv_obj_t * scrl               = lv_page_get_scrl(ta);
                const lv_style_t * style_scrl = lv_obj_get_style(scrl);
                lv_obj_set_width(ext->label, lv_page_get_fit_width(ta));
                lv_obj_set_pos(ext->label, style_scrl->body.padding.left, style_scrl->body.padding.top);
                lv_label_set_text(ext->label, NULL); /*Refresh the label*/

                refr_cursor_area(ta);
            }
        }
        /*Set the placeholder width according to the text area width*/
        if(ext->placeholder) {
            if(lv_obj_get_width(ta) != lv_area_get_width(param) || lv_obj_get_height(ta) != lv_area_get_height(param)) {
                lv_obj_t * scrl               = lv_page_get_scrl(ta);
                const lv_style_t * style_scrl = lv_obj_get_style(scrl);
                lv_obj_set_width(ext->placeholder, lv_page_get_fit_width(ta));
                lv_obj_set_pos(ext->placeholder, style_scrl->body.padding.left, style_scrl->body.padding.top);
                lv_label_set_text(ext->placeholder, NULL); /*Refresh the label*/

                refr_cursor_area(ta);
            }
        }
    } else if(sign == LV_SIGNAL_CONTROL) {
        uint32_t c = *((uint32_t *)param); /*uint32_t because can be UTF-8*/
        if(c == LV_KEY_RIGHT)
            lv_ta_cursor_right(ta);
        else if(c == LV_KEY_LEFT)
            lv_ta_cursor_left(ta);
        else if(c == LV_KEY_UP)
            lv_ta_cursor_up(ta);
        else if(c == LV_KEY_DOWN)
            lv_ta_cursor_down(ta);
        else if(c == LV_KEY_BACKSPACE)
            lv_ta_del_char(ta);
        else if(c == LV_KEY_DEL)
            lv_ta_del_char_forward(ta);
        else if(c == LV_KEY_HOME)
            lv_ta_set_cursor_pos(ta, 0);
        else if(c == LV_KEY_END)
            lv_ta_set_cursor_pos(ta, LV_TA_CURSOR_LAST);
        else {
            lv_ta_add_char(ta, c);
        }
    } else if(sign == LV_SIGNAL_GET_EDITABLE) {
        bool * editable = (bool *)param;
        *editable       = true;
    } else if(sign == LV_SIGNAL_DEFOCUS) {
        lv_cursor_type_t cur_type;
        cur_type = lv_ta_get_cursor_type(ta);
        lv_ta_set_cursor_type(ta, cur_type | LV_CURSOR_HIDDEN);
    } else if(sign == LV_SIGNAL_FOCUS) {
#if LV_USE_GROUP
        lv_cursor_type_t cur_type;
        cur_type                   = lv_ta_get_cursor_type(ta);
        lv_group_t * g             = lv_obj_get_group(ta);
        bool editing               = lv_group_get_editing(g);
        lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act());

        /*Encoders need special handling*/
        if(indev_type == LV_INDEV_TYPE_ENCODER) {
            if(editing)
                lv_ta_set_cursor_type(ta, cur_type & (~LV_CURSOR_HIDDEN));
            else
                lv_ta_set_cursor_type(ta, cur_type | LV_CURSOR_HIDDEN);
        } else {
            lv_ta_set_cursor_type(ta, cur_type & (~LV_CURSOR_HIDDEN));
        }
#endif
    } else if(sign == LV_SIGNAL_PRESSED || sign == LV_SIGNAL_PRESSING || sign == LV_SIGNAL_PRESS_LOST ||
              sign == LV_SIGNAL_RELEASED) {
        update_cursor_position_on_click(ta, sign, (lv_indev_t *)param);
    }
    return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movb %sil, %al
movq %rdi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq %rdx, -0x20(%rbp)
movq 0x587b8(%rip), %rax     # 0x894b8
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 0x30d27
movb -0x21(%rbp), %al
movb %al, -0x1(%rbp)
jmp 0x312dd
movzbl -0x11(%rbp), %eax
cmpl $0x7, %eax
jne 0x30d48
movq -0x20(%rbp), %rdi
leaq 0x3794d(%rip), %rsi     # 0x68688
callq 0xaa80
movb %al, -0x1(%rbp)
jmp 0x312dd
movq -0x10(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x30(%rbp)
movzbl -0x11(%rbp), %eax
cmpl $0x0, %eax
jne 0x30d7b
movq -0x30(%rbp), %rax
cmpq $0x0, 0x60(%rax)
je 0x30d76
movq -0x30(%rbp), %rax
movq 0x60(%rax), %rdi
callq 0x44ec0
jmp 0x312d7
movzbl -0x11(%rbp), %eax
cmpl $0x4, %eax
jne 0x30ef4
movq -0x30(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0x30eef
movq -0x10(%rbp), %rdi
callq 0x3e970
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0xa080
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
callq 0xa080
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movb 0x98(%rax), %al
shrb %al
andb $0x1, %al
cmpb $0x0, %al
je 0x30e43
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0xa080
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x33480
movzbl %al, %eax
movw %ax, -0x52(%rbp)
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rdi
movswl -0x52(%rbp), %esi
callq 0x84a0
movq -0x10(%rbp), %rdi
movswl -0x52(%rbp), %eax
movq -0x40(%rbp), %rcx
movswl 0x16(%rcx), %ecx
addl %ecx, %eax
movq -0x40(%rbp), %rcx
movswl 0x18(%rcx), %ecx
addl %ecx, %eax
movq -0x48(%rbp), %rcx
movswl 0x16(%rcx), %ecx
addl %ecx, %eax
movq -0x48(%rbp), %rcx
movswl 0x18(%rcx), %ecx
addl %ecx, %eax
movswl %ax, %esi
callq 0x84a0
jmp 0x30ede
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3ec60
movq -0xa8(%rbp), %rdi
movswl %ax, %esi
callq 0x8430
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0x48(%rbp), %rax
movw 0x1a(%rax), %cx
movq -0x48(%rbp), %rax
movswl %cx, %esi
movswl 0x1c(%rax), %edx
callq 0x71f0
movq -0x30(%rbp), %rax
cmpq $0x0, 0x58(%rax)
je 0x30edc
movq -0x30(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0xb0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3ec60
movq -0xb0(%rbp), %rdi
movswl %ax, %esi
callq 0x8430
movq -0x30(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x48(%rbp), %rax
movw 0x1a(%rax), %cx
movq -0x48(%rbp), %rax
movswl %cx, %esi
movswl 0x16(%rax), %edx
callq 0x71f0
jmp 0x30ede
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2a630
jmp 0x312d5
movzbl -0x11(%rbp), %eax
cmpl $0x2, %eax
jne 0x310c2
movq -0x30(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0x30fdf
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movl %eax, -0xb4(%rbp)
movq -0x20(%rbp), %rdi
callq 0x34840
movw %ax, %cx
movl -0xb4(%rbp), %eax
movswl %cx, %ecx
cmpl %ecx, %eax
jne 0x30f62
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movl %eax, -0xb8(%rbp)
movq -0x20(%rbp), %rdi
callq 0x34860
movw %ax, %cx
movl -0xb8(%rbp), %eax
movswl %cx, %ecx
cmpl %ecx, %eax
je 0x30fdd
movq -0x10(%rbp), %rdi
callq 0x3e970
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
callq 0xa080
movq %rax, -0x68(%rbp)
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0xc0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3ec60
movq -0xc0(%rbp), %rdi
movswl %ax, %esi
callq 0x8430
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0x68(%rbp), %rax
movw 0x1a(%rax), %cx
movq -0x68(%rbp), %rax
movswl %cx, %esi
movswl 0x16(%rax), %edx
callq 0x71f0
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2a630
movq -0x10(%rbp), %rdi
callq 0x334a0
jmp 0x30fdf
movq -0x30(%rbp), %rax
cmpq $0x0, 0x58(%rax)
je 0x310bd
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movl %eax, -0xc4(%rbp)
movq -0x20(%rbp), %rdi
callq 0x34840
movw %ax, %cx
movl -0xc4(%rbp), %eax
movswl %cx, %ecx
cmpl %ecx, %eax
jne 0x31040
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movl %eax, -0xc8(%rbp)
movq -0x20(%rbp), %rdi
callq 0x34860
movw %ax, %cx
movl -0xc8(%rbp), %eax
movswl %cx, %ecx
cmpl %ecx, %eax
je 0x310bb
movq -0x10(%rbp), %rdi
callq 0x3e970
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0xa080
movq %rax, -0x78(%rbp)
movq -0x30(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0xd0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3ec60
movq -0xd0(%rbp), %rdi
movswl %ax, %esi
callq 0x8430
movq -0x30(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x78(%rbp), %rax
movw 0x1a(%rax), %cx
movq -0x78(%rbp), %rax
movswl %cx, %esi
movswl 0x16(%rax), %edx
callq 0x71f0
movq -0x30(%rbp), %rax
movq 0x58(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2a630
movq -0x10(%rbp), %rdi
callq 0x334a0
jmp 0x310bd
jmp 0x312d3
movzbl -0x11(%rbp), %eax
cmpl $0x12, %eax
jne 0x3118c
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x7c(%rbp)
cmpl $0x13, -0x7c(%rbp)
jne 0x310ec
movq -0x10(%rbp), %rdi
callq 0x343f0
jmp 0x31187
cmpl $0x14, -0x7c(%rbp)
jne 0x31100
movq -0x10(%rbp), %rdi
callq 0x34450
jmp 0x31185
cmpl $0x11, -0x7c(%rbp)
jne 0x31111
movq -0x10(%rbp), %rdi
callq 0x345d0
jmp 0x31183
cmpl $0x12, -0x7c(%rbp)
jne 0x31122
movq -0x10(%rbp), %rdi
callq 0x344b0
jmp 0x31181
cmpl $0x8, -0x7c(%rbp)
jne 0x31133
movq -0x10(%rbp), %rdi
callq 0x32c90
jmp 0x3117f
cmpl $0x7f, -0x7c(%rbp)
jne 0x31144
movq -0x10(%rbp), %rdi
callq 0x32f00
jmp 0x3117d
cmpl $0x2, -0x7c(%rbp)
jne 0x31157
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x32770
jmp 0x3117b
cmpl $0x3, -0x7c(%rbp)
jne 0x3116d
movq -0x10(%rbp), %rdi
movl $0x7fff, %esi           # imm = 0x7FFF
callq 0x32770
jmp 0x31179
movq -0x10(%rbp), %rdi
movl -0x7c(%rbp), %esi
callq 0x31fa0
jmp 0x3117b
jmp 0x3117d
jmp 0x3117f
jmp 0x31181
jmp 0x31183
jmp 0x31185
jmp 0x31187
jmp 0x312d1
movzbl -0x11(%rbp), %eax
cmpl $0x13, %eax
jne 0x311af
movq -0x20(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movb $0x1, (%rax)
jmp 0x312cf
movzbl -0x11(%rbp), %eax
cmpl $0x11, %eax
jne 0x311e2
movq -0x10(%rbp), %rdi
callq 0x34100
movb %al, -0x89(%rbp)
movq -0x10(%rbp), %rdi
movzbl -0x89(%rbp), %eax
orl $0x8, %eax
movzbl %al, %esi
callq 0x339f0
jmp 0x312cd
movzbl -0x11(%rbp), %eax
cmpl $0x10, %eax
jne 0x31292
movq -0x10(%rbp), %rdi
callq 0x34100
movb %al, -0x8a(%rbp)
movq -0x10(%rbp), %rdi
callq 0x77c0
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rdi
callq 0x32e0
andb $0x1, %al
movb %al, -0x99(%rbp)
callq 0x4b70
movq %rax, %rdi
callq 0x4b80
movb %al, -0x9a(%rbp)
movzbl -0x9a(%rbp), %eax
cmpl $0x4, %eax
jne 0x3127a
testb $0x1, -0x99(%rbp)
je 0x31262
movq -0x10(%rbp), %rdi
movzbl -0x8a(%rbp), %eax
andl $-0x9, %eax
movzbl %al, %esi
callq 0x339f0
jmp 0x31278
movq -0x10(%rbp), %rdi
movzbl -0x8a(%rbp), %eax
orl $0x8, %eax
movzbl %al, %esi
callq 0x339f0
jmp 0x31290
movq -0x10(%rbp), %rdi
movzbl -0x8a(%rbp), %eax
andl $-0x9, %eax
movzbl %al, %esi
callq 0x339f0
jmp 0x312cb
movzbl -0x11(%rbp), %eax
cmpl $0x8, %eax
je 0x312b6
movzbl -0x11(%rbp), %eax
cmpl $0x9, %eax
je 0x312b6
movzbl -0x11(%rbp), %eax
cmpl $0xa, %eax
je 0x312b6
movzbl -0x11(%rbp), %eax
cmpl $0xb, %eax
jne 0x312c9
movq -0x10(%rbp), %rdi
movb -0x11(%rbp), %al
movq -0x20(%rbp), %rdx
movzbl %al, %esi
callq 0x34880
jmp 0x312cb
jmp 0x312cd
jmp 0x312cf
jmp 0x312d1
jmp 0x312d3
jmp 0x312d5
jmp 0x312d7
movb -0x21(%rbp), %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0xd0, %rsp
popq %rbp
retq
nopl (%rax)