// File: /workspace/github_c_makefile_star2_O3/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_roller.c
// Function: lv_roller_design
static bool lv_roller_design(lv_obj_t * roller, const lv_area_t * mask, lv_design_mode_t mode)
{
    /*Return false if the object is not covers the mask_p area*/
    if(mode == LV_DESIGN_COVER_CHK) {
        return false;
    }
    /*Draw the object*/
    else if(mode == LV_DESIGN_DRAW_MAIN) {
        draw_bg(roller, mask);

        const lv_style_t * style = lv_roller_get_style(roller, LV_ROLLER_STYLE_BG);
        lv_opa_t opa_scale       = lv_obj_get_opa_scale(roller);
        const lv_font_t * font   = style->text.font;
        lv_roller_ext_t * ext    = lv_obj_get_ext_attr(roller);
        lv_coord_t font_h        = lv_font_get_line_height(font);
        lv_area_t rect_area;
        rect_area.y1 = roller->coords.y1 + lv_obj_get_height(roller) / 2 - font_h / 2 - style->text.line_space / 2;
        if((font_h & 0x1) && (style->text.line_space & 0x1)) rect_area.y1--; /*Compensate the two rounding error*/
        rect_area.y2 = rect_area.y1 + font_h + style->text.line_space - 1;
        lv_area_t roller_coords;
        lv_obj_get_coords(roller, &roller_coords);
        lv_obj_get_inner_coords(roller, &roller_coords);

        rect_area.x1 = roller_coords.x1;
        rect_area.x2 = roller_coords.x2;

        lv_draw_rect(&rect_area, mask, ext->ddlist.sel_style, opa_scale);
    }
    /*Post draw when the children are drawn*/
    else if(mode == LV_DESIGN_DRAW_POST) {
        const lv_style_t * style = lv_roller_get_style(roller, LV_ROLLER_STYLE_BG);
        lv_roller_ext_t * ext    = lv_obj_get_ext_attr(roller);
        const lv_font_t * font   = style->text.font;
        lv_coord_t font_h        = lv_font_get_line_height(font);
        lv_opa_t opa_scale       = lv_obj_get_opa_scale(roller);

        /*Redraw the text on the selected area with a different color*/
        lv_area_t rect_area;
        rect_area.y1 = roller->coords.y1 + lv_obj_get_height(roller) / 2 - font_h / 2 - style->text.line_space / 2;
        if((font_h & 0x1) && (style->text.line_space & 0x1)) rect_area.y1--; /*Compensate the two rounding error*/
        rect_area.y2 = rect_area.y1 + font_h + style->text.line_space - 1;
        rect_area.x1 = roller->coords.x1;
        rect_area.x2 = roller->coords.x2;
        lv_area_t mask_sel;
        bool area_ok;
        area_ok = lv_area_intersect(&mask_sel, mask, &rect_area);
        if(area_ok) {
            const lv_style_t * sel_style = lv_roller_get_style(roller, LV_ROLLER_STYLE_SEL);
            lv_style_t new_style;
            lv_txt_flag_t txt_align = LV_TXT_FLAG_NONE;

            {
                lv_label_align_t label_align = lv_label_get_align(ext->ddlist.label);

                if(LV_LABEL_ALIGN_CENTER == label_align) {
                    txt_align |= LV_TXT_FLAG_CENTER;
                } else if(LV_LABEL_ALIGN_RIGHT == label_align) {
                    txt_align |= LV_TXT_FLAG_RIGHT;
                }
            }

            lv_style_copy(&new_style, style);
            new_style.text.color = sel_style->text.color;
            new_style.text.opa   = sel_style->text.opa;
            lv_draw_label(&ext->ddlist.label->coords, &mask_sel, &new_style, opa_scale,
                          lv_label_get_text(ext->ddlist.label), txt_align, NULL, NULL, NULL, lv_obj_get_base_dir(ext->ddlist.label));
        }
    }

    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %edx, %ebx
cmpl $0x2, %edx
je 0xef6a
movq %rdi, %r15
cmpb $0x1, %bl
je 0xec7d
movzbl %bl, %eax
testl %eax, %eax
jne 0xef6a
movq %r15, %rdi
movq %rsi, %r12
xorl %esi, %esi
callq 0xf6a1
movq %rax, 0x20(%rsp)
movq %r15, %rdi
callq 0x5697
movl %eax, %r13d
movzwl %ax, %edx
movq 0x20(%r15), %rax
movl 0x5c(%r15), %ecx
movl %eax, %esi
subl %ecx, %esi
leaq 0x28(%rsp), %rbp
movw %si, (%rbp)
movq %rax, %rsi
shrq $0x20, %rsi
addl %ecx, %esi
movw %si, 0x4(%rbp)
shrl $0x10, %eax
shrl $0xf, %edx
addl %r13d, %edx
movswl %dx, %r14d
shrl %r14d
movl %r14d, %edx
addl %eax, %edx
subl %ecx, %eax
movw %ax, 0x2(%rbp)
movw %dx, 0x6(%rbp)
leaq 0x30(%rsp), %rdi
movq %rbp, %rsi
movq %r12, 0x38(%rsp)
movq %r12, %rdx
movq 0x20(%rsp), %r12
callq 0x28d24
movl 0x5c(%r15), %ecx
movl 0x4(%rbp), %edx
subl %ecx, %edx
movw %dx, 0x4(%rbp)
movq (%rbp), %xmm1
movd %ecx, %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
paddw %xmm1, %xmm0
movd %xmm0, (%rbp)
movzwl 0x6(%r12), %esi
addw %si, 0x6(%rbp)
testb %al, %al
je 0xedd6
movq %r15, %rdi
callq 0x69eb
movzbl %al, %ecx
leaq 0x28(%rsp), %rbp
leaq 0x30(%rsp), %rsi
movq %rbp, %rdi
movq %r12, %rdx
callq 0x36968
movzwl 0x5c(%r15), %ecx
movzwl (%rbp), %eax
movzwl 0x4(%rbp), %edx
jmp 0xedda
movq %r15, %rdi
movq %rsi, %r12
xorl %esi, %esi
callq 0xf6a1
movq %rax, %r13
movq %r15, %rdi
callq 0x6af7
movq %rax, 0x20(%rsp)
movq 0x28(%r13), %rax
movzbl 0x10(%rax), %r14d
movq %r15, %rdi
callq 0x69eb
movb %al, 0x38(%rsp)
movzwl 0x22(%r15), %ebp
movq %r15, %rdi
callq 0x5697
movzwl %ax, %ecx
shrl $0xf, %ecx
addl %eax, %ecx
movswl %cx, %eax
sarl %eax
addl %ebp, %eax
movl %r14d, %ecx
shrl %ecx
movzwl 0x32(%r13), %esi
movzwl %si, %edx
shrl $0xf, %edx
addl %esi, %edx
movswl %dx, %edx
sarl %edx
addl %ecx, %edx
subl %edx, %eax
movl %r14d, %ecx
andl %esi, %ecx
andl $0x1, %ecx
subl %ecx, %eax
leaq 0x30(%rsp), %rdx
movw %ax, 0x2(%rdx)
addl %esi, %r14d
addl %r14d, %eax
decl %eax
movw %ax, 0x6(%rdx)
movzwl 0x20(%r15), %eax
movw %ax, (%rdx)
movzwl 0x24(%r15), %eax
movw %ax, 0x4(%rdx)
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x28d24
testb %al, %al
je 0xef6a
movq %r15, %rdi
movl $0x1, %esi
callq 0xf6a1
movq %rax, %r15
movq 0x20(%rsp), %r12
movq 0x50(%r12), %rdi
callq 0x1a9c6
cmpb $0x2, %al
sete %cl
shlb $0x3, %cl
cmpb $0x1, %al
movzbl %cl, %eax
movl $0x4, %ebp
cmovnel %eax, %ebp
leaq 0x40(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x799d
movzwl 0x20(%r15), %eax
movw %ax, 0x20(%r14)
movb 0x34(%r15), %al
movb %al, 0x34(%r14)
movq 0x50(%r12), %rdi
leaq 0x20(%rdi), %r15
callq 0x1aa00
movq %rax, %r13
movq 0x50(%r12), %rdi
callq 0x4ab2
movzbl %al, %eax
movl %eax, 0x18(%rsp)
pxor %xmm0, %xmm0
movdqu %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movzbl %bpl, %r9d
movzbl 0x38(%rsp), %ecx
leaq 0x28(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rdx
movq %r13, %r8
callq 0x3a5ac
jmp 0xef6a
movd %xmm0, %eax
subl %ecx, %eax
leaq 0x28(%rsp), %rbp
movw %ax, (%rbp)
addl %ecx, %edx
movw %dx, 0x4(%rbp)
addw 0x26(%r15), %cx
movw %cx, 0x6(%rbp)
notl %r13d
andl $0x1, %r13d
leal (%r14,%r13), %eax
addw 0x22(%r15), %ax
movw %ax, 0x2(%rbp)
leaq 0x30(%rsp), %rdi
movq %rbp, %rsi
movq 0x38(%rsp), %rdx
callq 0x28d24
movq (%rbp), %xmm0
movd 0x5c(%r15), %xmm1
movdqa %xmm1, %xmm2
pinsrw $0x1, 0x6(%r12), %xmm2
pshuflw $0x4, %xmm2, %xmm2      # xmm2 = xmm2[0,1,0,0,4,5,6,7]
paddw %xmm0, %xmm1
psubw %xmm2, %xmm0
movdqa 0x3077a(%rip), %xmm2    # 0x3f5c0
pand %xmm2, %xmm0
pandn %xmm1, %xmm2
por %xmm0, %xmm2
movq %xmm2, (%rbp)
testb %al, %al
je 0xeea1
leaq 0x40(%rsp), %r13
movl $0x9, %ecx
movq %r13, %rdi
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
movzwl 0x4(%r12), %eax
movw %ax, 0x2(%r13)
movzwl 0x2(%r12), %eax
movw %ax, 0x4(%r13)
movq %r15, %rdi
callq 0x69eb
movzbl %al, %ecx
leaq 0x28(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movq %r13, %rdx
callq 0x36968
movq %r15, %rdi
xorl %esi, %esi
callq 0xf6a1
movq %rax, %r13
movq %r15, %rdi
callq 0x69eb
movb %al, 0x20(%rsp)
movq 0x28(%r13), %r14
movq %r15, %rdi
callq 0x6af7
movq %rax, %r12
movzbl 0x10(%r14), %r14d
movzwl 0x22(%r15), %ebp
movq %r15, %rdi
callq 0x5697
movzwl %ax, %ecx
shrl $0xf, %ecx
addl %eax, %ecx
movswl %cx, %eax
sarl %eax
addl %ebp, %eax
movl %r14d, %ecx
shrl %ecx
movzwl 0x32(%r13), %edx
movzwl %dx, %esi
shrl $0xf, %esi
addl %edx, %esi
movswl %si, %esi
sarl %esi
addl %ecx, %esi
subl %esi, %eax
movl %r14d, %ecx
andl %edx, %ecx
andl $0x1, %ecx
subl %ecx, %eax
leaq 0x40(%rsp), %r13
movw %ax, 0x2(%r13)
addl %edx, %r14d
addl %r14d, %eax
decl %eax
movw %ax, 0x6(%r13)
leaq 0x30(%rsp), %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x542b
movq %r15, %rdi
movq %rbp, %rsi
callq 0x664c
movzwl (%rbp), %eax
movzwl 0x4(%rbp), %ecx
movw %ax, (%r13)
movw %cx, 0x4(%r13)
movq 0x58(%r12), %rdx
movzbl 0x20(%rsp), %ecx
movq %r13, %rdi
movq 0x38(%rsp), %rsi
callq 0x36968
cmpb $0x2, %bl
setne %al
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq