// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_tabview.c
// Function: tabpage_pressing_handler
static void tabpage_pressing_handler(lv_obj_t * tabview, lv_obj_t * tabpage)
{
    lv_tabview_ext_t * ext = lv_obj_get_ext_attr(tabview);
    lv_indev_t * indev     = lv_indev_get_act();
    lv_point_t point_act;
    lv_indev_get_point(indev, &point_act);
    lv_coord_t x_diff = point_act.x - ext->point_last.x;
    lv_coord_t y_diff = point_act.y - ext->point_last.y;

    if(!ext->scroll_ver && (x_diff >= LV_INDEV_DEF_DRAG_LIMIT || x_diff <= -LV_INDEV_DEF_DRAG_LIMIT)) {
        ext->draging = 1;
        /*Check if the page is on the edge */
        if((lv_page_on_edge(tabpage, LV_PAGE_EDGE_LEFT) && x_diff > 0) ||
           (lv_page_on_edge(tabpage, LV_PAGE_EDGE_RIGHT) && x_diff < 0)) {
            if(ext->drag_hor == 0) {
                ext->point_last.x = point_act.x;
                ext->point_last.y = point_act.y;
            }
            ext->drag_hor = 1;
            lv_obj_set_drag(lv_page_get_scrl(tabpage), false);

        } else if(ext->drag_hor == 0) {
            ext->drag_hor = 0;
        }
    } else if(y_diff >= LV_INDEV_DEF_DRAG_LIMIT || y_diff <= -LV_INDEV_DEF_DRAG_LIMIT) {
        ext->drag_hor   = 0;
        ext->draging    = 1;
        ext->scroll_ver = 1;
    } else
        ext->draging = 0;

    if(ext->drag_hor) {
        lv_obj_set_x(ext->content, lv_obj_get_x(ext->content) + point_act.x - ext->point_last.x);
        ext->point_last.x = point_act.x;
        ext->point_last.y = point_act.y;

        /*Move the indicator*/
        const lv_style_t * tabs_style = lv_obj_get_style(ext->btns);
        lv_coord_t indic_size;
        lv_coord_t p;
        lv_coord_t indic_y;
        const lv_style_t * indic_style;

        switch(ext->btns_pos) {
            case LV_TABVIEW_BTNS_POS_TOP:
            case LV_TABVIEW_BTNS_POS_BOTTOM:
                indic_size  = lv_obj_get_width(ext->indic);
                indic_style = lv_obj_get_style(ext->indic);
                p = ((tabpage->coords.x1 - tabview->coords.x1) * (indic_size + tabs_style->body.padding.inner)) /
                    lv_obj_get_width(tabview);

                uint16_t id = ext->tab_cur;
                if(lv_obj_get_base_dir(tabview) == LV_BIDI_DIR_RTL) {
                    id = (ext->tab_cnt - (id + 1));
                }
                lv_obj_set_x(ext->indic, indic_size * id + tabs_style->body.padding.inner * id +
                                             indic_style->body.padding.left - p);
                break;
            case LV_TABVIEW_BTNS_POS_LEFT:
            case LV_TABVIEW_BTNS_POS_RIGHT:
                indic_size = lv_obj_get_height(ext->indic);
                indic_y = tabs_style->body.padding.top + ext->tab_cur * (indic_size + tabs_style->body.padding.inner);
                lv_obj_set_y(ext->indic, indic_y);
                break;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %r14
callq 0x6747
movq %rax, %rbx
callq 0x35b3
leaq 0xc(%rsp), %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x3661
movzwl 0x2(%r12), %ecx
movzwl 0x22(%rbx), %edx
movb 0x2a(%rbx), %al
testb $0x8, %al
jne 0x11532
movzwl 0xc(%rsp), %r12d
subw 0x20(%rbx), %r12w
leal -0xa(%r12), %esi
cmpw $-0x14, %si
ja 0x11532
orb $0x2, %al
movb %al, 0x2a(%rbx)
pushq $0x1
popq %rsi
movq %r15, %rdi
callq 0x24830
testw %r12w, %r12w
jle 0x114f6
testb %al, %al
jne 0x1150b
pushq $0x4
popq %rsi
movq %r15, %rdi
callq 0x24830
testw %r12w, %r12w
jns 0x11548
testb %al, %al
je 0x11548
movb 0x2a(%rbx), %al
testb $0x4, %al
jne 0x11519
movl 0xc(%rsp), %ecx
movl %ecx, 0x20(%rbx)
orb $0x4, %al
movb %al, 0x2a(%rbx)
movq %r15, %rdi
callq 0x245d9
movq %rax, %rdi
xorl %esi, %esi
callq 0x5ce4
jmp 0x11548
subl %edx, %ecx
addl $-0xa, %ecx
cmpw $-0x14, %cx
ja 0x11543
andb $-0xf, %al
orb $0xa, %al
jmp 0x11545
andb $-0x3, %al
movb %al, 0x2a(%rbx)
testb $0x4, 0x2a(%rbx)
je 0x11638
movq 0x10(%rbx), %r12
movq %r12, %rdi
callq 0x48ca
addw 0xc(%rsp), %ax
subw 0x20(%rbx), %ax
movswl %ax, %esi
movq %r12, %rdi
callq 0x5192
movl 0xc(%rsp), %eax
movl %eax, 0x20(%rbx)
movq (%rbx), %rdi
callq 0x6316
movq %rax, %r12
testb $0x40, 0x2a(%rbx)
movq 0x8(%rbx), %rdi
jne 0x11616
callq 0x5308
movl %eax, %ebp
movq 0x8(%rbx), %rdi
callq 0x6316
movq %rax, 0x10(%rsp)
movswl 0x20(%r15), %eax
movswl 0x20(%r14), %ecx
subl %ecx, %eax
movswl %bp, %r15d
movswl 0x1e(%r12), %ebp
addl %r15d, %ebp
imull %eax, %ebp
movq %r14, %rdi
callq 0x5308
movswl %ax, %ecx
movl %ebp, %eax
cltd
idivl %ecx
movl %eax, %ebp
movzwl 0x24(%rbx), %r13d
movq %r14, %rdi
callq 0x47b9
cmpb $0x1, %al
jne 0x115ee
notl %r13d
addw 0x26(%rbx), %r13w
movq 0x8(%rbx), %rdi
movzwl 0x1e(%r12), %eax
addl %r15d, %eax
imull %r13d, %eax
movq 0x10(%rsp), %rcx
movzwl 0x1a(%rcx), %ecx
subl %ebp, %ecx
addl %eax, %ecx
movswl %cx, %esi
callq 0x5192
jmp 0x11638
callq 0x5332
addw 0x1e(%r12), %ax
imulw 0x24(%rbx), %ax
addw 0x16(%r12), %ax
movq 0x8(%rbx), %rdi
movswl %ax, %esi
callq 0x51d0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq