// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_win.c
// Function: lv_win_realign
static void lv_win_realign(lv_obj_t * win)
{
    lv_win_ext_t * ext = lv_obj_get_ext_attr(win);

    if(ext->page == NULL || ext->header == NULL || ext->title == NULL) return;

    const lv_style_t * header_style = lv_win_get_style(win, LV_WIN_STYLE_HEADER);
    lv_obj_set_size(ext->header, lv_obj_get_width(win),
                    ext->btn_size + header_style->body.padding.top + header_style->body.padding.bottom);

    bool first_btn = true;
    lv_obj_t * btn;
    lv_obj_t * btn_prev = NULL;
    /*Refresh the size of all control buttons*/
    btn = lv_obj_get_child_back(ext->header, NULL);
    btn = lv_obj_get_child_back(ext->header, btn); /*Skip the title*/
    while(btn != NULL) {
        lv_obj_set_size(btn, ext->btn_size, ext->btn_size);
        if(first_btn) {
            lv_obj_align(btn, ext->header, LV_ALIGN_IN_RIGHT_MID, -header_style->body.padding.right, 0);
            first_btn = false;
        } else {
            lv_obj_align(btn, btn_prev, LV_ALIGN_OUT_LEFT_MID, -header_style->body.padding.inner, 0);
        }
        btn_prev = btn;
        btn      = lv_obj_get_child_back(ext->header, btn);
    }

    const lv_style_t * style_header = lv_win_get_style(win, LV_WIN_STYLE_HEADER);
    lv_obj_align(ext->title, NULL, LV_ALIGN_IN_LEFT_MID, style_header->body.padding.left, 0);

    lv_obj_set_pos(ext->header, 0, 0);

    lv_obj_set_size(ext->page, lv_obj_get_width(win), lv_obj_get_height(win) - lv_obj_get_height(ext->header));
    lv_obj_align(ext->page, ext->header, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x6ad8
cmpq $0x0, (%rax)
je 0x27799
movq %rax, %rbx
cmpq $0x0, 0x8(%rax)
je 0x27799
cmpq $0x0, 0x10(%rbx)
je 0x27799
movq %r14, %rdi
movl $0x3, %esi
callq 0x27c94
movq %rax, %r15
movq 0x8(%rbx), %r12
movq %r14, %rdi
callq 0x5651
movzwl 0x16(%r15), %ecx
addw 0x28(%rbx), %cx
addw 0x18(%r15), %cx
movswl %cx, %edx
movswl %ax, %esi
movq %r12, %rdi
callq 0x553f
movq 0x8(%rbx), %rdi
xorl %esi, %esi
callq 0x652f
movq 0x8(%rbx), %rdi
movq %rax, %rsi
callq 0x652f
testq %rax, %rax
je 0x27711
movq %rax, %r12
movb $0x1, %bpl
xorl %r13d, %r13d
movswl 0x28(%rbx), %edx
movq %r12, %rdi
movl %edx, %esi
callq 0x553f
testb $0x1, %bpl
je 0x276da
movq 0x8(%rbx), %rsi
xorl %ebp, %ebp
movzwl 0x1c(%r15), %eax
xorl %ecx, %ecx
subw %ax, %cx
movswl %cx, %ecx
movq %r12, %rdi
movl $0x8, %edx
jmp 0x276f2
movzwl 0x1e(%r15), %eax
xorl %ecx, %ecx
subw %ax, %cx
movswl %cx, %ecx
movq %r12, %rdi
movq %r13, %rsi
movl $0x10, %edx
xorl %r8d, %r8d
callq 0x576d
movq 0x8(%rbx), %rdi
movq %r12, %rsi
callq 0x652f
movq %r12, %r13
movq %rax, %r12
testq %rax, %rax
jne 0x276a9
movq %r14, %rdi
movl $0x3, %esi
callq 0x27c94
movq 0x10(%rbx), %rdi
movswl 0x1a(%rax), %ecx
xorl %esi, %esi
movl $0x7, %edx
xorl %r8d, %r8d
callq 0x576d
movq 0x8(%rbx), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4ae2
movq (%rbx), %r15
movq %r14, %rdi
callq 0x5651
movl %eax, %ebp
movq %r14, %rdi
callq 0x567b
movl %eax, %r14d
movq 0x8(%rbx), %rdi
callq 0x567b
subl %eax, %r14d
movswl %r14w, %edx
movswl %bp, %esi
movq %r15, %rdi
callq 0x553f
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
movl $0xc, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x576d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq