// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x18(%rbp)
callq 0x4b70
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x24(%rbp), %rsi
callq 0x4d30
movswl -0x24(%rbp), %eax
movq -0x18(%rbp), %rcx
movswl 0x20(%rcx), %ecx
subl %ecx, %eax
movw %ax, -0x26(%rbp)
movswl -0x22(%rbp), %eax
movq -0x18(%rbp), %rcx
movswl 0x22(%rcx), %ecx
subl %ecx, %eax
movw %ax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movb 0x2a(%rax), %al
shrb $0x3, %al
andb $0x1, %al
cmpb $0x0, %al
jne 0x1e5f4
movswl -0x26(%rbp), %eax
cmpl $0xa, %eax
jge 0x1e531
movswl -0x26(%rbp), %eax
cmpl $-0xa, %eax
jg 0x1e5f4
movq -0x18(%rbp), %rax
movb 0x2a(%rax), %cl
andb $-0x3, %cl
orb $0x2, %cl
movb %cl, 0x2a(%rax)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x3ed80
testb $0x1, %al
jne 0x1e555
jmp 0x1e55e
movswl -0x26(%rbp), %eax
cmpl $0x0, %eax
jg 0x1e57b
movq -0x10(%rbp), %rdi
movl $0x4, %esi
callq 0x3ed80
testb $0x1, %al
jne 0x1e572
jmp 0x1e5cc
movswl -0x26(%rbp), %eax
cmpl $0x0, %eax
jge 0x1e5cc
movq -0x18(%rbp), %rax
movb 0x2a(%rax), %al
shrb $0x2, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x1e5a7
movw -0x24(%rbp), %cx
movq -0x18(%rbp), %rax
movw %cx, 0x20(%rax)
movw -0x22(%rbp), %cx
movq -0x18(%rbp), %rax
movw %cx, 0x22(%rax)
movq -0x18(%rbp), %rax
movb 0x2a(%rax), %cl
andb $-0x5, %cl
orb $0x4, %cl
movb %cl, 0x2a(%rax)
movq -0x10(%rbp), %rdi
callq 0x3e970
movq %rax, %rdi
xorl %esi, %esi
callq 0x95a0
jmp 0x1e5f2
movq -0x18(%rbp), %rax
movb 0x2a(%rax), %al
shrb $0x2, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x1e5f0
movq -0x18(%rbp), %rax
movb 0x2a(%rax), %cl
andb $-0x5, %cl
orb $0x0, %cl
movb %cl, 0x2a(%rax)
jmp 0x1e5f2
jmp 0x1e64a
movswl -0x28(%rbp), %eax
cmpl $0xa, %eax
jge 0x1e606
movswl -0x28(%rbp), %eax
cmpl $-0xa, %eax
jg 0x1e638
movq -0x18(%rbp), %rax
movb 0x2a(%rax), %cl
andb $-0x5, %cl
orb $0x0, %cl
movb %cl, 0x2a(%rax)
movq -0x18(%rbp), %rax
movb 0x2a(%rax), %cl
andb $-0x3, %cl
orb $0x2, %cl
movb %cl, 0x2a(%rax)
movq -0x18(%rbp), %rax
movb 0x2a(%rax), %cl
andb $-0x9, %cl
orb $0x8, %cl
movb %cl, 0x2a(%rax)
jmp 0x1e648
movq -0x18(%rbp), %rax
movb 0x2a(%rax), %cl
andb $-0x3, %cl
orb $0x0, %cl
movb %cl, 0x2a(%rax)
jmp 0x1e64a
movq -0x18(%rbp), %rax
movb 0x2a(%rax), %al
shrb $0x2, %al
andb $0x1, %al
cmpb $0x0, %al
je 0x1e800
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq %rdi, -0x50(%rbp)
callq 0x7350
movq -0x50(%rbp), %rdi
movw %ax, %cx
movw %cx, %ax
movzwl -0x24(%rbp), %ecx
addl %ecx, %eax
movq -0x18(%rbp), %rcx
movl 0x20(%rcx), %ecx
subl %ecx, %eax
movswl %ax, %esi
callq 0x80b0
movw -0x24(%rbp), %cx
movq -0x18(%rbp), %rax
movw %cx, 0x20(%rax)
movw -0x22(%rbp), %cx
movq -0x18(%rbp), %rax
movw %cx, 0x22(%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0xa080
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movb 0x2a(%rax), %al
shrb $0x5, %al
andb $0x3, %al
movzbl %al, %ecx
movl %ecx, -0x48(%rbp)
subb $0x2, %al
jb 0x1e6e4
jmp 0x1e6d0
movl -0x48(%rbp), %eax
addl $-0x2, %eax
subl $0x2, %eax
jb 0x1e7b5
jmp 0x1e7fe
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x8310
movw %ax, -0x32(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xa080
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movswl 0x20(%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0x20(%rcx), %ecx
subl %ecx, %eax
movswl -0x32(%rbp), %ecx
movq -0x30(%rbp), %rdx
movswl 0x1e(%rdx), %edx
addl %edx, %ecx
imull %ecx, %eax
movl %eax, -0x54(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8310
movw %ax, %cx
movl -0x54(%rbp), %eax
movswl %cx, %ecx
cltd
idivl %ecx
movw %ax, -0x34(%rbp)
movq -0x18(%rbp), %rax
movw 0x24(%rax), %ax
movw %ax, -0x42(%rbp)
movq -0x8(%rbp), %rdi
callq 0x7180
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x1e777
movq -0x18(%rbp), %rax
movzwl 0x26(%rax), %eax
movzwl -0x42(%rbp), %ecx
addl $0x1, %ecx
subl %ecx, %eax
movw %ax, -0x42(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movswl -0x32(%rbp), %eax
movzwl -0x42(%rbp), %ecx
imull %ecx, %eax
movq -0x30(%rbp), %rcx
movswl 0x1e(%rcx), %ecx
movzwl -0x42(%rbp), %edx
imull %edx, %ecx
addl %ecx, %eax
movq -0x40(%rbp), %rcx
movswl 0x1a(%rcx), %ecx
addl %ecx, %eax
movswl -0x34(%rbp), %ecx
subl %ecx, %eax
movswl %ax, %esi
callq 0x80b0
jmp 0x1e7fe
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x8350
movw %ax, -0x32(%rbp)
movq -0x30(%rbp), %rax
movswl 0x16(%rax), %eax
movq -0x18(%rbp), %rcx
movzwl 0x24(%rcx), %ecx
movswl -0x32(%rbp), %edx
movq -0x30(%rbp), %rsi
movswl 0x1e(%rsi), %esi
addl %esi, %edx
imull %edx, %ecx
addl %ecx, %eax
movw %ax, -0x36(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movswl -0x36(%rbp), %esi
callq 0x8120
jmp 0x1e800
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)