// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_tileview.c
// Function: tileview_scrl_event_cb
static void tileview_scrl_event_cb(lv_obj_t * scrl, lv_event_t event)
{
    lv_obj_t * tileview = lv_obj_get_parent(scrl);

    /*Initialize some variables on PRESS*/
    if(event == LV_EVENT_PRESSED) {
        lv_tileview_ext_t * ext = lv_obj_get_ext_attr(tileview);
        ext->drag_hor           = 0;
        ext->drag_ver           = 0;
        set_valid_drag_dirs(tileview);
    }
    /*Animate the tabview to the correct location on RELEASE*/
    else if(event == LV_EVENT_PRESS_LOST || event == LV_EVENT_RELEASED) {
        /* If the element was dragged and it moved the tileview finish the drag manually to
         * let the tileview to finish the move.*/
        lv_indev_t * indev      = lv_indev_get_act();
        lv_tileview_ext_t * ext = lv_obj_get_ext_attr(tileview);
        if(lv_indev_is_dragging(indev) && (ext->drag_hor || ext->drag_ver)) {
            indev->proc.types.pointer.drag_in_prog = 0;
        }

        drag_end_handler(tileview);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
callq 0x4abf
movq %rax, %rbx
cmpl $0x7, %ebp
je 0x12bd8
cmpl $0x2, %ebp
je 0x12bd8
testl %ebp, %ebp
jne 0x12d97
movq %rbx, %rdi
callq 0x6ad8
andb $-0x31, 0x60(%rax)
movq %rbx, %rdi
callq 0x6ad8
movq 0x50(%rax), %rcx
testq %rcx, %rcx
je 0x12d97
andb $-0x10, 0x60(%rax)
cmpw $0x0, 0x58(%rax)
je 0x12d97
xorl %edx, %edx
movzwl (%rcx,%rdx,4), %esi
cmpw 0x5c(%rax), %si
jne 0x12b70
movswl 0x2(%rcx,%rdx,4), %esi
movswl 0x5e(%rax), %edi
decl %edi
cmpl %esi, %edi
jne 0x12b70
orb $0x1, 0x60(%rax)
movzwl (%rcx,%rdx,4), %esi
cmpw 0x5c(%rax), %si
jne 0x12b8d
movswl 0x2(%rcx,%rdx,4), %esi
movswl 0x5e(%rax), %edi
incl %edi
cmpl %esi, %edi
jne 0x12b8d
orb $0x2, 0x60(%rax)
movswl (%rcx,%rdx,4), %esi
movswl 0x5c(%rax), %edi
decl %edi
cmpl %esi, %edi
jne 0x12baa
movzwl 0x2(%rcx,%rdx,4), %esi
cmpw 0x5e(%rax), %si
jne 0x12baa
orb $0x4, 0x60(%rax)
movswl (%rcx,%rdx,4), %esi
movswl 0x5c(%rax), %edi
incl %edi
cmpl %esi, %edi
jne 0x12bc7
movzwl 0x2(%rcx,%rdx,4), %esi
cmpw 0x5e(%rax), %si
jne 0x12bc7
orb $0x8, 0x60(%rax)
incq %rdx
movzwl 0x58(%rax), %esi
cmpq %rsi, %rdx
jb 0x12b53
jmp 0x12d97
callq 0x3784
movq %rax, %r14
movq %rbx, %rdi
callq 0x6ad8
movq %rax, %r15
movq %r14, %rdi
callq 0x3863
testb %al, %al
je 0x12c03
testb $0x30, 0x60(%r15)
je 0x12c03
andb $-0x3, 0x68(%r14)
movq %rbx, %rdi
callq 0x6ad8
movq %rax, %r14
callq 0x3784
movq %rax, %r15
leaq 0x14(%rsp), %rsi
movq %rax, %rdi
callq 0x3832
movq %rbx, %rdi
callq 0x26288
movq %rax, %r12
movzwl 0x20(%rax), %r13d
movq %rbx, %rdi
callq 0x5651
movzwl %ax, %ecx
shrl $0xf, %ecx
addl %eax, %ecx
movswl %cx, %ebp
shrl %ebp
subw %r13w, %bp
movzwl 0x22(%r12), %r12d
movq %rbx, %rdi
callq 0x567b
movzwl %ax, %ecx
shrl $0xf, %ecx
addl %eax, %ecx
movswl %cx, %r13d
shrl %r13d
subw %r12w, %r13w
movb 0x60(%r14), %al
testb $0x10, %al
jne 0x12cd4
testb $0x20, %al
je 0x12d27
leaq 0xc(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x387e
movzwl 0x2(%r12), %ecx
xorl %eax, %eax
testw %cx, %cx
je 0x12ccf
movswl %cx, %edx
addl %ecx, %eax
shll $0x4, %edx
leal (%rdx,%rdx,4), %ecx
movslq %ecx, %rcx
imulq $0x51eb851f, %rcx, %rcx # imm = 0x51EB851F
movq %rcx, %rsi
shrq $0x3f, %rsi
shrq $0x25, %rcx
addl %esi, %ecx
leal (%rdx,%rdx,4), %edx
addl $0x63, %edx
cmpl $0xc6, %edx
ja 0x12c9a
movw %cx, 0xe(%rsp)
subl %eax, %r13d
jmp 0x12d27
leaq 0x10(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x387e
movzwl (%r12), %ecx
xorl %eax, %eax
testw %cx, %cx
je 0x12d25
movswl %cx, %edx
addl %ecx, %eax
shll $0x4, %edx
leal (%rdx,%rdx,4), %ecx
movslq %ecx, %rcx
imulq $0x51eb851f, %rcx, %rcx # imm = 0x51EB851F
movq %rcx, %rsi
shrq $0x3f, %rsi
shrq $0x25, %rcx
addl %esi, %ecx
leal (%rdx,%rdx,4), %edx
addl $0x63, %edx
cmpl $0xc6, %edx
ja 0x12cf0
movw %cx, 0x10(%rsp)
subl %eax, %ebp
movswl %bp, %ebp
movq %rbx, %rdi
callq 0x5651
movswl %ax, %ecx
movl %ebp, %eax
cltd
idivl %ecx
movl %eax, %ebp
movswl %r13w, %r15d
movq %rbx, %rdi
callq 0x567b
movswl %ax, %ecx
movl %r15d, %eax
cltd
idivl %ecx
movl 0x5c(%r14), %ecx
subl %ecx, %ebp
movzwl 0x5e(%r14), %edx
subl %edx, %eax
testw %bp, %bp
movl $0xffff, %esi           # imm = 0xFFFF
cmovsl %esi, %ebp
testw %bp, %bp
movl $0x1, %edi
cmovgl %edi, %ebp
testw %ax, %ax
cmovsl %esi, %eax
testw %ax, %ax
cmovgl %edi, %eax
addl %ecx, %ebp
addl %edx, %eax
movswl %bp, %esi
movswl %ax, %edx
movq %rbx, %rdi
movl $0x1, %ecx
callq 0x12e1a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq