// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_cont.c
// Function: lv_cont_refr_autofit
static void lv_cont_refr_autofit(lv_obj_t * cont)
{
    lv_cont_ext_t * ext = lv_obj_get_ext_attr(cont);

    if(ext->fit_left == LV_FIT_NONE && ext->fit_right == LV_FIT_NONE && ext->fit_top == LV_FIT_NONE &&
       ext->fit_bottom == LV_FIT_NONE) {
        return;
    }

    lv_area_t tight_area;
    lv_area_t ori;
    const lv_style_t * style = lv_obj_get_style(cont);
    lv_obj_t * child_i;

    lv_obj_t * par               = lv_obj_get_parent(cont);
    const lv_style_t * par_style = lv_obj_get_style(par);
    lv_area_t flood_area;
    lv_area_copy(&flood_area, &par->coords);
    flood_area.x1 += par_style->body.padding.left;
    flood_area.x2 -= par_style->body.padding.right;
    flood_area.y1 += par_style->body.padding.top;
    flood_area.y2 -= par_style->body.padding.bottom;

    /*Search the side coordinates of the children*/
    lv_obj_get_coords(cont, &ori);
    lv_obj_get_coords(cont, &tight_area);

    bool has_children = lv_ll_is_empty(&cont->child_ll) ? false : true;

    if(has_children) {
        tight_area.x1 = LV_COORD_MAX;
        tight_area.y1 = LV_COORD_MAX;
        tight_area.x2 = LV_COORD_MIN;
        tight_area.y2 = LV_COORD_MIN;

        LV_LL_READ(cont->child_ll, child_i)
        {
            if(lv_obj_get_hidden(child_i) != false) continue;
            tight_area.x1 = LV_MATH_MIN(tight_area.x1, child_i->coords.x1);
            tight_area.y1 = LV_MATH_MIN(tight_area.y1, child_i->coords.y1);
            tight_area.x2 = LV_MATH_MAX(tight_area.x2, child_i->coords.x2);
            tight_area.y2 = LV_MATH_MAX(tight_area.y2, child_i->coords.y2);
        }

        tight_area.x1 -= style->body.padding.left;
        tight_area.x2 += style->body.padding.right;
        tight_area.y1 -= style->body.padding.top;
        tight_area.y2 += style->body.padding.bottom;
    }

    lv_area_t new_area;
    lv_area_copy(&new_area, &ori);

    switch(ext->fit_left) {
        case LV_FIT_TIGHT: new_area.x1 = tight_area.x1; break;
        case LV_FIT_FLOOD: new_area.x1 = flood_area.x1; break;
        case LV_FIT_FILL: new_area.x1 = has_children ? LV_MATH_MIN(tight_area.x1, flood_area.x1) : flood_area.x1; break;
        default: break;
    }

    switch(ext->fit_right) {
        case LV_FIT_TIGHT: new_area.x2 = tight_area.x2; break;
        case LV_FIT_FLOOD: new_area.x2 = flood_area.x2; break;
        case LV_FIT_FILL: new_area.x2 = has_children ? LV_MATH_MAX(tight_area.x2, flood_area.x2) : flood_area.x2; break;
        default: break;
    }

    switch(ext->fit_top) {
        case LV_FIT_TIGHT: new_area.y1 = tight_area.y1; break;
        case LV_FIT_FLOOD: new_area.y1 = flood_area.y1; break;
        case LV_FIT_FILL: new_area.y1 = has_children ? LV_MATH_MIN(tight_area.y1, flood_area.y1) : flood_area.y1; break;
        default: break;
    }

    switch(ext->fit_bottom) {
        case LV_FIT_TIGHT: new_area.y2 = tight_area.y2; break;
        case LV_FIT_FLOOD: new_area.y2 = flood_area.y2; break;
        case LV_FIT_FILL: new_area.y2 = has_children ? LV_MATH_MAX(tight_area.y2, flood_area.y2) : flood_area.y2; break;
        default: break;
    }

    /*Do nothing if the coordinates are not changed*/
    if(cont->coords.x1 != new_area.x1 || cont->coords.y1 != new_area.y1 || cont->coords.x2 != new_area.x2 ||
       cont->coords.y2 != new_area.y2) {

        lv_obj_invalidate(cont);
        lv_area_copy(&cont->coords, &new_area);
        lv_obj_invalidate(cont);

        /*Notify the object about its new coordinates*/
        cont->signal_cb(cont, LV_SIGNAL_CORD_CHG, &ori);

        /*Inform the parent about the new coordinates*/
        par->signal_cb(par, LV_SIGNAL_CHILD_CHG, cont);

        if(lv_obj_get_auto_realign(cont)) {
            lv_obj_realign(cont);
        }

        /*Tell the children the parent's size has changed*/
        LV_LL_READ(cont->child_ll, child_i)
        {
            child_i->signal_cb(child_i, LV_SIGNAL_PARENT_SIZE_CHG, NULL);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movw (%rax), %ax
shrw $0x4, %ax
andw $0x3, %ax
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x38a9d
movq -0x10(%rbp), %rax
movw (%rax), %ax
shrw $0x6, %ax
andw $0x3, %ax
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x38a9d
movq -0x10(%rbp), %rax
movw (%rax), %ax
shrw $0x8, %ax
andw $0x3, %ax
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x38a9d
movq -0x10(%rbp), %rax
movw (%rax), %ax
shrw $0xa, %ax
andw $0x3, %ax
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x38a9d
jmp 0x38fd8
movq -0x8(%rbp), %rdi
callq 0xa080
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x71b0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0xa080
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rsi
addq $0x20, %rsi
leaq -0x48(%rbp), %rdi
callq 0x39c90
movq -0x40(%rbp), %rax
movswl 0x1a(%rax), %ecx
movswl -0x48(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movswl 0x1c(%rax), %ecx
movswl -0x44(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x44(%rbp)
movq -0x40(%rbp), %rax
movswl 0x16(%rax), %ecx
movswl -0x46(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x46(%rbp)
movq -0x40(%rbp), %rax
movswl 0x18(%rax), %ecx
movswl -0x42(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x42(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x7fb0
movq -0x8(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x7fb0
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
callq 0x45bb0
movb %al, %dl
movl $0x1, %eax
xorl %ecx, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, -0x49(%rbp)
testb $0x1, -0x49(%rbp)
je 0x38cc2
movw $0x7c18, -0x18(%rbp)    # imm = 0x7C18
movw $0x7c18, -0x16(%rbp)    # imm = 0x7C18
movw $0x83e8, -0x14(%rbp)    # imm = 0x83E8
movw $0x83e8, -0x12(%rbp)    # imm = 0x83E8
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
callq 0x45660
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x38c7a
movq -0x30(%rbp), %rdi
callq 0x7c90
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x38bb4
jmp 0x38c60
movswl -0x18(%rbp), %eax
movq -0x30(%rbp), %rcx
movswl 0x20(%rcx), %ecx
cmpl %ecx, %eax
jge 0x38bcd
movswl -0x18(%rbp), %eax
movl %eax, -0x58(%rbp)
jmp 0x38bd8
movq -0x30(%rbp), %rax
movswl 0x20(%rax), %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
movw %ax, -0x18(%rbp)
movswl -0x16(%rbp), %eax
movq -0x30(%rbp), %rcx
movswl 0x22(%rcx), %ecx
cmpl %ecx, %eax
jge 0x38bf8
movswl -0x16(%rbp), %eax
movl %eax, -0x5c(%rbp)
jmp 0x38c03
movq -0x30(%rbp), %rax
movswl 0x22(%rax), %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movw %ax, -0x16(%rbp)
movswl -0x14(%rbp), %eax
movq -0x30(%rbp), %rcx
movswl 0x24(%rcx), %ecx
cmpl %ecx, %eax
jle 0x38c23
movswl -0x14(%rbp), %eax
movl %eax, -0x60(%rbp)
jmp 0x38c2e
movq -0x30(%rbp), %rax
movswl 0x24(%rax), %eax
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %eax
movw %ax, -0x14(%rbp)
movswl -0x12(%rbp), %eax
movq -0x30(%rbp), %rcx
movswl 0x26(%rcx), %ecx
cmpl %ecx, %eax
jle 0x38c4e
movswl -0x12(%rbp), %eax
movl %eax, -0x64(%rbp)
jmp 0x38c59
movq -0x30(%rbp), %rax
movswl 0x26(%rax), %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
movw %ax, -0x12(%rbp)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movq -0x30(%rbp), %rsi
callq 0x458a0
movq %rax, -0x30(%rbp)
jmp 0x38b91
movq -0x28(%rbp), %rax
movswl 0x1a(%rax), %ecx
movswl -0x18(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x28(%rbp), %rax
movswl 0x1c(%rax), %ecx
movswl -0x14(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x14(%rbp)
movq -0x28(%rbp), %rax
movswl 0x16(%rax), %ecx
movswl -0x16(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x16(%rbp)
movq -0x28(%rbp), %rax
movswl 0x18(%rax), %ecx
movswl -0x12(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x12(%rbp)
leaq -0x52(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x39c90
movq -0x10(%rbp), %rax
movzwl (%rax), %eax
shrl $0x4, %eax
andl $0x3, %eax
movl %eax, -0x68(%rbp)
subb $0x1, %al
je 0x38cf9
jmp 0x38ce5
movl -0x68(%rbp), %eax
subl $0x2, %eax
je 0x38d03
jmp 0x38cef
movl -0x68(%rbp), %eax
subl $0x3, %eax
je 0x38d0d
jmp 0x38d47
movw -0x18(%rbp), %ax
movw %ax, -0x52(%rbp)
jmp 0x38d49
movw -0x48(%rbp), %ax
movw %ax, -0x52(%rbp)
jmp 0x38d49
testb $0x1, -0x49(%rbp)
je 0x38d37
movswl -0x18(%rbp), %eax
movswl -0x48(%rbp), %ecx
cmpl %ecx, %eax
jge 0x38d28
movswl -0x18(%rbp), %eax
movl %eax, -0x6c(%rbp)
jmp 0x38d2f
movswl -0x48(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movl %eax, -0x70(%rbp)
jmp 0x38d3e
movswl -0x48(%rbp), %eax
movl %eax, -0x70(%rbp)
movl -0x70(%rbp), %eax
movw %ax, -0x52(%rbp)
jmp 0x38d49
jmp 0x38d49
movq -0x10(%rbp), %rax
movzwl (%rax), %eax
shrl $0x6, %eax
andl $0x3, %eax
movl %eax, -0x74(%rbp)
subb $0x1, %al
je 0x38d73
jmp 0x38d5f
movl -0x74(%rbp), %eax
subl $0x2, %eax
je 0x38d7d
jmp 0x38d69
movl -0x74(%rbp), %eax
subl $0x3, %eax
je 0x38d87
jmp 0x38dc1
movw -0x14(%rbp), %ax
movw %ax, -0x4e(%rbp)
jmp 0x38dc3
movw -0x44(%rbp), %ax
movw %ax, -0x4e(%rbp)
jmp 0x38dc3
testb $0x1, -0x49(%rbp)
je 0x38db1
movswl -0x14(%rbp), %eax
movswl -0x44(%rbp), %ecx
cmpl %ecx, %eax
jle 0x38da2
movswl -0x14(%rbp), %eax
movl %eax, -0x78(%rbp)
jmp 0x38da9
movswl -0x44(%rbp), %eax
movl %eax, -0x78(%rbp)
movl -0x78(%rbp), %eax
movl %eax, -0x7c(%rbp)
jmp 0x38db8
movswl -0x44(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movw %ax, -0x4e(%rbp)
jmp 0x38dc3
jmp 0x38dc3
movq -0x10(%rbp), %rax
movzbl 0x1(%rax), %eax
andl $0x3, %eax
movl %eax, -0x80(%rbp)
subl $0x1, %eax
je 0x38dec
jmp 0x38dd8
movl -0x80(%rbp), %eax
subl $0x2, %eax
je 0x38df6
jmp 0x38de2
movl -0x80(%rbp), %eax
subl $0x3, %eax
je 0x38e00
jmp 0x38e4c
movw -0x16(%rbp), %ax
movw %ax, -0x50(%rbp)
jmp 0x38e4e
movw -0x46(%rbp), %ax
movw %ax, -0x50(%rbp)
jmp 0x38e4e
testb $0x1, -0x49(%rbp)
je 0x38e36
movswl -0x16(%rbp), %eax
movswl -0x46(%rbp), %ecx
cmpl %ecx, %eax
jge 0x38e1e
movswl -0x16(%rbp), %eax
movl %eax, -0x84(%rbp)
jmp 0x38e28
movswl -0x46(%rbp), %eax
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %eax
movl %eax, -0x88(%rbp)
jmp 0x38e40
movswl -0x46(%rbp), %eax
movl %eax, -0x88(%rbp)
movl -0x88(%rbp), %eax
movw %ax, -0x50(%rbp)
jmp 0x38e4e
jmp 0x38e4e
movq -0x10(%rbp), %rax
movzwl (%rax), %eax
shrl $0xa, %eax
andl $0x3, %eax
movl %eax, -0x8c(%rbp)
subb $0x1, %al
je 0x38e81
jmp 0x38e67
movl -0x8c(%rbp), %eax
subl $0x2, %eax
je 0x38e8b
jmp 0x38e74
movl -0x8c(%rbp), %eax
subl $0x3, %eax
je 0x38e95
jmp 0x38ee1
movw -0x12(%rbp), %ax
movw %ax, -0x4c(%rbp)
jmp 0x38ee3
movw -0x42(%rbp), %ax
movw %ax, -0x4c(%rbp)
jmp 0x38ee3
testb $0x1, -0x49(%rbp)
je 0x38ecb
movswl -0x12(%rbp), %eax
movswl -0x42(%rbp), %ecx
cmpl %ecx, %eax
jle 0x38eb3
movswl -0x12(%rbp), %eax
movl %eax, -0x90(%rbp)
jmp 0x38ebd
movswl -0x42(%rbp), %eax
movl %eax, -0x90(%rbp)
movl -0x90(%rbp), %eax
movl %eax, -0x94(%rbp)
jmp 0x38ed5
movswl -0x42(%rbp), %eax
movl %eax, -0x94(%rbp)
movl -0x94(%rbp), %eax
movw %ax, -0x4c(%rbp)
jmp 0x38ee3
jmp 0x38ee3
movq -0x8(%rbp), %rax
movswl 0x20(%rax), %eax
movswl -0x52(%rbp), %ecx
cmpl %ecx, %eax
jne 0x38f27
movq -0x8(%rbp), %rax
movswl 0x22(%rax), %eax
movswl -0x50(%rbp), %ecx
cmpl %ecx, %eax
jne 0x38f27
movq -0x8(%rbp), %rax
movswl 0x24(%rax), %eax
movswl -0x4e(%rbp), %ecx
cmpl %ecx, %eax
jne 0x38f27
movq -0x8(%rbp), %rax
movswl 0x26(%rax), %eax
movswl -0x4c(%rbp), %ecx
cmpl %ecx, %eax
je 0x38fd8
movq -0x8(%rbp), %rdi
callq 0x7430
movq -0x8(%rbp), %rdi
addq $0x20, %rdi
leaq -0x52(%rbp), %rsi
callq 0x39c90
movq -0x8(%rbp), %rdi
callq 0x7430
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x8(%rbp), %rdi
movl $0x2, %esi
leaq -0x20(%rbp), %rdx
callq *%rax
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x38(%rbp), %rdi
movq -0x8(%rbp), %rdx
movl $0x1, %esi
callq *%rax
movq -0x8(%rbp), %rdi
callq 0xa2a0
testb $0x1, %al
jne 0x38f87
jmp 0x38f90
movq -0x8(%rbp), %rdi
callq 0x8390
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
callq 0x45660
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x38fd6
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x30(%rbp), %rdi
movl $0x3, %esi
xorl %ecx, %ecx
movl %ecx, %edx
callq *%rax
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movq -0x30(%rbp), %rsi
callq 0x458a0
movq %rax, -0x30(%rbp)
jmp 0x38fa1
jmp 0x38fd8
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)