// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_label.c
// Function: lv_label_design
static bool lv_label_design(lv_obj_t * label, const lv_area_t * mask, lv_design_mode_t mode)
{
    /* A label never covers an area */
    if(mode == LV_DESIGN_COVER_CHK)
        return false;
    else if(mode == LV_DESIGN_DRAW_MAIN) {
        lv_area_t coords;
        const lv_style_t * style = lv_obj_get_style(label);
        lv_opa_t opa_scale       = lv_obj_get_opa_scale(label);
        lv_obj_get_coords(label, &coords);

#if LV_USE_GROUP
        lv_group_t * g = lv_obj_get_group(label);
        if(lv_group_get_focused(g) == label) {
            lv_draw_rect(&coords, mask, style, opa_scale);
        }
#endif

        lv_label_ext_t * ext = lv_obj_get_ext_attr(label);

        if(ext->body_draw) {
            lv_area_t bg;
            lv_obj_get_coords(label, &bg);
            bg.x1 -= style->body.padding.left;
            bg.x2 += style->body.padding.right;
            bg.y1 -= style->body.padding.top;
            bg.y2 += style->body.padding.bottom;

            lv_draw_rect(&bg, mask, style, lv_obj_get_opa_scale(label));
        }

        lv_label_align_t align = lv_label_get_align(label);

        lv_txt_flag_t flag = LV_TXT_FLAG_NONE;
        if(ext->recolor != 0) flag |= LV_TXT_FLAG_RECOLOR;
        if(ext->expand != 0) flag |= LV_TXT_FLAG_EXPAND;
        if(align == LV_LABEL_ALIGN_CENTER) flag |= LV_TXT_FLAG_CENTER;
        if(align == LV_LABEL_ALIGN_RIGHT) flag |= LV_TXT_FLAG_RIGHT;

        /* In ROLL mode the CENTER and RIGHT are pointless so remove them.
         * (In addition they will result mis-alignment is this case)*/
        if((ext->long_mode == LV_LABEL_LONG_SROLL || ext->long_mode == LV_LABEL_LONG_SROLL_CIRC) &&
           (ext->align == LV_LABEL_ALIGN_CENTER || ext->align == LV_LABEL_ALIGN_RIGHT)) {
            lv_point_t size;
            lv_txt_get_size(&size, ext->text, style->text.font, style->text.letter_space, style->text.line_space,
                            LV_COORD_MAX, flag);
            if(size.x > lv_obj_get_width(label)) {
                flag &= ~LV_TXT_FLAG_RIGHT;
                flag &= ~LV_TXT_FLAG_CENTER;
            }
        }
#if LV_LABEL_LONG_TXT_HINT
        lv_draw_label_hint_t * hint = &ext->hint;
        if(ext->long_mode == LV_LABEL_LONG_SROLL_CIRC || lv_obj_get_height(label) < LV_LABEL_HINT_HEIGHT_LIMIT)
            hint = NULL;

#else
        /*Just for compatibility*/
        lv_draw_label_hint_t * hint = NULL;
#endif
        lv_draw_label_txt_sel_t sel;

        sel.start = lv_label_get_text_sel_start(label);
        sel.end = lv_label_get_text_sel_end(label);
        lv_draw_label(&coords, mask, style, opa_scale, ext->text, flag, &ext->offset, &sel, hint, lv_obj_get_base_dir(label));


        if(ext->long_mode == LV_LABEL_LONG_SROLL_CIRC) {
            lv_point_t size;
            lv_txt_get_size(&size, ext->text, style->text.font, style->text.letter_space, style->text.line_space,
                            LV_COORD_MAX, flag);

            lv_point_t ofs;

            /*Draw the text again next to the original to make an circular effect */
            if(size.x > lv_obj_get_width(label)) {
                ofs.x = ext->offset.x + size.x +
                        lv_font_get_glyph_width(style->text.font, ' ', ' ') * LV_LABEL_WAIT_CHAR_COUNT;
                ofs.y = ext->offset.y;

                lv_draw_label(&coords, mask, style, opa_scale, ext->text, flag, &ofs, &sel, NULL, lv_obj_get_base_dir(label));
            }

            /*Draw the text again below the original to make an circular effect */
            if(size.y > lv_obj_get_height(label)) {
                ofs.x = ext->offset.x;
                ofs.y = ext->offset.y + size.y + lv_font_get_line_height(style->text.font);
                lv_draw_label(&coords, mask, style, opa_scale, ext->text, flag, &ofs, &sel, NULL, lv_obj_get_base_dir(label));
            }
        }
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %ebx
testl %edx, %edx
je 0x19992
cmpb $0x2, %bl
setne %al
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %r13
movq %rdi, %r15
callq 0x6697
movq %rax, %r12
movq %r15, %rdi
callq 0x69cc
movl %eax, %ebp
leaq 0x28(%rsp), %rsi
movq %r15, %rdi
callq 0x5427
movq %r15, %rdi
callq 0x4ea3
movq %rax, %rdi
callq 0x2a39
cmpq %r15, %rax
jne 0x199e0
movzbl %bpl, %ecx
leaq 0x28(%rsp), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x365ac
movb %bpl, 0x30(%rsp)
movq %r15, %rdi
callq 0x6ad8
movq %rax, %rbp
testb $0x1, 0x19(%rax)
je 0x19a4d
movq %rbp, %r14
leaq 0x10(%rsp), %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x5427
movzwl 0x1a(%r12), %eax
subw %ax, (%rbp)
movzwl 0x1c(%r12), %eax
addw %ax, 0x4(%rbp)
movzwl 0x16(%r12), %eax
subw %ax, 0x2(%rbp)
movzwl 0x18(%r12), %eax
addw %ax, 0x6(%rbp)
movq %r15, %rdi
callq 0x69cc
movzbl %al, %ecx
movq %rbp, %rdi
movq %r14, %rbp
movq %r13, %rsi
movq %r12, %rdx
callq 0x365ac
movq %r15, %rdi
callq 0x1a1ff
movzwl 0x18(%rbp), %ecx
movl %ecx, %edx
shrb $0x6, %dl
movl %edx, %esi
andb $0x1, %sil
orb $0x2, %dl
testb %cl, %cl
movzbl %sil, %esi
movzbl %dl, %edx
cmovnsl %esi, %edx
leal 0x4(%rdx), %esi
cmpb $0x1, %al
movzbl %sil, %esi
cmovnel %edx, %esi
movl %esi, %edx
orb $0x8, %dl
cmpb $0x2, %al
movzbl %dl, %r14d
cmovnel %esi, %r14d
movl %ecx, %eax
andl $0x7, %eax
addl $-0x3, %eax
cmpw $0x1, %ax
ja 0x19b06
shrl $0x4, %ecx
andl $0x3, %ecx
decl %ecx
cmpw $0x1, %cx
ja 0x19b06
movq (%rbp), %rsi
movq 0x28(%r12), %rdx
movswl 0x30(%r12), %ecx
movswl 0x32(%r12), %r8d
subq $0x8, %rsp
movq %rbp, 0x10(%rsp)
movzbl %r14b, %ebp
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movl $0x7c18, %r9d           # imm = 0x7C18
pushq %rbp
callq 0x2a643
addq $0x10, %rsp
movzwl (%r14), %r14d
movq %r15, %rdi
callq 0x5651
movl %ebp, %ecx
andb $0x73, %cl
cmpw %ax, %r14w
movzbl %cl, %r14d
cmovlel %ebp, %r14d
movq 0x8(%rsp), %rbp
movq %r15, %rdi
callq 0x80d4
testb %al, %al
je 0x19cf1
movw $0xffff, 0x10(%rsp)     # imm = 0xFFFF
movq %r15, %rdi
callq 0x80d4
testb %al, %al
je 0x19d02
leaq 0x10(%rsp), %rax
movw $0xffff, 0x2(%rax)      # imm = 0xFFFF
movq (%rbp), %rax
movq %rax, 0x20(%rsp)
movq %rbp, 0x8(%rsp)
movq %r13, %rbp
movq 0x8(%rsp), %r13
addq $0x12, %r13
movq %r15, %rdi
callq 0x4abc
movzbl %al, %eax
movzbl 0x30(%rsp), %ecx
movzbl %r14b, %r14d
leaq 0x28(%rsp), %rdi
movq %rbp, 0x30(%rsp)
movq %rbp, %rsi
movq 0x8(%rsp), %rbp
movq %r12, %rdx
movl %ecx, 0x18(%rsp)
movq 0x20(%rsp), %r8
movl %r14d, %r9d
pushq %rax
pushq $0x0
leaq 0x20(%rsp), %rax
pushq %rax
pushq %r13
callq 0x3a034
addq $0x20, %rsp
movzwl 0x18(%rbp), %eax
andl $0x7, %eax
cmpw $0x4, %ax
jne 0x1997d
movq (%rbp), %rsi
movq 0x28(%r12), %rdx
movswl 0x30(%r12), %ecx
movswl 0x32(%r12), %r8d
subq $0x8, %rsp
leaq 0xc(%rsp), %rbp
movq %rbp, %rdi
movl $0x7c18, %r9d           # imm = 0x7C18
movq %r14, 0x28(%rsp)
pushq %r14
callq 0x2a643
addq $0x10, %rsp
movzwl (%rbp), %ebp
movq %r15, %rdi
callq 0x5651
cmpw %ax, %bp
movq 0x30(%rsp), %r13
jle 0x19c6f
movzwl 0x4(%rsp), %ebp
movq 0x8(%rsp), %r14
addw 0x12(%r14), %bp
movq 0x28(%r12), %rdi
movl $0x20, %esi
movl $0x20, %edx
callq 0x27d87
leal (%rax,%rax,2), %eax
addl %ebp, %eax
leaq 0x1c(%rsp), %rcx
movw %ax, (%rcx)
movzwl 0x14(%r14), %eax
movw %ax, 0x2(%rcx)
movq (%r14), %rbp
movq %r15, %rdi
callq 0x4abc
movzbl %al, %eax
leaq 0x28(%rsp), %rdi
movq %r13, %rsi
movq %r12, %rdx
movl 0x18(%rsp), %ecx
movq %rbp, %r8
movq 0x20(%rsp), %r9
pushq %rax
pushq $0x0
leaq 0x20(%rsp), %rax
pushq %rax
leaq 0x34(%rsp), %rax
pushq %rax
callq 0x3a034
addq $0x20, %rsp
movzwl 0x6(%rsp), %ebp
movq %r15, %rdi
callq 0x567b
cmpw %ax, %bp
jle 0x1997d
movq 0x8(%rsp), %rdx
movzwl 0x12(%rdx), %eax
leaq 0x1c(%rsp), %r14
movw %ax, (%r14)
movzwl 0x6(%rsp), %eax
addw 0x14(%rdx), %ax
movq 0x28(%r12), %rcx
movzbl 0x10(%rcx), %ecx
addl %eax, %ecx
movw %cx, 0x2(%r14)
movq %r13, %rbp
movq (%rdx), %r13
movq %r15, %rdi
callq 0x4abc
movzbl %al, %eax
leaq 0x28(%rsp), %rdi
movq %rbp, %rsi
movq %r12, %rdx
movl 0x18(%rsp), %ecx
movq %r13, %r8
movq 0x20(%rsp), %r9
pushq %rax
pushq $0x0
leaq 0x20(%rsp), %rax
pushq %rax
pushq %r14
callq 0x3a034
addq $0x20, %rsp
jmp 0x1997d
leaq 0x2543c(%rip), %rdi     # 0x3f134
movq %r15, %rsi
callq 0x829e
jmp 0x19d00
leaq 0x2542b(%rip), %rdi     # 0x3f134
movq %r15, %rsi
callq 0x829e
jmp 0x19d11