// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_win.c
// Function: lv_win_signal
static lv_res_t lv_win_signal(lv_obj_t * win, lv_signal_t sign, void * param)
{
    lv_res_t res;

    /* Include the ancient signal function */
    res = ancestor_signal(win, 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_win_ext_t * ext = lv_obj_get_ext_attr(win);
    if(sign == LV_SIGNAL_CHILD_CHG) { /*Move children to the page*/
        lv_obj_t * page = ext->page;
        if(page != NULL) {
            lv_obj_t * child;
            child = lv_obj_get_child(win, NULL);
            while(child != NULL) {
                if(lv_obj_is_protected(child, LV_PROTECT_PARENT) == false) {
                    lv_obj_t * tmp = child;
                    child          = lv_obj_get_child(win, child); /*Get the next child before move this*/
                    lv_obj_set_parent(tmp, page);
                } else {
                    child = lv_obj_get_child(win, child);
                }
            }
        }
    } else if(sign == LV_SIGNAL_STYLE_CHG) {
        lv_win_realign(win);
    } else if(sign == LV_SIGNAL_CORD_CHG) {
        /*If the size is changed refresh the window*/
        if(lv_area_get_width(param) != lv_obj_get_width(win) || lv_area_get_height(param) != lv_obj_get_height(win)) {
            lv_win_realign(win);
        }
    } else if(sign == LV_SIGNAL_CLEANUP) {
        ext->header = NULL; /*These objects were children so they are already invalid*/
        ext->page   = NULL;
        ext->title  = NULL;
    } else if(sign == LV_SIGNAL_CONTROL) {
        /*Forward all the control signals to the page*/
        ext->page->signal_cb(ext->page, sign, param);
    }

    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 *0x38db0(%rip)          # 0x5e480
movl %eax, %ebx
cmpb $0x1, %al
jne 0x2577a
cmpb $0x7, %bpl
jne 0x256fd
leaq 0x16486(%rip), %rsi     # 0x3bb6d
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x684b
movq %r14, %rdi
callq 0x6747
movzbl %bpl, %ecx
movb $0x1, %bl
cmpb $0x4, %bpl
ja 0x2572e
leaq 0x16408(%rip), %rdx     # 0x3bb20
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
andq $0x0, 0x10(%rax)
jmp 0x2577a
cmpl $0x12, %ecx
jne 0x2577a
movq (%rax), %rdi
pushq $0x12
popq %rsi
movq %r15, %rdx
callq *0x30(%rdi)
jmp 0x2577a
movzwl 0x4(%r15), %ebp
subw (%r15), %bp
incl %ebp
movq %r14, %rdi
callq 0x5308
cmpw %ax, %bp
jne 0x25772
movzwl 0x6(%r15), %ebp
subw 0x2(%r15), %bp
incl %ebp
movq %r14, %rdi
callq 0x5332
cmpw %ax, %bp
je 0x2577a
movq %r14, %rdi
callq 0x258d5
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rax), %rax
movq %rax, (%rsp)
testq %rax, %rax
je 0x2577a
movq %r14, %rdi
xorl %esi, %esi
callq 0x4e4d
movq %rax, %r13
pushq $0x2
popq %rbp
testq %r13, %r13
je 0x2577a
movq %r13, %r12
movq %r13, %rdi
movl %ebp, %esi
callq 0x66ab
movl %eax, %r15d
movq %r14, %rdi
movq %r13, %rsi
callq 0x4e4d
movq %rax, %r13
testb %r15b, %r15b
jne 0x257a7
movq %r12, %rdi
movq (%rsp), %rsi
callq 0x4eff
jmp 0x257a7