// File: /workspace/github_c_makefile_star2_O2/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 0xe484
movq %rdi, %r14
cmpb $0x1, %bl
je 0xe1a9
movzbl %bl, %eax
testl %eax, %eax
jne 0xe484
movq %r14, %rdi
movq %rsi, %r12
xorl %esi, %esi
callq 0xeb91
movq %rax, 0x20(%rsp)
movq %r14, %rdi
callq 0x5332
movl %eax, %ebp
movq 0x20(%r14), %rcx
movl 0x5c(%r14), %eax
movl %ecx, %edx
subl %eax, %edx
leaq 0x28(%rsp), %r15
movw %dx, (%r15)
movq %rcx, %rdx
shrq $0x20, %rdx
addl %eax, %edx
movw %dx, 0x4(%r15)
shrl $0x10, %ecx
movl %ecx, %edx
subl %eax, %edx
movw %dx, 0x2(%r15)
movw $0x2, %si
movl %ebp, %eax
cwtd
idivw %si
movl %eax, %r13d
addl %r13d, %ecx
movw %cx, 0x6(%r15)
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
movq %r12, 0x38(%rsp)
movq %r12, %rdx
movq 0x20(%rsp), %r12
callq 0x26880
movl 0x5c(%r14), %ecx
movl 0x4(%r15), %edx
subl %ecx, %edx
movw %dx, 0x4(%r15)
movq (%r15), %xmm1
movd %ecx, %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
paddw %xmm1, %xmm0
movd %xmm0, (%r15)
movzwl 0x6(%r12), %esi
addw %si, 0x6(%r15)
testb %al, %al
je 0xe2f6
movq %r14, %rdi
callq 0x6649
movzbl %al, %ecx
leaq 0x28(%rsp), %r15
leaq 0x30(%rsp), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x336d4
movzwl 0x5c(%r14), %ecx
movzwl (%r15), %eax
movzwl 0x4(%r15), %edx
jmp 0xe2fa
movq %r14, %rdi
movq %rsi, %r12
xorl %esi, %esi
callq 0xeb91
movq %rax, %r13
movq %r14, %rdi
callq 0x6747
movq %rax, 0x20(%rsp)
movq 0x28(%r13), %rax
movzbl 0x10(%rax), %r15d
movq %r14, %rdi
callq 0x6649
movb %al, 0x38(%rsp)
movzwl 0x22(%r14), %ebp
movq %r14, %rdi
callq 0x5332
movw $0x2, %di
cwtd
idivw %di
movl %eax, %ecx
movl %r15d, %r8d
shrl %r8d
movzwl 0x32(%r13), %esi
movl %esi, %eax
cwtd
idivw %di
addl %r8d, %eax
addl %ebp, %ecx
subl %eax, %ecx
movl %r15d, %eax
andl %esi, %eax
andl $0x1, %eax
subl %eax, %ecx
leaq 0x30(%rsp), %rdx
movw %cx, 0x2(%rdx)
addl %esi, %r15d
leal (%rcx,%r15), %eax
decl %eax
movw %ax, 0x6(%rdx)
movzwl 0x20(%r14), %eax
movw %ax, (%rdx)
movzwl 0x24(%r14), %eax
movw %ax, 0x4(%rdx)
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x26880
testb %al, %al
je 0xe484
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0xeb91
movq %rax, %r15
movq 0x20(%rsp), %r12
movq 0x50(%r12), %rdi
callq 0x18d7f
cmpb $0x2, %al
sete %cl
shlb $0x3, %cl
cmpb $0x1, %al
movzbl %cl, %eax
pushq $0x4
popq %rbp
cmovnel %eax, %ebp
leaq 0x40(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x74d4
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 0x18db9
movq %rax, %r13
movq 0x50(%r12), %rdi
callq 0x47b9
movzbl %al, %eax
movl %eax, 0x18(%rsp)
pxor %xmm0, %xmm0
movdqu %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
movzbl %bpl, %r9d
movzbl 0x38(%rsp), %ecx
leaq 0x28(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rdx
movq %r13, %r8
callq 0x3699c
jmp 0xe484
movd %xmm0, %eax
subl %ecx, %eax
leaq 0x28(%rsp), %r15
movw %ax, (%r15)
addl %ecx, %edx
movw %dx, 0x4(%r15)
addw 0x26(%r14), %cx
movw %cx, 0x6(%r15)
notl %ebp
andl $0x1, %ebp
addl %ebp, %r13d
addw 0x22(%r14), %r13w
movw %r13w, 0x2(%r15)
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
movq 0x38(%rsp), %rdx
callq 0x26880
movq (%r15), %xmm0
movd 0x5c(%r14), %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 0x2d1ba(%rip), %xmm2    # 0x3b520
pand %xmm2, %xmm0
pandn %xmm1, %xmm2
por %xmm0, %xmm2
movq %xmm2, (%r15)
testb %al, %al
je 0xe3bf
pushq $0x9
popq %rcx
leaq 0x40(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
movzwl 0x4(%r12), %eax
movw %ax, 0x2(%r15)
movzwl 0x2(%r12), %eax
movw %ax, 0x4(%r15)
movq %r14, %rdi
callq 0x6649
movzbl %al, %ecx
leaq 0x28(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movq %r15, %rdx
callq 0x336d4
movq %r14, %rdi
xorl %esi, %esi
callq 0xeb91
movq %rax, %r15
movq %r14, %rdi
callq 0x6649
movb %al, 0x20(%rsp)
movq 0x28(%r15), %r13
movq %r14, %rdi
callq 0x6747
movq %rax, %r12
movzbl 0x10(%r13), %r13d
movzwl 0x22(%r14), %ebp
movq %r14, %rdi
callq 0x5332
movw $0x2, %di
cwtd
idivw %di
movl %eax, %ecx
movl %r13d, %r8d
shrl %r8d
movzwl 0x32(%r15), %esi
movl %esi, %eax
cwtd
idivw %di
addl %r8d, %eax
addl %ebp, %ecx
subl %eax, %ecx
movl %r13d, %eax
andl %esi, %eax
andl $0x1, %eax
subl %eax, %ecx
leaq 0x40(%rsp), %r15
movw %cx, 0x2(%r15)
addl %esi, %r13d
leal (%rcx,%r13), %eax
decl %eax
movw %ax, 0x6(%r15)
leaq 0x30(%rsp), %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x50e5
movq %r14, %rdi
movq %r13, %rsi
callq 0x62ac
movzwl (%r13), %eax
movzwl 0x4(%r13), %ecx
movw %ax, (%r15)
movw %cx, 0x4(%r15)
movq 0x58(%r12), %rdx
movzbl 0x20(%rsp), %ecx
movq %r15, %rdi
movq 0x38(%rsp), %rsi
callq 0x336d4
cmpb $0x2, %bl
setne %al
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq