// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_tileview.c
// Function: lv_tileview_set_tile_act
void lv_tileview_set_tile_act(lv_obj_t * tileview, lv_coord_t x, lv_coord_t y, lv_anim_enable_t anim)
{
    LV_ASSERT_OBJ(tileview, LV_OBJX_NAME);

#if LV_USE_ANIMATION == 0
    anim = LV_ANIM_OFF;
#endif

    lv_tileview_ext_t * ext = lv_obj_get_ext_attr(tileview);

    uint32_t tile_id;
    bool valid = false;
    for(tile_id = 0; tile_id < ext->valid_pos_cnt; tile_id++) {
        if(ext->valid_pos[tile_id].x == x && ext->valid_pos[tile_id].y == y) {
            valid = true;
        }
    }

    if(valid == false) return; /*Don't load not valid tiles*/

    ext->act_id.x = x;
    ext->act_id.y = y;

    lv_coord_t x_coord = -x * lv_obj_get_width(tileview);
    lv_coord_t y_coord = -y * lv_obj_get_height(tileview);
    lv_obj_t * scrl    = lv_page_get_scrl(tileview);
    if(anim) {
#if LV_USE_ANIMATION
        lv_coord_t x_act = lv_obj_get_x(scrl);
        lv_coord_t y_act = lv_obj_get_y(scrl);

        lv_anim_t a;
        a.var            = scrl;
        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;

        if(x_coord != x_act) {
            a.start = x_act;
            a.end   = x_coord;
            lv_anim_create(&a);
        }

        if(y_coord != y_act) {
            a.start   = y_act;
            a.end     = y_coord;
            a.exec_cb = (lv_anim_exec_xcb_t)lv_obj_set_y;
            lv_anim_create(&a);
        }
#endif
    } else {
        lv_obj_set_pos(scrl, x_coord, y_coord);
    }

    lv_res_t res = LV_RES_OK;
    res          = lv_event_send(tileview, LV_EVENT_VALUE_CHANGED, &tile_id);
    if(res != LV_RES_OK) return; /*Prevent the tile loading*/
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movb %cl, %al
movw %dx, %cx
movw %si, %dx
movq %rdi, -0x8(%rbp)
movw %dx, -0xa(%rbp)
movw %cx, -0xc(%rbp)
movb %al, -0xd(%rbp)
movq -0x8(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x1f671
movq -0x8(%rbp), %rsi
leaq 0x48a92(%rip), %rdi     # 0x680fc
callq 0xd410
jmp 0x1f66f
movq -0x8(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x18(%rbp)
movb $0x0, -0x1d(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
movzwl 0x58(%rcx), %ecx
cmpl %ecx, %eax
jae 0x1f6d8
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x1c(%rbp), %ecx
movswl (%rax,%rcx,4), %eax
movswl -0xa(%rbp), %ecx
cmpl %ecx, %eax
jne 0x1f6cb
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x1c(%rbp), %ecx
movswl 0x2(%rax,%rcx,4), %eax
movswl -0xc(%rbp), %ecx
cmpl %ecx, %eax
jne 0x1f6cb
movb $0x1, -0x1d(%rbp)
jmp 0x1f6cd
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1f689
movb -0x1d(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x1f6ea
jmp 0x1f85e
movw -0xa(%rbp), %cx
movq -0x18(%rbp), %rax
movw %cx, 0x5c(%rax)
movw -0xc(%rbp), %cx
movq -0x18(%rbp), %rax
movw %cx, 0x5e(%rax)
movswl -0xa(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x7c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8310
movw %ax, %cx
movl -0x7c(%rbp), %eax
movswl %cx, %ecx
imull %ecx, %eax
movw %ax, -0x20(%rbp)
movswl -0xc(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x78(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8350
movw %ax, %cx
movl -0x78(%rbp), %eax
movswl %cx, %ecx
imull %ecx, %eax
movw %ax, -0x22(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3e970
movq %rax, -0x30(%rbp)
cmpb $0x0, -0xd(%rbp)
je 0x1f826
movq -0x30(%rbp), %rdi
callq 0x7350
movw %ax, -0x32(%rbp)
movq -0x30(%rbp), %rdi
callq 0x73c0
movw %ax, -0x34(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq -0x176da(%rip), %rax    # 0x80b0
movq %rax, -0x68(%rbp)
leaq 0x24c9b(%rip), %rax     # 0x44430
movq %rax, -0x60(%rbp)
movq $0x0, -0x58(%rbp)
movw $0x0, -0x46(%rbp)
movq -0x18(%rbp), %rax
movw 0x5a(%rax), %ax
movw %ax, -0x48(%rbp)
movb -0x40(%rbp), %al
andb $-0x2, %al
orb $0x0, %al
movb %al, -0x40(%rbp)
movw $0x0, -0x44(%rbp)
movb -0x40(%rbp), %al
andb $-0x3, %al
orb $0x0, %al
movb %al, -0x40(%rbp)
movw $0x0, -0x42(%rbp)
movswl -0x20(%rbp), %eax
movswl -0x32(%rbp), %ecx
cmpl %ecx, %eax
je 0x1f7f6
movswl -0x32(%rbp), %eax
movl %eax, -0x50(%rbp)
movswl -0x20(%rbp), %eax
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x444a0
movswl -0x22(%rbp), %eax
movswl -0x34(%rbp), %ecx
cmpl %ecx, %eax
je 0x1f824
movswl -0x34(%rbp), %eax
movl %eax, -0x50(%rbp)
movswl -0x22(%rbp), %eax
movl %eax, -0x4c(%rbp)
leaq -0x176f7(%rip), %rax    # 0x8120
movq %rax, -0x68(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x444a0
jmp 0x1f83a
movq -0x30(%rbp), %rdi
movw -0x20(%rbp), %ax
movswl %ax, %esi
movswl -0x22(%rbp), %edx
callq 0x71f0
movb $0x1, -0x71(%rbp)
movq -0x8(%rbp), %rdi
movl $0xe, %esi
leaq -0x1c(%rbp), %rdx
callq 0x7990
movb %al, -0x71(%rbp)
movzbl -0x71(%rbp), %eax
cmpl $0x1, %eax
je 0x1f85e
jmp 0x1f85e
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)