// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_core/lv_indev.c
// Function: indev_proc_release
static void indev_proc_release(lv_indev_proc_t * proc)
{
    if(proc->wait_until_release != 0) {
        proc->types.pointer.act_obj  = NULL;
        proc->types.pointer.last_obj = NULL;
        proc->pr_timestamp           = 0;
        proc->longpr_rep_timestamp   = 0;
        proc->wait_until_release     = 0;
    }
    indev_obj_act = proc->types.pointer.act_obj;

    /*Forget the act obj and send a released signal */
    if(indev_obj_act) {
        /* If the object was protected against press lost then it possible that
         * the object is already not pressed but still it is the `act_obj`.
         * In this case send the `LV_SIGNAL_RELEASED/CLICKED` instead of `LV_SIGNAL_PRESS_LOST` if
         * the indev is ON the `types.pointer.act_obj` */
        if(lv_obj_is_protected(indev_obj_act, LV_PROTECT_PRESS_LOST)) {
            indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_RELEASED, indev_act);
            if(indev_reset_check(proc)) return;

            if(proc->types.pointer.drag_in_prog == 0) {
                if(proc->long_pr_sent == 0) {
                    lv_event_send(indev_obj_act, LV_EVENT_SHORT_CLICKED, NULL);
                    if(indev_reset_check(proc)) return;
                }

                lv_event_send(indev_obj_act, LV_EVENT_CLICKED, NULL);
                if(indev_reset_check(proc)) return;
            }

            lv_event_send(indev_obj_act, LV_EVENT_RELEASED, NULL);
            if(indev_reset_check(proc)) return;
        }
        /* The simple case: `act_obj` was not protected against press lost.
         * If it is already not pressed then `indev_proc_press` would set `indev_obj_act = NULL`*/
        else {
            indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_RELEASED, indev_act);
            if(indev_reset_check(proc)) return;

            if(proc->long_pr_sent == 0 && proc->types.pointer.drag_in_prog == 0) {
                lv_event_send(indev_obj_act, LV_EVENT_SHORT_CLICKED, NULL);
                if(indev_reset_check(proc)) return;
            }

            if(proc->types.pointer.drag_in_prog == 0) {
                lv_event_send(indev_obj_act, LV_EVENT_CLICKED, NULL);
                if(indev_reset_check(proc)) return;
            }

            lv_event_send(indev_obj_act, LV_EVENT_RELEASED, NULL);
            if(indev_reset_check(proc)) return;
        }

        if(indev_reset_check(proc)) return;

        /*Handle click focus*/
        bool click_focus_sent = false;
#if LV_USE_GROUP
        lv_group_t * g = lv_obj_get_group(indev_obj_act);

        /*Check, if the parent is in a group and focus on it.*/
        /*Respect the click focus protection*/
        if(lv_obj_is_protected(indev_obj_act, LV_PROTECT_CLICK_FOCUS) == false) {
            lv_obj_t * parent = indev_obj_act;

            while(g == NULL) {
                parent = lv_obj_get_parent(parent);
                if(parent == NULL) break;

                /*Ignore is the protected against click focus*/
                if(lv_obj_is_protected(parent, LV_PROTECT_CLICK_FOCUS)) {
                    parent = NULL;
                    break;
                }
                g = lv_obj_get_group(parent);
            }

            /* If a parent is in a group make it focused.
             * `LV_EVENT_FOCUSED/DEFOCUSED` will be sent by `lv_group_focus_obj`*/
            if(g && parent) {
                if(lv_group_get_click_focus(g)) {
                    click_focus_sent = true;
                    lv_group_focus_obj(parent);
                }
            }
        }
#endif

        /* Send defocus to the lastly "active" object and foucus to the new one.
         * DO not sent the events if they was sent by the click focus*/
        if(proc->types.pointer.last_pressed != indev_obj_act && click_focus_sent == false) {
            lv_event_send(proc->types.pointer.last_pressed, LV_EVENT_DEFOCUSED, NULL);
            if(indev_reset_check(proc)) return;

            lv_event_send(proc->types.pointer.act_obj, LV_EVENT_FOCUSED, NULL);
            if(indev_reset_check(proc)) return;

            proc->types.pointer.last_pressed = indev_obj_act;
        }

        if(indev_reset_check(proc)) return;

        /*Send LV_EVENT_DRAG_THROW_BEGIN if required */
        /*If drag parent is active check recursively the drag_parent attribute*/
        lv_obj_t * drag_obj = indev_obj_act;
        while(lv_obj_get_drag_parent(drag_obj) != false && drag_obj != NULL) {
            drag_obj = lv_obj_get_parent(drag_obj);
        }

        if(drag_obj) {
            if(lv_obj_get_drag_throw(drag_obj) && proc->types.pointer.drag_in_prog) {
                lv_event_send(drag_obj, LV_EVENT_DRAG_THROW_BEGIN, NULL);
                if(indev_reset_check(proc)) return;
            }
        }

        proc->types.pointer.act_obj = NULL;
        proc->pr_timestamp          = 0;
        proc->longpr_rep_timestamp  = 0;
    }

    /*The reset can be set in the signal function.
     * In case of reset query ignore the remaining parts.*/
    if(proc->types.pointer.last_obj != NULL && proc->reset_query == 0) {
        indev_drag_throw(proc);
        if(indev_reset_check(proc)) return;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb 0x48(%rdi), %al
testb $0x8, %al
je 0x3e8c
movq $0x0, 0x40(%rbx)
andb $-0x9, %al
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movb %al, 0x48(%rbx)
movq 0x20(%rbx), %rdi
movq %rdi, 0x5c009(%rip)     # 0x5fea0
testq %rdi, %rdi
je 0x40dc
movl $0x10, %esi
callq 0x6a3c
movl %eax, %ebp
movq 0x5bfed(%rip), %rdi     # 0x5fea0
movq 0x5bfde(%rip), %rdx     # 0x5fe98
movl $0xb, %esi
callq *0x30(%rdi)
movb 0x48(%rbx), %al
testb %bpl, %bpl
je 0x3efa
testb $0x2, %al
jne 0x40f7
testb $0x2, 0x38(%rbx)
jne 0x3f4c
testb $0x1, %al
jne 0x3f2f
movq 0x5bfbd(%rip), %rdi     # 0x5fea0
movl $0x3, %esi
xorl %edx, %edx
callq 0x4fea
testb $0x2, 0x48(%rbx)
je 0x3f2f
jmp 0x40f7
testb $0x2, %al
jne 0x40f7
testb $0x1, %al
jne 0x3f29
testb $0x2, 0x38(%rbx)
jne 0x3f29
movq 0x5bf8d(%rip), %rdi     # 0x5fea0
movl $0x3, %esi
xorl %edx, %edx
callq 0x4fea
testb $0x2, 0x48(%rbx)
jne 0x40f7
testb $0x2, 0x38(%rbx)
jne 0x3f4c
movq 0x5bf6a(%rip), %rdi     # 0x5fea0
movl $0x6, %esi
xorl %edx, %edx
callq 0x4fea
testb $0x2, 0x48(%rbx)
jne 0x40f7
movq 0x5bf4d(%rip), %rdi     # 0x5fea0
movl $0x7, %esi
xorl %edx, %edx
callq 0x4fea
testb $0x2, 0x48(%rbx)
jne 0x40f7
testb $0x2, 0x48(%rbx)
jne 0x40f7
movq 0x5bf26(%rip), %rdi     # 0x5fea0
callq 0x4ea3
movq %rax, %r14
movq 0x5bf17(%rip), %rdi     # 0x5fea0
movl $0x20, %esi
callq 0x6a3c
testb %al, %al
jne 0x4012
movq 0x5bf02(%rip), %r15     # 0x5fea0
testq %r14, %r14
jne 0x3fe7
movq %r15, %rdi
callq 0x4abf
testq %rax, %rax
je 0x3fe4
movq %rax, %r15
movq %r15, %rdi
movl $0x20, %esi
callq 0x6a3c
testb %al, %al
jne 0x3fe4
movq %r15, %rdi
callq 0x4ea3
movq %rax, %r14
testq %rax, %rax
jne 0x3fe7
movq %r15, %rdi
callq 0x4abf
movq %rax, %r15
testq %rax, %rax
jne 0x3fb3
xorl %r15d, %r15d
testq %r14, %r14
setne %al
testq %r15, %r15
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x4012
movq %r14, %rdi
callq 0x2b3e
testb %al, %al
je 0x4012
movq %r15, %rdi
callq 0x26b5
movb $0x1, %al
jmp 0x4014
xorl %eax, %eax
testb %al, %al
jne 0x4060
movq 0x30(%rbx), %rdi
cmpq 0x5be7d(%rip), %rdi     # 0x5fea0
je 0x4060
movl $0xd, %esi
xorl %edx, %edx
callq 0x4fea
testb $0x2, 0x48(%rbx)
jne 0x40f7
movq 0x20(%rbx), %rdi
movl $0xc, %esi
xorl %edx, %edx
callq 0x4fea
testb $0x2, 0x48(%rbx)
jne 0x40f7
movq 0x5be44(%rip), %rax     # 0x5fea0
movq %rax, 0x30(%rbx)
testb $0x2, 0x48(%rbx)
jne 0x40f7
movq 0x5be2f(%rip), %r14     # 0x5fea0
movq %r14, %rdi
callq 0x6975
testq %r14, %r14
setne %cl
andb %cl, %al
cmpb $0x1, %al
jne 0x40a7
movq %r14, %rdi
callq 0x4abf
movq %rax, %r14
movq %rax, %rdi
callq 0x6975
testq %r14, %r14
setne %cl
testb %al, %al
je 0x40a7
testq %r14, %r14
jne 0x4085
testb %cl, %cl
je 0x40d2
movq %r14, %rdi
callq 0x694d
testb %al, %al
je 0x40d2
testb $0x2, 0x38(%rbx)
je 0x40d2
movq %r14, %rdi
movl $0xa, %esi
xorl %edx, %edx
callq 0x4fea
testb $0x2, 0x48(%rbx)
jne 0x40f7
xorl %eax, %eax
movq %rax, 0x20(%rbx)
movq %rax, 0x40(%rbx)
cmpq $0x0, 0x28(%rbx)
je 0x4102
testb $0x2, 0x48(%rbx)
jne 0x4102
movq %rbx, %rdi
callq 0x41b9
testb $0x2, 0x48(%rbx)
je 0x4102
movq $0x0, 0x5bd9e(%rip) # 0x5fea0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq