// File: /workspace/github_c_makefile_star2_O2/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, %r12
callq 0x6747
cmpq $0x0, (%rax)
je 0x259cc
movq %rax, %rbx
cmpq $0x0, 0x8(%rax)
je 0x259cc
cmpq $0x0, 0x10(%rbx)
je 0x259cc
pushq $0x3
popq %rsi
movq %r12, %rdi
callq 0x25f4b
movq %rax, %r15
movq 0x8(%rbx), %r14
movq %r12, (%rsp)
movq %r12, %rdi
callq 0x5308
movzwl 0x16(%r15), %ecx
addw 0x28(%rbx), %cx
addw 0x18(%r15), %cx
movswl %cx, %edx
movswl %ax, %esi
movq %r14, %rdi
callq 0x520e
movq 0x8(%rbx), %rdi
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x61b6
movq 0x8(%rbx), %rdi
movq %rax, %rsi
callq 0x61b6
movb $0x1, %bpl
pushq $0x10
popq %r12
testq %rax, %rax
je 0x259db
movq %rax, %r13
movswl 0x28(%rbx), %edx
movq %rax, %rdi
movl %edx, %esi
callq 0x520e
testb $0x1, %bpl
je 0x2599b
movq 0x8(%rbx), %rsi
movzwl 0x1c(%r15), %eax
xorl %ecx, %ecx
subw %ax, %cx
movswl %cx, %ecx
movq %r13, %rdi
pushq $0x8
popq %rdx
jmp 0x259b1
movzwl 0x1e(%r15), %eax
xorl %ecx, %ecx
subw %ax, %cx
movswl %cx, %ecx
movq %r13, %rdi
movq %r14, %rsi
movl %r12d, %edx
xorl %r8d, %r8d
callq 0x5424
movq 0x8(%rbx), %rdi
movq %r13, %rsi
callq 0x61b6
xorl %ebp, %ebp
movq %r13, %r14
jmp 0x25966
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x3
popq %rsi
movq (%rsp), %r15
movq %r15, %rdi
callq 0x25f4b
movq 0x10(%rbx), %rdi
movswl 0x1a(%rax), %ecx
pushq $0x7
popq %rdx
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x5424
movq 0x8(%rbx), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x47df
movq (%rbx), %r14
movq %r15, %rdi
callq 0x5308
movl %eax, %ebp
movq %r15, %rdi
callq 0x5332
movl %eax, %r15d
movq 0x8(%rbx), %rdi
callq 0x5332
subl %eax, %r15d
movswl %r15w, %edx
movswl %bp, %esi
movq %r14, %rdi
callq 0x520e
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
pushq $0xc
popq %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5424