// File: /workspace/github_c_makefile_star2_O2/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 0x47bc
movq %rax, %rbx
cmpl $0x7, %ebp
je 0x11e65
cmpl $0x2, %ebp
je 0x11e65
testl %ebp, %ebp
jne 0x11fd6
movq %rbx, %rdi
callq 0x6747
andb $-0x31, 0x60(%rax)
movq %rbx, %rdi
callq 0x6747
movq 0x50(%rax), %rcx
testq %rcx, %rcx
je 0x11fd6
movb 0x60(%rax), %dl
andb $-0x10, %dl
movb %dl, 0x60(%rax)
movzwl 0x58(%rax), %esi
xorl %edi, %edi
cmpq %rdi, %rsi
je 0x11fd6
movzwl (%rcx,%rdi,4), %r9d
movzwl 0x5c(%rax), %r8d
cmpw %r8w, %r9w
jne 0x11df0
movswl 0x2(%rcx,%rdi,4), %r10d
movswl 0x5e(%rax), %r11d
decl %r11d
cmpl %r10d, %r11d
jne 0x11df0
orb $0x1, %dl
movb %dl, 0x60(%rax)
movzwl (%rcx,%rdi,4), %r9d
cmpw %r8w, %r9w
jne 0x11e19
movswl 0x2(%rcx,%rdi,4), %r9d
movswl 0x5e(%rax), %r10d
incl %r10d
cmpl %r9d, %r10d
jne 0x11e16
orb $0x2, %dl
movb %dl, 0x60(%rax)
movzwl (%rcx,%rdi,4), %r9d
jmp 0x11e19
movl %r8d, %r9d
movswl %r8w, %r8d
movswl %r9w, %r9d
leal -0x1(%r8), %r10d
cmpl %r9d, %r10d
jne 0x11e42
movzwl 0x2(%rcx,%rdi,4), %r10d
cmpw 0x5e(%rax), %r10w
jne 0x11e42
orb $0x4, %dl
movb %dl, 0x60(%rax)
movswl (%rcx,%rdi,4), %r9d
incl %r8d
cmpl %r9d, %r8d
jne 0x11e5d
movzwl 0x2(%rcx,%rdi,4), %r8d
cmpw 0x5e(%rax), %r8w
jne 0x11e5d
orb $0x8, %dl
movb %dl, 0x60(%rax)
incq %rdi
jmp 0x11db9
callq 0x35b3
movq %rax, %r14
movq %rbx, %rdi
callq 0x6747
movq %rax, %r15
movq %r14, %rdi
callq 0x3691
testb %al, %al
je 0x11e90
testb $0x30, 0x60(%r15)
je 0x11e90
andb $-0x3, 0x68(%r14)
movq %rbx, %rdi
callq 0x6747
movq %rax, 0x8(%rsp)
callq 0x35b3
movq %rax, %r12
leaq 0x14(%rsp), %rsi
movq %rax, %rdi
callq 0x3661
movq %rbx, %rdi
callq 0x245d9
movq %rax, %r15
movzwl 0x20(%rax), %r13d
movq %rbx, %rdi
callq 0x5308
movw $0x2, %r14w
cwtd
idivw %r14w
movl %eax, %ebp
subw %r13w, %bp
movzwl 0x22(%r15), %r13d
movq %rbx, %rdi
callq 0x5332
cwtd
idivw %r14w
movq 0x8(%rsp), %r14
movl %eax, %r15d
subw %r13w, %r15w
movb 0x60(%r14), %al
testb $0x10, %al
jne 0x11f35
testb $0x20, %al
je 0x11f6d
movq %rsp, %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x36ac
xorl %ecx, %ecx
movzwl 0x2(%r13), %eax
pushq $0x64
popq %rsi
testw %ax, %ax
je 0x11f6a
movswl %ax, %edx
addl %eax, %ecx
imull $0x50, %edx, %eax
cltd
idivl %esi
movw %ax, 0x2(%rsp)
jmp 0x11f1e
leaq 0x4(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x36ac
xorl %ecx, %ecx
movzwl (%r13), %eax
pushq $0x64
popq %rsi
testw %ax, %ax
je 0x11f66
movswl %ax, %edx
addl %eax, %ecx
imull $0x50, %edx, %eax
cltd
idivl %esi
movw %ax, 0x4(%rsp)
jmp 0x11f4f
subl %ecx, %ebp
jmp 0x11f6d
subl %ecx, %r15d
movswl %bp, %ebp
movq %rbx, %rdi
callq 0x5308
movswl %ax, %ecx
movl %ebp, %eax
cltd
idivl %ecx
movl %eax, %ebp
movswl %r15w, %r15d
movq %rbx, %rdi
callq 0x5332
movswl %ax, %ecx
movl %r15d, %eax
cltd
idivl %ecx
movl 0x5c(%r14), %edx
subl %edx, %ebp
movzwl 0x5e(%r14), %esi
subl %esi, %eax
testw %bp, %bp
movl $0xffff, %edi           # imm = 0xFFFF
cmovsl %edi, %ebp
testw %bp, %bp
pushq $0x1
popq %rcx
cmovgl %ecx, %ebp
testw %ax, %ax
cmovsl %edi, %eax
testw %ax, %ax
cmovgl %ecx, %eax
addl %edx, %ebp
addl %esi, %eax
movswl %bp, %esi
movswl %ax, %edx
movq %rbx, %rdi
callq 0x12057
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq