// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_core/lv_refr.c
// Function: lv_refr_obj
static void lv_refr_obj(lv_obj_t * obj, const lv_area_t * mask_ori_p)
{
    /*Do not refresh hidden objects*/
    if(obj->hidden != 0) return;

    bool union_ok; /* Store the return value of area_union */
    /* Truncate the original mask to the coordinates of the parent
     * because the parent and its children are visible only here */
    lv_area_t obj_mask;
    lv_area_t obj_ext_mask;
    lv_area_t obj_area;
    lv_coord_t ext_size = obj->ext_draw_pad;
    lv_obj_get_coords(obj, &obj_area);
    obj_area.x1 -= ext_size;
    obj_area.y1 -= ext_size;
    obj_area.x2 += ext_size;
    obj_area.y2 += ext_size;
    union_ok = lv_area_intersect(&obj_ext_mask, mask_ori_p, &obj_area);

    /*Draw the parent and its children only if they ore on 'mask_parent'*/
    if(union_ok != false) {

        /* Redraw the object */
        obj->design_cb(obj, &obj_ext_mask, LV_DESIGN_DRAW_MAIN);

#if MASK_AREA_DEBUG
        static lv_color_t debug_color = LV_COLOR_RED;
        lv_draw_fill(&obj_ext_mask, &obj_ext_mask, debug_color, LV_OPA_50);
        debug_color.full *= 17;
        debug_color.full += 0xA1;
#endif
        /*Create a new 'obj_mask' without 'ext_size' because the children can't be visible there*/
        lv_obj_get_coords(obj, &obj_area);
        union_ok = lv_area_intersect(&obj_mask, mask_ori_p, &obj_area);
        if(union_ok != false) {
            lv_area_t mask_child; /*Mask from obj and its child*/
            lv_obj_t * child_p;
            lv_area_t child_area;
            LV_LL_READ_BACK(obj->child_ll, child_p)
            {
                lv_obj_get_coords(child_p, &child_area);
                ext_size = child_p->ext_draw_pad;
                child_area.x1 -= ext_size;
                child_area.y1 -= ext_size;
                child_area.x2 += ext_size;
                child_area.y2 += ext_size;
                /* Get the union (common parts) of original mask (from obj)
                 * and its child */
                union_ok = lv_area_intersect(&mask_child, &obj_mask, &child_area);

                /*If the parent and the child has common area then refresh the child */
                if(union_ok) {
                    /*Refresh the next children*/
                    lv_refr_obj(child_p, &mask_child);
                }
            }
        }

        /* If all the children are redrawn make 'post draw' design */
        obj->design_cb(obj, &obj_ext_mask, LV_DESIGN_DRAW_POST);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movw 0x58(%rax), %ax
shrw $0x4, %ax
andw $0x1, %ax
movzbl %al, %eax
cmpl $0x0, %eax
je 0xb93d
jmp 0xbac8
movq -0x8(%rbp), %rax
movw 0x5c(%rax), %ax
movw %ax, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x2a(%rbp), %rsi
callq 0x7fb0
movswl -0x2c(%rbp), %ecx
movswl -0x2a(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x2a(%rbp)
movswl -0x2c(%rbp), %ecx
movswl -0x28(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x28(%rbp)
movswl -0x2c(%rbp), %ecx
movswl -0x26(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x26(%rbp)
movswl -0x2c(%rbp), %ecx
movswl -0x24(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x24(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x22(%rbp), %rdi
leaq -0x2a(%rbp), %rdx
callq 0x427d0
andb $0x1, %al
movb %al, -0x11(%rbp)
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0xbac8
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x8(%rbp), %rdi
leaq -0x22(%rbp), %rsi
xorl %edx, %edx
callq *%rax
movq -0x8(%rbp), %rdi
leaq -0x2a(%rbp), %rsi
callq 0x7fb0
movq -0x10(%rbp), %rsi
leaq -0x1a(%rbp), %rdi
leaq -0x2a(%rbp), %rdx
callq 0x427d0
andb $0x1, %al
movb %al, -0x11(%rbp)
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0xbab1
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
callq 0x458e0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0xbaaf
movq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x7fb0
movq -0x40(%rbp), %rax
movw 0x5c(%rax), %ax
movw %ax, -0x2c(%rbp)
movswl -0x2c(%rbp), %ecx
movswl -0x48(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x48(%rbp)
movswl -0x2c(%rbp), %ecx
movswl -0x46(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x46(%rbp)
movswl -0x2c(%rbp), %ecx
movswl -0x44(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x44(%rbp)
movswl -0x2c(%rbp), %ecx
movswl -0x42(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x42(%rbp)
leaq -0x34(%rbp), %rdi
leaq -0x1a(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x427d0
andb $0x1, %al
movb %al, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
je 0xba93
movq -0x40(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0xb910
jmp 0xba95
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movq -0x40(%rbp), %rsi
callq 0x45690
movq %rax, -0x40(%rbp)
jmp 0xba0e
jmp 0xbab1
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x8(%rbp), %rdi
leaq -0x22(%rbp), %rsi
movl $0x1, %edx
callq *%rax
addq $0x50, %rsp
popq %rbp
retq
nop