// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x40a09
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x40a09
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x40a0e
jmp 0x40bed
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x413c0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8310
movq -0x40(%rbp), %rdi
movw %ax, %cx
movq -0x10(%rbp), %rax
movswl 0x28(%rax), %eax
movq -0x18(%rbp), %rdx
movswl 0x16(%rdx), %edx
addl %edx, %eax
movq -0x18(%rbp), %rdx
movswl 0x18(%rdx), %edx
addl %edx, %eax
movswl %cx, %esi
movswl %ax, %edx
callq 0x8180
movb $0x1, -0x19(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9e20
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x9e20
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x40b3a
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
movw 0x28(%rax), %cx
movq -0x10(%rbp), %rax
movswl %cx, %esi
movswl 0x28(%rax), %edx
callq 0x8180
testb $0x1, -0x19(%rbp)
je 0x40af4
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rax
movswl 0x1c(%rax), %ecx
xorl %eax, %eax
subl %ecx, %eax
movl $0x8, %edx
xorl %r8d, %r8d
movswl %ax, %ecx
callq 0x8500
movb $0x0, -0x19(%rbp)
jmp 0x40b18
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rax
movswl 0x1e(%rax), %ecx
xorl %eax, %eax
subl %ecx, %eax
movl $0x10, %edx
xorl %r8d, %r8d
movswl %ax, %ecx
callq 0x8500
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x9e20
movq %rax, -0x28(%rbp)
jmp 0x40a99
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x413c0
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x38(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %esi
movl $0x7, %edx
xorl %r8d, %r8d
movswl 0x1a(%rax), %ecx
callq 0x8500
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x71f0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8310
movw %ax, -0x46(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8350
cwtl
movl %eax, -0x44(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x8350
movq -0x50(%rbp), %rdi
movw -0x46(%rbp), %cx
movw %ax, %dx
movl -0x44(%rbp), %eax
movswl %dx, %edx
subl %edx, %eax
movswl %cx, %esi
movswl %ax, %edx
callq 0x8180
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movl $0xc, %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x8500
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)