// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_ddlist.c
// Function: lv_ddlist_refr_size
static void lv_ddlist_refr_size(lv_obj_t * ddlist, lv_anim_enable_t anim)
{
#if LV_USE_ANIMATION == 0
    anim = false;
#endif
    lv_ddlist_ext_t * ext    = lv_obj_get_ext_attr(ddlist);
    const lv_style_t * style = lv_obj_get_style(ddlist);
    lv_coord_t new_height;

    /*Open the list*/
    if(ext->opened) {
        if(ext->fix_height == 0) {
            new_height =
                lv_obj_get_height(lv_page_get_scrl(ddlist)) + style->body.padding.top + style->body.padding.bottom;
        } else {
            new_height = ext->fix_height;
        }

    }
    /*Close the list*/
    else {
        const lv_font_t * font         = style->text.font;
        const lv_style_t * label_style = lv_obj_get_style(ext->label);
        lv_coord_t font_h              = lv_font_get_line_height(font);
        new_height                     = font_h + 2 * label_style->text.line_space;

        lv_page_set_sb_mode(ddlist, LV_SB_MODE_HIDE);
    }

    if(anim == LV_ANIM_OFF) {
        lv_obj_set_height(ddlist, new_height);
        lv_ddlist_pos_current_option(ddlist);
        if(ext->opened) lv_page_set_sb_mode(ddlist, LV_SB_MODE_UNHIDE);
#if LV_USE_ANIMATION
        lv_anim_del(ddlist, (lv_anim_exec_xcb_t)lv_ddlist_adjust_height); /*If an animation is in progress then
                                                                 it will overwrite this changes*/

        /*Force animation complete to fix highlight selection*/
        lv_ddlist_anim_finish(ddlist);
    } else {
        /*Run the animation only if the the size will be different*/
        if(lv_obj_get_height(ddlist) != new_height) {
            lv_anim_t a;
            a.var            = ddlist;
            a.start          = lv_obj_get_height(ddlist);
            a.end            = new_height;
            a.exec_cb        = (lv_anim_exec_xcb_t)lv_ddlist_adjust_height;
            a.path_cb        = lv_anim_path_linear;
            a.ready_cb       = lv_ddlist_anim_ready_cb;
            a.act_time       = 0;
            a.time           = lv_ddlist_get_anim_time(ddlist);
            a.playback       = 0;
            a.playback_pause = 0;
            a.repeat         = 0;
            a.repeat_pause   = 0;

            ext->force_sel = 1; /*Keep the list item selected*/
            lv_anim_create(&a);
        }
#endif
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movl %esi, %ebp
movq %rdi, %rbx
callq 0x6747
movq %rax, %r14
movq %rbx, %rdi
callq 0x6316
movq %rax, %r12
testb $0x1, 0x66(%r14)
jne 0xb64a
movq 0x28(%r12), %r15
movq 0x50(%r14), %rdi
callq 0x6316
movzbl 0x10(%r15), %ecx
movzwl 0x32(%rax), %eax
leal (%rcx,%rax,2), %r15d
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x23fed
jmp 0xb674
movzwl 0x68(%r14), %r15d
testw %r15w, %r15w
jne 0xb674
movq %rbx, %rdi
callq 0x245d9
movq %rax, %rdi
callq 0x5332
movl %eax, %r15d
addw 0x16(%r12), %r15w
addw 0x18(%r12), %r15w
testb %bpl, %bpl
je 0xb700
movq %rbx, %rdi
callq 0x5332
cmpw %r15w, %ax
je 0xb6f3
movswl %r15w, %ebp
leaq 0x8(%rsp), %r15
movq %rbx, (%r15)
movq %rbx, %rdi
callq 0x5332
cwtl
movl %eax, 0x20(%r15)
movl %ebp, 0x24(%r15)
leaq 0x71f(%rip), %rax       # 0xbdce
movq %rax, 0x8(%r15)
leaq 0x1bf9f(%rip), %rax     # 0x27659
movq %rax, 0x10(%r15)
leaq 0x75d(%rip), %rax       # 0xbe22
movq %rax, 0x18(%r15)
andw $0x0, 0x2a(%r15)
movq %rbx, %rdi
callq 0x246b8
movw %ax, 0x28(%r15)
andl $0x0, 0x2c(%r15)
movb $0x0, 0x30(%r15)
orb $0x2, 0x66(%r14)
movq %r15, %rdi
callq 0x27685
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movswl %r15w, %esi
movq %rbx, %rdi
callq 0x53e6
movq %rbx, %rdi
callq 0xb7b4
testb $0x1, 0x66(%r14)
je 0xb726
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x23fed
leaq 0x6a1(%rip), %rsi       # 0xbdce
movq %rbx, %rdi
callq 0x27715
movq %rbx, %rdi
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xbde0