// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_core/lv_obj.c
// Function: lv_obj_del
lv_res_t lv_obj_del(lv_obj_t * obj)
{
    LV_ASSERT_OBJ(obj, LV_OBJX_NAME);
    lv_obj_invalidate(obj);

    /*Delete from the group*/
#if LV_USE_GROUP
    lv_group_t * group = lv_obj_get_group(obj);
    if(group) lv_group_remove_obj(obj);
#endif

        /*Remove the animations from this object*/
#if LV_USE_ANIMATION
    lv_anim_del(obj, NULL);
#endif

    /*Recursively delete the children*/
    lv_obj_t * i;
    lv_obj_t * i_next;
    i = lv_ll_get_head(&(obj->child_ll));
    while(i != NULL) {
        /*Get the next object before delete this*/
        i_next = lv_ll_get_next(&(obj->child_ll), i);

        /*Call the recursive del to the child too*/
        delete_children(i);

        /*Set i to the next node*/
        i = i_next;
    }

    /*Let the user free the resources used in `LV_EVENT_DELETE`*/
    lv_event_send(obj, LV_EVENT_DELETE, NULL);

    lv_event_mark_deleted(obj);

    /* Reset all input devices if the object to delete is used*/
    lv_indev_t * indev = lv_indev_get_next(NULL);
    while(indev) {
        if(indev->proc.types.pointer.act_obj == obj || indev->proc.types.pointer.last_obj == obj) {
            lv_indev_reset(indev);
        }
        if(indev->proc.types.pointer.last_pressed == obj) {
            indev->proc.types.pointer.last_pressed = NULL;
        }

#if LV_USE_GROUP
        if(indev->group == group && obj == lv_indev_get_obj_act()) {
            lv_indev_reset(indev);
        }
#endif
        indev = lv_indev_get_next(indev);
    }

    /* All children deleted.
     * Now clean up the object specific data*/
    obj->signal_cb(obj, LV_SIGNAL_CLEANUP, NULL);

    /*Remove the object from parent's children list*/
    lv_obj_t * par = lv_obj_get_parent(obj);
    if(par == NULL) { /*It is a screen*/
        lv_disp_t * d = lv_obj_get_disp(obj);
        lv_ll_rem(&d->scr_ll, obj);
    } else {
        lv_ll_rem(&(par->child_ll), obj);
    }

    /*Delete the base objects*/
    if(obj->ext_attr != NULL) lv_mem_free(obj->ext_attr);
    lv_mem_free(obj); /*Free the object itself*/

    /*Send a signal to the parent to notify it about the child delete*/
    if(par != NULL) {
        par->signal_cb(par, LV_SIGNAL_CHILD_CHG, NULL);
    }

    return LV_RES_INV;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x80d4
testb %al, %al
je 0x4dca
movq %rbx, %rdi
callq 0x4c36
movq %rbx, %rdi
callq 0x4ea3
movq %rax, %r14
testq %rax, %rax
je 0x4d64
movq %rbx, %rdi
callq 0x25a0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x295b1
leaq 0x8(%rbx), %r15
movq %r15, %rdi
callq 0x29cce
testq %rax, %rax
je 0x4da0
movq %rax, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x29dfb
movq %rax, %r13
movq %r12, %rdi
callq 0x4ec7
movq %r13, %r12
testq %r13, %r13
jne 0x4d82
movq %rbx, %rdi
movl $0x13, %esi
xorl %edx, %edx
callq 0x4fea
movq 0x5b0fa(%rip), %rax     # 0x5feb0
testq %rax, %rax
je 0x4ddb
cmpq %rbx, (%rax)
jne 0x4dc4
movb $0x1, 0x8(%rax)
movq 0x10(%rax), %rax
jmp 0x4db6
leaq 0x3a363(%rip), %rdi     # 0x3f134
movq %rbx, %rsi
callq 0x829e
jmp 0x4dd9
xorl %edi, %edi
callq 0x87d5
testq %rax, %rax
je 0x4e37
movq %rax, %r15
cmpq %rbx, 0x50(%r15)
je 0x4df6
cmpq %rbx, 0x58(%r15)
jne 0x4dfe
movq %r15, %rdi
callq 0x2eff
cmpq %rbx, 0x60(%r15)
jne 0x4e0c
movq $0x0, 0x60(%r15)
cmpq %r14, 0x88(%r15)
jne 0x4e27
callq 0x38b9
cmpq %rbx, %rax
jne 0x4e27
movq %r15, %rdi
callq 0x2eff
movq %r15, %rdi
callq 0x87d5
movq %rax, %r15
testq %rax, %rax
jne 0x4dea
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq *0x30(%rbx)
movq %rbx, %rdi
callq 0x4abf
movq %rax, %r14
testq %rax, %rax
je 0x4e57
leaq 0x8(%r14), %rdi
jmp 0x4e66
movq %rbx, %rdi
callq 0x5033
movq %rax, %rdi
addq $0x48, %rdi
movq %rbx, %rsi
callq 0x29d38
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0x4e7c
callq 0x29984
movq %rbx, %rdi
callq 0x29984
testq %r14, %r14
je 0x4e97
movq %r14, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq *0x30(%r14)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq