// File: /workspace/github_c_makefile_star2_O1/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 0x6ad8
movq %rax, %r14
movq %rbx, %rdi
callq 0x6697
movq %rax, %r12
testb $0x1, 0x66(%r14)
jne 0xc0d4
movq 0x28(%r12), %r15
movq 0x50(%r14), %rdi
callq 0x6697
movzbl 0x10(%r15), %ecx
movzwl 0x32(%rax), %eax
leal (%rcx,%rax,2), %r15d
movq %rbx, %rdi
movl $0x4, %esi
callq 0x25c83
jmp 0xc0fe
movzwl 0x68(%r14), %r15d
testw %r15w, %r15w
jne 0xc0fe
movq %rbx, %rdi
callq 0x26288
movq %rax, %rdi
callq 0x567b
movl %eax, %r15d
addw 0x16(%r12), %r15w
addw 0x18(%r12), %r15w
testb %bpl, %bpl
je 0xc18e
movq %rbx, %rdi
callq 0x567b
cmpw %r15w, %ax
je 0xc181
movswl %r15w, %ebp
leaq 0x8(%rsp), %r15
movq %rbx, (%r15)
movq %rbx, %rdi
callq 0x567b
cwtl
movl %eax, 0x20(%r15)
movl %ebp, 0x24(%r15)
leaq 0x769(%rip), %rax       # 0xc8a2
movq %rax, 0x8(%r15)
leaq 0x1d3b1(%rip), %rax     # 0x294f5
movq %rax, 0x10(%r15)
leaq 0x7a9(%rip), %rax       # 0xc8f8
movq %rax, 0x18(%r15)
movw $0x0, 0x2a(%r15)
movq %rbx, %rdi
callq 0x26367
movw %ax, 0x28(%r15)
movl $0x0, 0x2c(%r15)
andb $-0x4, 0x30(%r15)
orb $0x2, 0x66(%r14)
movq %r15, %rdi
callq 0x29521
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movswl %r15w, %esi
movq %rbx, %rdi
callq 0x572f
movq %rbx, %rdi
callq 0xc244
testb $0x1, 0x66(%r14)
je 0xc1b6
movq %rbx, %rdi
movl $0x5, %esi
callq 0x25c83
leaq 0x6e5(%rip), %rsi       # 0xc8a2
movq %rbx, %rdi
callq 0x295b1
movq %rbx, %rdi
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xc8b4