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

    /* Include the ancient signal function */
    res = ancestor_signal(page, 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_page_ext_t * ext = lv_obj_get_ext_attr(page);
    lv_obj_t * child;
    if(sign == LV_SIGNAL_CHILD_CHG) { /*Automatically move children to the scrollable object*/
        const lv_style_t * style_bg = lv_page_get_style(page, LV_PAGE_STYLE_BG);
        const lv_style_t * style_scrl = lv_page_get_style(page, LV_PAGE_STYLE_SCRL);
        lv_fit_t fit_left        = lv_page_get_scrl_fit_left(page);
        lv_fit_t fit_right        = lv_page_get_scrl_fit_right(page);
        lv_fit_t fit_top         = lv_page_get_scrl_fit_top(page);
        child                    = lv_obj_get_child(page, NULL);
        while(child != NULL) {
            if(lv_obj_is_protected(child, LV_PROTECT_PARENT) == false) {
                lv_obj_t * tmp = child;
                child          = lv_obj_get_child(page, child); /*Get the next child before move this*/

                /* Reposition the child to take padding into account (Only if it's on (0;0) or (widht;height) coordinates now)
                 * It's required to keep new the object on the same coordinate if FIT is enabled.*/
                if((tmp->coords.x1 == page->coords.x1) && (fit_left == LV_FIT_TIGHT || fit_left == LV_FIT_FILL)) {
                    tmp->coords.x1 += style_scrl->body.padding.left;
                    tmp->coords.x2 += style_scrl->body.padding.left;
                }
                else if((tmp->coords.x2 == page->coords.x2) && (fit_right == LV_FIT_TIGHT || fit_right == LV_FIT_FILL)) {
                    tmp->coords.x1 -= style_scrl->body.padding.right + style_bg->body.padding.right;
                    tmp->coords.x2 -= style_scrl->body.padding.right + style_bg->body.padding.right;
                }
                if((tmp->coords.y1 == page->coords.y1) && (fit_top == LV_FIT_TIGHT || fit_top == LV_FIT_FILL)) {
                    tmp->coords.y1 += style_scrl->body.padding.top;
                    tmp->coords.y2 += style_scrl->body.padding.top;
                }
                lv_obj_set_parent(tmp, ext->scrl);
            } else {
                child = lv_obj_get_child(page, child);
            }
        }
    } else if(sign == LV_SIGNAL_STYLE_CHG) {
        ext->scrl->signal_cb(ext->scrl, LV_SIGNAL_CORD_CHG, &ext->scrl->coords);

        /*The scrollbars are important only if they are visible now*/
        if(ext->sb.hor_draw || ext->sb.ver_draw) lv_page_sb_refresh(page);

        /*Refresh the ext. size because the scrollbars might be positioned out of the page*/
        lv_obj_refresh_ext_draw_pad(page);
    } else if(sign == LV_SIGNAL_CORD_CHG) {
        /*Refresh the scrollbar and notify the scrl if the size is changed*/
        if(ext->scrl != NULL && (lv_obj_get_width(page) != lv_area_get_width(param) ||
                                 lv_obj_get_height(page) != lv_area_get_height(param))) {
            /*If no hor_fit enabled set the scrollable's width to the page's width*/
            ext->scrl->signal_cb(ext->scrl, LV_SIGNAL_CORD_CHG, &ext->scrl->coords);

            /*The scrollbars are important only if they are visible now*/
            if(ext->sb.hor_draw || ext->sb.ver_draw) lv_page_sb_refresh(page);
        }
    } else if(sign == LV_SIGNAL_REFR_EXT_DRAW_PAD) {
        /*Ensure ext. size for the scrollbars if they are out of the page*/
        if(page->ext_draw_pad < (-ext->sb.style->body.padding.right))
            page->ext_draw_pad = -ext->sb.style->body.padding.right;
        if(page->ext_draw_pad < (-ext->sb.style->body.padding.bottom))
            page->ext_draw_pad = -ext->sb.style->body.padding.bottom;
    } else if(sign == LV_SIGNAL_CONTROL) {
        uint32_t c = *((uint32_t *)param);

        if(c == LV_KEY_DOWN) {
            lv_page_scroll_ver(page, -lv_obj_get_height(page) / 4);
        } else if(c == LV_KEY_UP) {
            lv_page_scroll_ver(page, lv_obj_get_height(page) / 4);
        } else if(c == LV_KEY_RIGHT) {
            /*If the page can't be scrolled horizontally because it's not wide enough then scroll it
             * vertically*/
            if(lv_page_get_scrl_width(page) <= lv_obj_get_width(page))
                lv_page_scroll_ver(page, -lv_obj_get_height(page) / 4);
            else
                lv_page_scroll_hor(page, -lv_obj_get_width(page) / 4);
        } else if(c == LV_KEY_LEFT) {
            /*If the page can't be scrolled horizontally because it's not wide enough then scroll it
             * vertically*/
            if(lv_page_get_scrl_width(page) <= lv_obj_get_width(page))
                lv_page_scroll_ver(page, lv_obj_get_height(page) / 4);
            else
                lv_page_scroll_hor(page, lv_obj_get_width(page) / 4);
        }
    } else if(sign == LV_SIGNAL_GET_EDITABLE) {
        bool * editable = (bool *)param;
        *editable       = true;
    }

    return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movb %sil, %al
movq %rdi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq %rdx, -0x20(%rbp)
movq 0x4c1e8(%rip), %rax     # 0x89538
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 0x3d377
movb -0x21(%rbp), %al
movb %al, -0x1(%rbp)
jmp 0x3d903
movzbl -0x11(%rbp), %eax
cmpl $0x7, %eax
jne 0x3d398
movq -0x20(%rbp), %rdi
leaq 0x2b3a5(%rip), %rsi     # 0x68730
callq 0xaa80
movb %al, -0x1(%rbp)
jmp 0x3d903
movq -0x10(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x30(%rbp)
movzbl -0x11(%rbp), %eax
cmpl $0x1, %eax
jne 0x3d584
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x3e100
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x3e100
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3f580
movb %al, -0x49(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3f5b0
movb %al, -0x4a(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3f5e0
movb %al, -0x4b(%rbp)
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7c20
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x3d57f
movq -0x38(%rbp), %rdi
movl $0x2, %esi
callq 0xa7d0
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x3d569
movq -0x38(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x7c20
movq %rax, -0x38(%rbp)
movq -0x58(%rbp), %rax
movswl 0x20(%rax), %eax
movq -0x10(%rbp), %rcx
movswl 0x20(%rcx), %ecx
cmpl %ecx, %eax
jne 0x3d49c
movzbl -0x49(%rbp), %eax
cmpl $0x1, %eax
je 0x3d46e
movzbl -0x49(%rbp), %eax
cmpl $0x3, %eax
jne 0x3d49c
movq -0x48(%rbp), %rax
movswl 0x1a(%rax), %edx
movq -0x58(%rbp), %rax
movswl 0x20(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x20(%rax)
movq -0x48(%rbp), %rax
movswl 0x1a(%rax), %edx
movq -0x58(%rbp), %rax
movswl 0x24(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x24(%rax)
jmp 0x3d504
movq -0x58(%rbp), %rax
movswl 0x24(%rax), %eax
movq -0x10(%rbp), %rcx
movswl 0x24(%rcx), %ecx
cmpl %ecx, %eax
jne 0x3d502
movzbl -0x4a(%rbp), %eax
cmpl $0x1, %eax
je 0x3d4c2
movzbl -0x4a(%rbp), %eax
cmpl $0x3, %eax
jne 0x3d502
movq -0x48(%rbp), %rax
movswl 0x1c(%rax), %edx
movq -0x40(%rbp), %rax
movswl 0x1c(%rax), %eax
addl %eax, %edx
movq -0x58(%rbp), %rax
movswl 0x20(%rax), %ecx
subl %edx, %ecx
movw %cx, 0x20(%rax)
movq -0x48(%rbp), %rax
movswl 0x1c(%rax), %edx
movq -0x40(%rbp), %rax
movswl 0x1c(%rax), %eax
addl %eax, %edx
movq -0x58(%rbp), %rax
movswl 0x24(%rax), %ecx
subl %edx, %ecx
movw %cx, 0x24(%rax)
jmp 0x3d504
movq -0x58(%rbp), %rax
movswl 0x22(%rax), %eax
movq -0x10(%rbp), %rcx
movswl 0x22(%rcx), %ecx
cmpl %ecx, %eax
jne 0x3d556
movzbl -0x4b(%rbp), %eax
cmpl $0x1, %eax
je 0x3d52a
movzbl -0x4b(%rbp), %eax
cmpl $0x3, %eax
jne 0x3d556
movq -0x48(%rbp), %rax
movswl 0x16(%rax), %edx
movq -0x58(%rbp), %rax
movswl 0x22(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x22(%rax)
movq -0x48(%rbp), %rax
movswl 0x16(%rax), %edx
movq -0x58(%rbp), %rax
movswl 0x26(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x26(%rax)
movq -0x58(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x7d50
jmp 0x3d57a
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x7c20
movq %rax, -0x38(%rbp)
jmp 0x3d408
jmp 0x3d8fd
movzbl -0x11(%rbp), %eax
cmpl $0x4, %eax
jne 0x3d5ef
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x30(%rax), %rax
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rdi
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rdx
addq $0x20, %rdx
movl $0x2, %esi
callq *%rax
movq -0x30(%rbp), %rax
movb 0x28(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x3d5d8
movq -0x30(%rbp), %rax
movb 0x28(%rax), %al
shrb %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x3d5e1
movq -0x10(%rbp), %rdi
callq 0x3e1c0
movq -0x10(%rbp), %rdi
callq 0x9dc0
jmp 0x3d8fb
movzbl -0x11(%rbp), %eax
cmpl $0x2, %eax
jne 0x3d6ac
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x3d6a7
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movl %eax, -0x6c(%rbp)
movq -0x20(%rbp), %rdi
callq 0x3f610
movw %ax, %cx
movl -0x6c(%rbp), %eax
movswl %cx, %ecx
cmpl %ecx, %eax
jne 0x3d651
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movl %eax, -0x70(%rbp)
movq -0x20(%rbp), %rdi
callq 0x3f630
movw %ax, %cx
movl -0x70(%rbp), %eax
movswl %cx, %ecx
cmpl %ecx, %eax
je 0x3d6a7
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x30(%rax), %rax
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rdi
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rdx
addq $0x20, %rdx
movl $0x2, %esi
callq *%rax
movq -0x30(%rbp), %rax
movb 0x28(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x3d69c
movq -0x30(%rbp), %rax
movb 0x28(%rax), %al
shrb %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x3d6a5
movq -0x10(%rbp), %rdi
callq 0x3e1c0
jmp 0x3d6a7
jmp 0x3d8f9
movzbl -0x11(%rbp), %eax
cmpl $0x6, %eax
jne 0x3d728
movq -0x10(%rbp), %rax
movswl 0x5c(%rax), %eax
movq -0x30(%rbp), %rcx
movq 0x10(%rcx), %rcx
movswl 0x1c(%rcx), %edx
xorl %ecx, %ecx
subl %edx, %ecx
cmpl %ecx, %eax
jge 0x3d6ec
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movswl 0x1c(%rax), %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0x5c(%rax)
movq -0x10(%rbp), %rax
movswl 0x5c(%rax), %eax
movq -0x30(%rbp), %rcx
movq 0x10(%rcx), %rcx
movswl 0x18(%rcx), %edx
xorl %ecx, %ecx
subl %edx, %ecx
cmpl %ecx, %eax
jge 0x3d723
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movswl 0x18(%rax), %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0x5c(%rax)
jmp 0x3d8f7
movzbl -0x11(%rbp), %eax
cmpl $0x12, %eax
jne 0x3d8db
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x5c(%rbp)
cmpl $0x12, -0x5c(%rbp)
jne 0x3d775
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
movq -0x78(%rbp), %rdi
movswl %ax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl $0x4, %ecx
cltd
idivl %ecx
movswl %ax, %esi
callq 0x3f370
jmp 0x3d8d9
cmpl $0x11, -0x5c(%rbp)
jne 0x3d7a6
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
movq -0x80(%rbp), %rdi
cwtl
movl $0x4, %ecx
cltd
idivl %ecx
movswl %ax, %esi
callq 0x3f370
jmp 0x3d8d7
cmpl $0x13, -0x5c(%rbp)
jne 0x3d844
movq -0x10(%rbp), %rdi
callq 0x3f650
cwtl
movl %eax, -0x84(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8310
movw %ax, %cx
movl -0x84(%rbp), %eax
movswl %cx, %ecx
cmpl %ecx, %eax
jg 0x3d80d
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
movq -0x90(%rbp), %rdi
movswl %ax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl $0x4, %ecx
cltd
idivl %ecx
movswl %ax, %esi
callq 0x3f370
jmp 0x3d83f
movq -0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8310
movq -0x98(%rbp), %rdi
movswl %ax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl $0x4, %ecx
cltd
idivl %ecx
movswl %ax, %esi
callq 0x3f2d0
jmp 0x3d8d5
cmpl $0x14, -0x5c(%rbp)
jne 0x3d8d3
movq -0x10(%rbp), %rdi
callq 0x3f650
cwtl
movl %eax, -0x9c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8310
movw %ax, %cx
movl -0x9c(%rbp), %eax
movswl %cx, %ecx
cmpl %ecx, %eax
jg 0x3d8a5
movq -0x10(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
movq -0xa8(%rbp), %rdi
cwtl
movl $0x4, %ecx
cltd
idivl %ecx
movswl %ax, %esi
callq 0x3f370
jmp 0x3d8d1
movq -0x10(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8310
movq -0xb0(%rbp), %rdi
cwtl
movl $0x4, %ecx
cltd
idivl %ecx
movswl %ax, %esi
callq 0x3f2d0
jmp 0x3d8d3
jmp 0x3d8d5
jmp 0x3d8d7
jmp 0x3d8d9
jmp 0x3d8f5
movzbl -0x11(%rbp), %eax
cmpl $0x13, %eax
jne 0x3d8f3
movq -0x20(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movb $0x1, (%rax)
jmp 0x3d8f5
jmp 0x3d8f7
jmp 0x3d8f9
jmp 0x3d8fb
jmp 0x3d8fd
movb -0x21(%rbp), %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0xb0, %rsp
popq %rbp
retq
nop