// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_cont.c
// Function: lv_cont_layout_pretty
static void lv_cont_layout_pretty(lv_obj_t * cont)
{
    lv_obj_t * child_rs;  /* Row starter child */
    lv_obj_t * child_rc;  /* Row closer child */
    lv_obj_t * child_tmp; /* Temporary child */
    const lv_style_t * style = lv_obj_get_style(cont);
    lv_coord_t w_obj         = lv_obj_get_width(cont);
    lv_coord_t act_y         = style->body.padding.top;
    /* Disable child change action because the children will be moved a lot
     * an unnecessary child change signals could be sent*/

    child_rs = lv_ll_get_tail(&cont->child_ll); /*Set the row starter child*/
    if(child_rs == NULL) return;                /*Return if no child*/

    lv_obj_set_protect(cont, LV_PROTECT_CHILD_CHG);

    child_rc = child_rs; /*Initially the the row starter and closer is the same*/
    while(child_rs != NULL) {
        lv_coord_t h_row = 0;
        lv_coord_t w_row =
            style->body.padding.left + style->body.padding.right; /*The width is at least the left+right hpad*/
        uint32_t obj_num = 0;

        /*Find the row closer object and collect some data*/
        do {
            if(lv_obj_get_hidden(child_rc) == false && lv_obj_is_protected(child_rc, LV_PROTECT_POS) == false) {
                /*If this object is already not fit then break*/
                if(w_row + lv_obj_get_width(child_rc) > w_obj) {
                    /*Step back one child because the last already not fit, so the previous is the
                     * closer*/
                    if(child_rc != NULL && obj_num != 0) {
                        child_rc = lv_ll_get_next(&cont->child_ll, child_rc);
                    }
                    break;
                }
                w_row += lv_obj_get_width(child_rc) + style->body.padding.inner; /*Add the object width + opad*/
                h_row = LV_MATH_MAX(h_row, lv_obj_get_height(child_rc));         /*Search the highest object*/
                obj_num++;
                if(lv_obj_is_protected(child_rc, LV_PROTECT_FOLLOW))
                    break; /*If can not be followed by an other object then break here*/
            }
            child_rc = lv_ll_get_prev(&cont->child_ll, child_rc); /*Load the next object*/
            if(obj_num == 0)
                child_rs = child_rc; /*If the first object was hidden (or too long) then set the
                                        next as first */
        } while(child_rc != NULL);

        /*If the object is too long  then align it to the middle*/
        if(obj_num == 0) {
            if(child_rc != NULL) {
                lv_obj_align(child_rc, cont, LV_ALIGN_IN_TOP_MID, 0, act_y);
                h_row = lv_obj_get_height(child_rc); /*Not set previously because of the early break*/
            }
        }
        /*If there is only one object in the row then align it to the middle*/
        else if(obj_num == 1) {
            lv_obj_align(child_rs, cont, LV_ALIGN_IN_TOP_MID, 0, act_y);
        }
        /*If there are two object in the row then align them proportionally*/
        else if(obj_num == 2) {
            lv_obj_t * obj1 = child_rs;
            lv_obj_t * obj2 = lv_ll_get_prev(&cont->child_ll, child_rs);
            w_row           = lv_obj_get_width(obj1) + lv_obj_get_width(obj2);
            lv_coord_t pad  = (w_obj - w_row) / 3;
            lv_obj_align(obj1, cont, LV_ALIGN_IN_TOP_LEFT, pad, act_y + (h_row - lv_obj_get_height(obj1)) / 2);
            lv_obj_align(obj2, cont, LV_ALIGN_IN_TOP_RIGHT, -pad, act_y + (h_row - lv_obj_get_height(obj2)) / 2);
        }
        /* Align the children (from child_rs to child_rc)*/
        else {
            w_row -= style->body.padding.inner * obj_num;
            lv_coord_t new_opad = (w_obj - w_row) / (obj_num - 1);
            lv_coord_t act_x    = style->body.padding.left; /*x init*/
            child_tmp           = child_rs;
            while(child_tmp != NULL) {
                if(lv_obj_get_hidden(child_tmp) == false && lv_obj_is_protected(child_tmp, LV_PROTECT_POS) == false) {
                    lv_obj_align(child_tmp, cont, LV_ALIGN_IN_TOP_LEFT, act_x,
                                 act_y + (h_row - lv_obj_get_height(child_tmp)) / 2);
                    act_x += lv_obj_get_width(child_tmp) + new_opad;
                }
                if(child_tmp == child_rc) break;
                child_tmp = lv_ll_get_prev(&cont->child_ll, child_tmp);
            }
        }

        if(child_rc == NULL) break;
        act_y += style->body.padding.inner + h_row;           /*y increment*/
        child_rs = lv_ll_get_prev(&cont->child_ll, child_rc); /*Go to the next object*/
        child_rc = child_rs;
    }
    lv_obj_clear_protect(cont, LV_PROTECT_CHILD_CHG);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0xa080
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8310
movw %ax, -0x2a(%rbp)
movq -0x28(%rbp), %rax
movw 0x16(%rax), %ax
movw %ax, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
callq 0x458e0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x395b2
jmp 0x39a6c
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x9a50
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x39a5e
movw $0x0, -0x2e(%rbp)
movq -0x28(%rbp), %rax
movswl 0x1a(%rax), %eax
movq -0x28(%rbp), %rcx
movswl 0x1c(%rcx), %ecx
addl %ecx, %eax
movw %ax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x18(%rbp), %rdi
callq 0x7c90
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x396ee
movq -0x18(%rbp), %rdi
movl $0x4, %esi
callq 0xa7d0
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x396ee
movswl -0x30(%rbp), %eax
movl %eax, -0x54(%rbp)
movq -0x18(%rbp), %rdi
callq 0x8310
movw %ax, %cx
movl -0x54(%rbp), %eax
movswl %cx, %ecx
addl %ecx, %eax
movswl -0x2a(%rbp), %ecx
cmpl %ecx, %eax
jle 0x39673
cmpq $0x0, -0x18(%rbp)
je 0x3966e
cmpl $0x0, -0x34(%rbp)
je 0x3966e
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movq -0x18(%rbp), %rsi
callq 0x458a0
movq %rax, -0x18(%rbp)
jmp 0x3971e
movq -0x18(%rbp), %rdi
callq 0x8310
movswl %ax, %ecx
movq -0x28(%rbp), %rax
movswl 0x1e(%rax), %eax
addl %eax, %ecx
movswl -0x30(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x30(%rbp)
movswl -0x2e(%rbp), %eax
movl %eax, -0x58(%rbp)
movq -0x18(%rbp), %rdi
callq 0x8350
movw %ax, %cx
movl -0x58(%rbp), %eax
movswl %cx, %ecx
cmpl %ecx, %eax
jle 0x396b9
movswl -0x2e(%rbp), %eax
movl %eax, -0x5c(%rbp)
jmp 0x396c6
movq -0x18(%rbp), %rdi
callq 0x8350
cwtl
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movw %ax, -0x2e(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movq -0x18(%rbp), %rdi
movl $0x8, %esi
callq 0xa7d0
testb $0x1, %al
jne 0x396ea
jmp 0x396ec
jmp 0x3971e
jmp 0x396ee
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movq -0x18(%rbp), %rsi
callq 0x45690
movq %rax, -0x18(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0x39711
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x39713
cmpq $0x0, -0x18(%rbp)
jne 0x395f6
cmpl $0x0, -0x34(%rbp)
jne 0x39756
cmpq $0x0, -0x18(%rbp)
je 0x39751
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x2, %edx
xorl %ecx, %ecx
movswl -0x2c(%rbp), %r8d
callq 0x8500
movq -0x18(%rbp), %rdi
callq 0x8350
movw %ax, -0x2e(%rbp)
jmp 0x39a1b
cmpl $0x1, -0x34(%rbp)
jne 0x3977a
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x2, %edx
xorl %ecx, %ecx
movswl -0x2c(%rbp), %r8d
callq 0x8500
jmp 0x39a19
cmpl $0x2, -0x34(%rbp)
jne 0x398cd
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movq -0x10(%rbp), %rsi
callq 0x45690
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
callq 0x8310
cwtl
movl %eax, -0x9c(%rbp)
movq -0x48(%rbp), %rdi
callq 0x8310
movw %ax, %cx
movl -0x9c(%rbp), %eax
movswl %cx, %ecx
addl %ecx, %eax
movw %ax, -0x30(%rbp)
movswl -0x2a(%rbp), %eax
movswl -0x30(%rbp), %ecx
subl %ecx, %eax
movl $0x3, %ecx
cltd
idivl %ecx
movw %ax, -0x4a(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
movw -0x4a(%rbp), %ax
movw %ax, -0x82(%rbp)
movswl -0x2c(%rbp), %eax
movl %eax, -0x7c(%rbp)
movswl -0x2e(%rbp), %eax
movl %eax, -0x80(%rbp)
movq -0x40(%rbp), %rdi
callq 0x8350
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rsi
movw -0x82(%rbp), %cx
movw %ax, %dx
movl -0x80(%rbp), %eax
movswl %dx, %edx
subl %edx, %eax
movl $0x2, %r8d
cltd
idivl %r8d
movl %eax, %edx
movl -0x7c(%rbp), %eax
addl %edx, %eax
movl $0x1, %edx
movswl %cx, %ecx
movswl %ax, %r8d
callq 0x8500
movq -0x48(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movswl -0x4a(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x66(%rbp)
movswl -0x2c(%rbp), %eax
movl %eax, -0x60(%rbp)
movswl -0x2e(%rbp), %eax
movl %eax, -0x64(%rbp)
movq -0x48(%rbp), %rdi
callq 0x8350
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rsi
movw -0x66(%rbp), %cx
movw %ax, %dx
movl -0x64(%rbp), %eax
movswl %dx, %edx
subl %edx, %eax
movl $0x2, %r8d
cltd
idivl %r8d
movl %eax, %edx
movl -0x60(%rbp), %eax
addl %edx, %eax
movl $0x3, %edx
movswl %cx, %ecx
movswl %ax, %r8d
callq 0x8500
jmp 0x39a17
movq -0x28(%rbp), %rax
movswl 0x1e(%rax), %ecx
imull -0x34(%rbp), %ecx
movswl -0x30(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x30(%rbp)
movswl -0x2a(%rbp), %eax
movswl -0x30(%rbp), %ecx
subl %ecx, %eax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
xorl %edx, %edx
divl %ecx
movw %ax, -0x4c(%rbp)
movq -0x28(%rbp), %rax
movw 0x1a(%rax), %ax
movw %ax, -0x4e(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x39a15
movq -0x20(%rbp), %rdi
callq 0x7c90
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x399ef
movq -0x20(%rbp), %rdi
movl $0x4, %esi
callq 0xa7d0
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x399ef
movq -0x20(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movw -0x4e(%rbp), %ax
movw %ax, -0xa6(%rbp)
movswl -0x2c(%rbp), %eax
movl %eax, -0xa0(%rbp)
movswl -0x2e(%rbp), %eax
movl %eax, -0xa4(%rbp)
movq -0x20(%rbp), %rdi
callq 0x8350
movq -0xb8(%rbp), %rdi
movq -0xb0(%rbp), %rsi
movw -0xa6(%rbp), %cx
movw %ax, %dx
movl -0xa4(%rbp), %eax
movswl %dx, %edx
subl %edx, %eax
movl $0x2, %r8d
cltd
idivl %r8d
movl %eax, %edx
movl -0xa0(%rbp), %eax
addl %edx, %eax
movl $0x1, %edx
movswl %cx, %ecx
movswl %ax, %r8d
callq 0x8500
movq -0x20(%rbp), %rdi
callq 0x8310
movswl %ax, %ecx
movswl -0x4c(%rbp), %eax
addl %eax, %ecx
movswl -0x4e(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x4e(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0x399fb
jmp 0x39a15
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movq -0x20(%rbp), %rsi
callq 0x45690
movq %rax, -0x20(%rbp)
jmp 0x3990f
jmp 0x39a17
jmp 0x39a19
jmp 0x39a1b
cmpq $0x0, -0x18(%rbp)
jne 0x39a24
jmp 0x39a5e
movq -0x28(%rbp), %rax
movswl 0x1e(%rax), %ecx
movswl -0x2e(%rbp), %eax
addl %eax, %ecx
movswl -0x2c(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movq -0x18(%rbp), %rsi
callq 0x45690
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x395c8
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x9aa0
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)