// File: /workspace/github_c_makefile_star2_O1/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:
testb $0x10, 0x58(%rdi)
jne 0x763a
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movzwl 0x5c(%rdi), %ebp
leaq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0x5427
subw %bp, (%r15)
subw %bp, 0x2(%r15)
addw %bp, 0x4(%r15)
addw %bp, 0x6(%r15)
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2865e
testb %al, %al
je 0x762c
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq *0x38(%rbx)
leaq 0x10(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5427
leaq 0x18(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2865e
testb %al, %al
je 0x761c
leaq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x29e0b
testq %rax, %rax
je 0x761c
movq %rax, %r15
movq %rsp, %r12
leaq 0x20(%rsp), %r13
leaq 0x18(%rsp), %rbp
movq %r15, %rdi
movq %r12, %rsi
callq 0x5427
movzwl 0x5c(%r15), %eax
subw %ax, (%rsp)
subw %ax, 0x2(%rsp)
addw %ax, 0x4(%rsp)
addw %ax, 0x6(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x2865e
testb %al, %al
je 0x7609
movq %r15, %rdi
movq %r13, %rsi
callq 0x751d
movq %r14, %rdi
movq %r15, %rsi
callq 0x29cdb
movq %rax, %r15
testq %rax, %rax
jne 0x75c9
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq *0x38(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop