// File: /workspace/github_c_makefile_star2_O3/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 0x4ab5
movq %rax, %rbx
cmpl $0x7, %ebp
je 0x12c15
cmpl $0x2, %ebp
je 0x12c15
testl %ebp, %ebp
jne 0x12dca
movq %rbx, %rdi
callq 0x6af7
andb $-0x31, 0x60(%rax)
movq %rbx, %rdi
callq 0x6af7
movq 0x50(%rax), %rcx
testq %rcx, %rcx
je 0x12dca
movb 0x60(%rax), %dl
andb $-0x10, %dl
movb %dl, 0x60(%rax)
movzwl 0x58(%rax), %esi
testq %rsi, %rsi
je 0x12dca
movswl 0x5c(%rax), %edi
leal -0x1(%rdi), %r8d
movl %edi, %r9d
incl %r9d
xorl %r10d, %r10d
movzwl (%rcx,%r10,4), %r11d
cmpw %di, %r11w
jne 0x12ba4
movswl 0x2(%rcx,%r10,4), %r11d
movswl 0x5e(%rax), %ebx
leal -0x1(%rbx), %ebp
cmpl %r11d, %ebp
jne 0x12bb4
orb $0x1, %dl
movb %dl, 0x60(%rax)
movzwl (%rcx,%r10,4), %r11d
cmpw %di, %r11w
jne 0x12bcb
movswl 0x2(%rcx,%r10,4), %r11d
movswl 0x5e(%rax), %ebx
incl %ebx
cmpl %r11d, %ebx
jne 0x12bc8
orb $0x2, %dl
movb %dl, 0x60(%rax)
movzwl (%rcx,%r10,4), %r11d
jmp 0x12bcb
movl %edi, %r11d
movswl %r11w, %r11d
cmpl %r11d, %r8d
jne 0x12bec
movzwl 0x2(%rcx,%r10,4), %r11d
cmpw 0x5e(%rax), %r11w
jne 0x12c04
orb $0x4, %dl
movb %dl, 0x60(%rax)
movswl (%rcx,%r10,4), %r11d
cmpl %r11d, %r9d
jne 0x12c04
movzwl 0x2(%rcx,%r10,4), %r11d
cmpw 0x5e(%rax), %r11w
jne 0x12c04
orb $0x8, %dl
movb %dl, 0x60(%rax)
incq %r10
cmpq %r10, %rsi
jne 0x12b7c
jmp 0x12dca
callq 0x378a
movq %rax, %r14
movq %rbx, %rdi
callq 0x6af7
movq %rax, %r15
movq %r14, %rdi
callq 0x3869
testb %al, %al
je 0x12c40
testb $0x30, 0x60(%r15)
je 0x12c40
andb $-0x3, 0x68(%r14)
movq %rbx, %rdi
callq 0x6af7
movq %rax, %r14
callq 0x378a
movq %rax, %r15
leaq 0x14(%rsp), %rsi
movq %rax, %rdi
callq 0x3838
movq %rbx, %rdi
callq 0x2695e
movq %rax, %r12
movzwl 0x20(%rax), %r13d
movq %rbx, %rdi
callq 0x566d
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 0x5697
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 0x12d0c
testb $0x20, %al
je 0x12d5a
leaq 0xc(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x3884
movzwl 0x2(%r12), %ecx
xorl %eax, %eax
testw %cx, %cx
je 0x12d07
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 0x12cd7
subl %eax, %r13d
jmp 0x12d5a
leaq 0x10(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x3884
movzwl (%r12), %ecx
xorl %eax, %eax
testw %cx, %cx
je 0x12d58
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 0x12d28
subl %eax, %ebp
movswl %bp, %ebp
movq %rbx, %rdi
callq 0x566d
movswl %ax, %ecx
movl %ebp, %eax
cltd
idivl %ecx
movl %eax, %ebp
movswl %r13w, %r15d
movq %rbx, %rdi
callq 0x5697
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 0x12e4d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq