// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_core/lv_refr.c
// Function: lv_refr_join_area
static void lv_refr_join_area(void)
{
    uint32_t join_from;
    uint32_t join_in;
    lv_area_t joined_area;
    for(join_in = 0; join_in < disp_refr->inv_p; join_in++) {
        if(disp_refr->inv_area_joined[join_in] != 0) continue;

        /*Check all areas to join them in 'join_in'*/
        for(join_from = 0; join_from < disp_refr->inv_p; join_from++) {
            /*Handle only unjoined areas and ignore itself*/
            if(disp_refr->inv_area_joined[join_from] != 0 || join_in == join_from) {
                continue;
            }

            /*Check if the areas are on each other*/
            if(lv_area_is_on(&disp_refr->inv_areas[join_in], &disp_refr->inv_areas[join_from]) == false) {
                continue;
            }

            lv_area_join(&joined_area, &disp_refr->inv_areas[join_in], &disp_refr->inv_areas[join_from]);

            /*Join two area only if the joined area size is smaller*/
            if(lv_area_get_size(&joined_area) < (lv_area_get_size(&disp_refr->inv_areas[join_in]) +
                                                 lv_area_get_size(&disp_refr->inv_areas[join_from]))) {
                lv_area_copy(&disp_refr->inv_areas[join_in], &joined_area);

                /*Mark 'join_form' is joined into 'join_in'*/
                disp_refr->inv_area_joined[join_from] = 1;
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
movq 0x7df67(%rip), %rcx     # 0x88f90
movw 0x198(%rcx), %cx
andw $0x3ff, %cx             # imm = 0x3FF
movzwl %cx, %ecx
cmpl %ecx, %eax
jae 0xb1ba
movq 0x7df49(%rip), %rax     # 0x88f90
movl -0x8(%rbp), %ecx
movzbl 0x178(%rax,%rcx), %eax
cmpl $0x0, %eax
je 0xb05c
jmp 0xb1ac
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
movq 0x7df23(%rip), %rcx     # 0x88f90
movw 0x198(%rcx), %cx
andw $0x3ff, %cx             # imm = 0x3FF
movzwl %cx, %ecx
cmpl %ecx, %eax
jae 0xb1aa
movq 0x7df05(%rip), %rax     # 0x88f90
movl -0x4(%rbp), %ecx
movzbl 0x178(%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0xb0a3
movl -0x8(%rbp), %eax
cmpl -0x4(%rbp), %eax
jne 0xb0a8
jmp 0xb19c
movq 0x7dee1(%rip), %rdi     # 0x88f90
addq $0x78, %rdi
movl -0x8(%rbp), %eax
shlq $0x3, %rax
addq %rax, %rdi
movq 0x7decc(%rip), %rsi     # 0x88f90
addq $0x78, %rsi
movl -0x4(%rbp), %eax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x42a70
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xb0e6
jmp 0xb19c
movq 0x7dea3(%rip), %rsi     # 0x88f90
addq $0x78, %rsi
movl -0x8(%rbp), %eax
shlq $0x3, %rax
addq %rax, %rsi
movq 0x7de8e(%rip), %rdx     # 0x88f90
addq $0x78, %rdx
movl -0x4(%rbp), %eax
shlq $0x3, %rax
addq %rax, %rdx
leaq -0x10(%rbp), %rdi
callq 0x42900
leaq -0x10(%rbp), %rdi
callq 0x42790
movl %eax, -0x14(%rbp)
movq 0x7de64(%rip), %rdi     # 0x88f90
addq $0x78, %rdi
movl -0x8(%rbp), %eax
shlq $0x3, %rax
addq %rax, %rdi
callq 0x42790
movl %eax, -0x18(%rbp)
movq 0x7de47(%rip), %rdi     # 0x88f90
addq $0x78, %rdi
movl -0x4(%rbp), %eax
shlq $0x3, %rax
addq %rax, %rdi
callq 0x42790
movl -0x18(%rbp), %ecx
movl %eax, %edx
movl -0x14(%rbp), %eax
addl %edx, %ecx
cmpl %ecx, %eax
jae 0xb19a
movq 0x7de1f(%rip), %rdi     # 0x88f90
addq $0x78, %rdi
movl -0x8(%rbp), %eax
shlq $0x3, %rax
addq %rax, %rdi
leaq -0x10(%rbp), %rsi
callq 0xafc0
movq 0x7de01(%rip), %rax     # 0x88f90
movl -0x4(%rbp), %ecx
movb $0x1, 0x178(%rax,%rcx)
jmp 0xb19c
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xb063
jmp 0xb1ac
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0xb01f
addq $0x20, %rsp
popq %rbp
retq