// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_tabview.c
// Function: lv_tabview_set_tab_act
void lv_tabview_set_tab_act(lv_obj_t * tabview, uint16_t id, lv_anim_enable_t anim)
{
    LV_ASSERT_OBJ(tabview, LV_OBJX_NAME);

#if LV_USE_ANIMATION == 0
    anim = LV_ANIM_OFF;
#endif
    lv_tabview_ext_t * ext = lv_obj_get_ext_attr(tabview);

    const lv_style_t * style = lv_obj_get_style(ext->content);

    if(id >= ext->tab_cnt) id = ext->tab_cnt - 1;

    lv_btnm_clear_btn_ctrl(ext->btns, ext->tab_cur, LV_BTNM_CTRL_TGL_STATE);

    ext->tab_cur = id;

    if(lv_obj_get_base_dir(tabview) == LV_BIDI_DIR_RTL) {
        id = (ext->tab_cnt - (id + 1));
    }

    lv_coord_t cont_x;

    switch(ext->btns_pos) {
        case LV_TABVIEW_BTNS_POS_TOP:
        case LV_TABVIEW_BTNS_POS_BOTTOM:
            cont_x = -(lv_obj_get_width(tabview) * id + style->body.padding.inner * id + style->body.padding.left);
            break;
        case LV_TABVIEW_BTNS_POS_LEFT:
            cont_x = -((lv_obj_get_width(tabview) - lv_obj_get_width(ext->btns)) * id + style->body.padding.inner * id +
                       style->body.padding.left) +
                     lv_obj_get_width(ext->btns);
            break;
        case LV_TABVIEW_BTNS_POS_RIGHT:
            cont_x = -((lv_obj_get_width(tabview) - lv_obj_get_width(ext->btns)) * id + style->body.padding.inner * id +
                       style->body.padding.left);
            break;
    }

    if(anim == LV_ANIM_OFF || lv_tabview_get_anim_time(tabview) == 0) {
        lv_obj_set_x(ext->content, cont_x);
    }
#if LV_USE_ANIMATION
    else {
        lv_anim_t a;
        a.var            = ext->content;
        a.start          = lv_obj_get_x(ext->content);
        a.end            = cont_x;
        a.exec_cb        = (lv_anim_exec_xcb_t)lv_obj_set_x;
        a.path_cb        = lv_anim_path_linear;
        a.ready_cb       = NULL;
        a.act_time       = 0;
        a.time           = ext->anim_time;
        a.playback       = 0;
        a.playback_pause = 0;
        a.repeat         = 0;
        a.repeat_pause   = 0;
        lv_anim_create(&a);
    }
#endif

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

    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_pos  = indic_size * id + tabs_style->body.padding.inner * id + tabs_style->body.padding.left;
            break;
        case LV_TABVIEW_BTNS_POS_LEFT:
        case LV_TABVIEW_BTNS_POS_RIGHT:
            indic_size = lv_obj_get_height(ext->indic);
            const lv_style_t * style_tabs = lv_tabview_get_style(tabview, LV_TABVIEW_STYLE_BTN_BG);
            lv_coord_t max_h = lv_obj_get_height(ext->btns) - style_tabs->body.padding.top - style_tabs->body.padding.bottom;

            if(ext->tab_cnt) indic_pos = (max_h * ext->tab_cur) / ext->tab_cnt;
            else  indic_pos = 0;
            break;
    }

#if LV_USE_ANIMATION
    if(anim == LV_ANIM_OFF || ext->anim_time == 0)
#endif
    {
        switch(ext->btns_pos) {
            case LV_TABVIEW_BTNS_POS_TOP:
            case LV_TABVIEW_BTNS_POS_BOTTOM: lv_obj_set_x(ext->indic, indic_pos); break;
            case LV_TABVIEW_BTNS_POS_LEFT:
            case LV_TABVIEW_BTNS_POS_RIGHT: lv_obj_set_y(ext->indic, indic_pos); break;
        }
    }
#if LV_USE_ANIMATION
    else {
        lv_anim_t a;
        a.var = ext->indic;

        switch(ext->btns_pos) {
            case LV_TABVIEW_BTNS_POS_TOP:
            case LV_TABVIEW_BTNS_POS_BOTTOM:
                a.start   = lv_obj_get_x(ext->indic);
                a.end     = indic_pos;
                a.exec_cb = (lv_anim_exec_xcb_t)lv_obj_set_x;
                break;
            case LV_TABVIEW_BTNS_POS_LEFT:
            case LV_TABVIEW_BTNS_POS_RIGHT:
                a.start   = lv_obj_get_y(ext->indic);
                a.end     = indic_pos;
                a.exec_cb = (lv_anim_exec_xcb_t)lv_obj_set_y;
                break;
        }

        a.path_cb        = lv_anim_path_linear;
        a.ready_cb       = NULL;
        a.act_time       = 0;
        a.time           = ext->anim_time;
        a.playback       = 0;
        a.playback_pause = 0;
        a.repeat         = 0;
        a.repeat_pause   = 0;
        lv_anim_create(&a);
    }
#endif

    lv_btnm_set_btn_ctrl(ext->btns, ext->tab_cur, LV_BTNM_CTRL_TGL_STATE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movb %dl, %al
movw %si, %cx
movq %rdi, -0x8(%rbp)
movw %cx, -0xa(%rbp)
movb %al, -0xb(%rbp)
movq -0x8(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x1da8a
movq -0x8(%rbp), %rsi
leaq 0x4a679(%rip), %rdi     # 0x680fc
callq 0xd410
jmp 0x1da88
movq -0x8(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xa080
movq %rax, -0x20(%rbp)
movzwl -0xa(%rbp), %eax
movq -0x18(%rbp), %rcx
movzwl 0x26(%rcx), %ecx
cmpl %ecx, %eax
jl 0x1dac7
movq -0x18(%rbp), %rax
movzwl 0x26(%rax), %eax
subl $0x1, %eax
movw %ax, -0xa(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movl $0x80, %edx
movzwl 0x24(%rax), %esi
callq 0x378f0
movw -0xa(%rbp), %cx
movq -0x18(%rbp), %rax
movw %cx, 0x24(%rax)
movq -0x8(%rbp), %rdi
callq 0x7180
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x1db12
movq -0x18(%rbp), %rax
movzwl 0x26(%rax), %eax
movzwl -0xa(%rbp), %ecx
addl $0x1, %ecx
subl %ecx, %eax
movw %ax, -0xa(%rbp)
movq -0x18(%rbp), %rax
movb 0x2a(%rax), %al
shrb $0x5, %al
andb $0x3, %al
movzbl %al, %ecx
movl %ecx, -0xbc(%rbp)
subb $0x2, %al
jb 0x1db4e
jmp 0x1db2d
movl -0xbc(%rbp), %eax
subl $0x2, %eax
je 0x1db89
jmp 0x1db3a
movl -0xbc(%rbp), %eax
subl $0x3, %eax
je 0x1dbfa
jmp 0x1dc49
movq -0x8(%rbp), %rdi
callq 0x8310
movswl %ax, %ecx
movzwl -0xa(%rbp), %eax
imull %eax, %ecx
movq -0x20(%rbp), %rax
movswl 0x1e(%rax), %eax
movzwl -0xa(%rbp), %edx
imull %edx, %eax
addl %eax, %ecx
movq -0x20(%rbp), %rax
movswl 0x1a(%rax), %eax
addl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x22(%rbp)
jmp 0x1dc49
movq -0x8(%rbp), %rdi
callq 0x8310
cwtl
movl %eax, -0xc4(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x8310
movl -0xc4(%rbp), %ecx
cwtl
subl %eax, %ecx
movzwl -0xa(%rbp), %eax
imull %eax, %ecx
movq -0x20(%rbp), %rax
movswl 0x1e(%rax), %eax
movzwl -0xa(%rbp), %edx
imull %edx, %eax
addl %eax, %ecx
movq -0x20(%rbp), %rax
movswl 0x1a(%rax), %eax
addl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0xc0(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x8310
movw %ax, %cx
movl -0xc0(%rbp), %eax
movswl %cx, %ecx
addl %ecx, %eax
movw %ax, -0x22(%rbp)
jmp 0x1dc49
movq -0x8(%rbp), %rdi
callq 0x8310
cwtl
movl %eax, -0xc8(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x8310
movl -0xc8(%rbp), %ecx
cwtl
subl %eax, %ecx
movzwl -0xa(%rbp), %eax
imull %eax, %ecx
movq -0x20(%rbp), %rax
movswl 0x1e(%rax), %eax
movzwl -0xa(%rbp), %edx
imull %edx, %eax
addl %eax, %ecx
movq -0x20(%rbp), %rax
movswl 0x1a(%rax), %eax
addl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x22(%rbp)
movzbl -0xb(%rbp), %eax
cmpl $0x0, %eax
je 0x1dc63
movq -0x8(%rbp), %rdi
callq 0x1df80
movzwl %ax, %eax
cmpl $0x0, %eax
jne 0x1dc76
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movswl -0x22(%rbp), %esi
callq 0x80b0
jmp 0x1dcf3
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x7350
cwtl
movl %eax, -0x40(%rbp)
movswl -0x22(%rbp), %eax
movl %eax, -0x3c(%rbp)
leaq -0x15bf1(%rip), %rax    # 0x80b0
movq %rax, -0x58(%rbp)
leaq 0x26784(%rip), %rax     # 0x44430
movq %rax, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movw $0x0, -0x36(%rbp)
movq -0x18(%rbp), %rax
movw 0x28(%rax), %ax
movw %ax, -0x38(%rbp)
movb -0x30(%rbp), %al
andb $-0x2, %al
orb $0x0, %al
movb %al, -0x30(%rbp)
movw $0x0, -0x34(%rbp)
movb -0x30(%rbp), %al
andb $-0x3, %al
orb $0x0, %al
movb %al, -0x30(%rbp)
movw $0x0, -0x32(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x444a0
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0xa080
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movb 0x2a(%rax), %al
shrb $0x5, %al
andb $0x3, %al
movzbl %al, %ecx
movl %ecx, -0xcc(%rbp)
subb $0x2, %al
jb 0x1dd31
jmp 0x1dd1e
movl -0xcc(%rbp), %eax
addl $-0x2, %eax
subl $0x2, %eax
jb 0x1dd6e
jmp 0x1dde9
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x8310
movw %ax, -0x6a(%rbp)
movswl -0x6a(%rbp), %eax
movzwl -0xa(%rbp), %ecx
imull %ecx, %eax
movq -0x68(%rbp), %rcx
movswl 0x1e(%rcx), %ecx
movzwl -0xa(%rbp), %edx
imull %edx, %ecx
addl %ecx, %eax
movq -0x68(%rbp), %rcx
movswl 0x1a(%rcx), %ecx
addl %ecx, %eax
movw %ax, -0x6c(%rbp)
jmp 0x1dde9
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x8350
movw %ax, -0x6a(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x1dfd0
movq %rax, -0x78(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x8350
cwtl
movq -0x78(%rbp), %rcx
movswl 0x16(%rcx), %ecx
subl %ecx, %eax
movq -0x78(%rbp), %rcx
movswl 0x18(%rcx), %ecx
subl %ecx, %eax
movw %ax, -0x7a(%rbp)
movq -0x18(%rbp), %rax
cmpw $0x0, 0x26(%rax)
je 0x1dde1
movswl -0x7a(%rbp), %eax
movq -0x18(%rbp), %rcx
movzwl 0x24(%rcx), %ecx
imull %ecx, %eax
movq -0x18(%rbp), %rcx
movzwl 0x26(%rcx), %ecx
cltd
idivl %ecx
movw %ax, -0x6c(%rbp)
jmp 0x1dde7
movw $0x0, -0x6c(%rbp)
jmp 0x1dde9
movzbl -0xb(%rbp), %eax
cmpl $0x0, %eax
je 0x1ddff
movq -0x18(%rbp), %rax
movzwl 0x28(%rax), %eax
cmpl $0x0, %eax
jne 0x1de53
movq -0x18(%rbp), %rax
movb 0x2a(%rax), %al
shrb $0x5, %al
andb $0x3, %al
movzbl %al, %ecx
movl %ecx, -0xd0(%rbp)
subb $0x2, %al
jb 0x1de2a
jmp 0x1de1a
movl -0xd0(%rbp), %eax
addl $-0x2, %eax
subl $0x2, %eax
jb 0x1de3d
jmp 0x1de4e
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movswl -0x6c(%rbp), %esi
callq 0x80b0
jmp 0x1de4e
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movswl -0x6c(%rbp), %esi
callq 0x8120
jmp 0x1df56
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xb8(%rbp)
movq -0x18(%rbp), %rax
movb 0x2a(%rax), %al
shrb $0x5, %al
andb $0x3, %al
movzbl %al, %ecx
movl %ecx, -0xd4(%rbp)
subb $0x2, %al
jb 0x1de8d
jmp 0x1de7d
movl -0xd4(%rbp), %eax
addl $-0x2, %eax
subl $0x2, %eax
jb 0x1debb
jmp 0x1dee7
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7350
cwtl
movl %eax, -0x98(%rbp)
movswl -0x6c(%rbp), %eax
movl %eax, -0x94(%rbp)
leaq -0x15e02(%rip), %rax    # 0x80b0
movq %rax, -0xb0(%rbp)
jmp 0x1dee7
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x73c0
cwtl
movl %eax, -0x98(%rbp)
movswl -0x6c(%rbp), %eax
movl %eax, -0x94(%rbp)
leaq -0x15dc0(%rip), %rax    # 0x8120
movq %rax, -0xb0(%rbp)
leaq 0x26542(%rip), %rax     # 0x44430
movq %rax, -0xa8(%rbp)
movq $0x0, -0xa0(%rbp)
movw $0x0, -0x8e(%rbp)
movq -0x18(%rbp), %rax
movw 0x28(%rax), %ax
movw %ax, -0x90(%rbp)
movb -0x88(%rbp), %al
andb $-0x2, %al
orb $0x0, %al
movb %al, -0x88(%rbp)
movw $0x0, -0x8c(%rbp)
movb -0x88(%rbp), %al
andb $-0x3, %al
orb $0x0, %al
movb %al, -0x88(%rbp)
movw $0x0, -0x8a(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x444a0
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movl $0x80, %edx
movzwl 0x24(%rax), %esi
callq 0x377b0
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax,%rax)