// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movb %dl, %al
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %eax
cmpl $0x2, %eax
jne 0x29c7b
movb $0x0, -0x9(%rbp)
jmp 0x2a1f8
movzbl -0x21(%rbp), %eax
cmpl $0x0, %eax
jne 0x2a1f2
movq -0x18(%rbp), %rdi
callq 0xa080
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
callq 0xa710
movb %al, -0x39(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x2a(%rbp), %rsi
callq 0x7fb0
movq -0x18(%rbp), %rdi
callq 0x77c0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
callq 0x3010
cmpq -0x18(%rbp), %rax
jne 0x29cdf
movq -0x20(%rbp), %rsi
movq -0x38(%rbp), %rdx
leaq -0x2a(%rbp), %rdi
movzbl -0x39(%rbp), %ecx
callq 0x5a9e0
movq -0x18(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movw 0x18(%rax), %ax
shrw $0x8, %ax
andw $0x1, %ax
cmpb $0x0, %al
je 0x29d8c
movq -0x18(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x7fb0
movq -0x38(%rbp), %rax
movswl 0x1a(%rax), %ecx
movswl -0x58(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x58(%rbp)
movq -0x38(%rbp), %rax
movswl 0x1c(%rax), %ecx
movswl -0x54(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x54(%rbp)
movq -0x38(%rbp), %rax
movswl 0x16(%rax), %ecx
movswl -0x56(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x56(%rbp)
movq -0x38(%rbp), %rax
movswl 0x18(%rax), %ecx
movswl -0x52(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x52(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x18(%rbp), %rdi
callq 0xa710
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
leaq -0x58(%rbp), %rdi
movzbl %al, %ecx
callq 0x5a9e0
movq -0x18(%rbp), %rdi
callq 0x2ab50
movb %al, -0x59(%rbp)
movb $0x0, -0x5a(%rbp)
movq -0x50(%rbp), %rax
movw 0x18(%rax), %ax
shrw $0x6, %ax
andw $0x1, %ax
movzbl %al, %eax
cmpl $0x0, %eax
je 0x29dbe
movzbl -0x5a(%rbp), %eax
orl $0x1, %eax
movb %al, -0x5a(%rbp)
movq -0x50(%rbp), %rax
movw 0x18(%rax), %ax
shrw $0x7, %ax
andw $0x1, %ax
movzbl %al, %eax
cmpl $0x0, %eax
je 0x29de0
movzbl -0x5a(%rbp), %eax
orl $0x2, %eax
movb %al, -0x5a(%rbp)
movzbl -0x59(%rbp), %eax
cmpl $0x1, %eax
jne 0x29df3
movzbl -0x5a(%rbp), %eax
orl $0x4, %eax
movb %al, -0x5a(%rbp)
movzbl -0x59(%rbp), %eax
cmpl $0x2, %eax
jne 0x29e06
movzbl -0x5a(%rbp), %eax
orl $0x8, %eax
movb %al, -0x5a(%rbp)
movq -0x50(%rbp), %rax
movw 0x18(%rax), %ax
andw $0x7, %ax
movzbl %al, %eax
cmpl $0x3, %eax
je 0x29e32
movq -0x50(%rbp), %rax
movw 0x18(%rax), %ax
andw $0x7, %ax
movzbl %al, %eax
cmpl $0x4, %eax
jne 0x29ed7
movq -0x50(%rbp), %rax
movw 0x18(%rax), %ax
shrw $0x4, %ax
andw $0x3, %ax
movzbl %al, %eax
cmpl $0x1, %eax
je 0x29e62
movq -0x50(%rbp), %rax
movw 0x18(%rax), %ax
shrw $0x4, %ax
andw $0x3, %ax
movzbl %al, %eax
cmpl $0x2, %eax
jne 0x29ed7
movq -0x50(%rbp), %rax
movq (%rax), %rsi
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rdx
movq -0x38(%rbp), %rax
movw 0x30(%rax), %cx
movq -0x38(%rbp), %rax
movw 0x32(%rax), %ax
leaq -0x5e(%rbp), %rdi
movl $0x7c18, %r9d           # imm = 0x7C18
movswl %cx, %ecx
movswl %ax, %r8d
movzbl -0x5a(%rbp), %eax
movl %eax, (%rsp)
callq 0x46820
movswl -0x5e(%rbp), %eax
movl %eax, -0x8c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x8310
movw %ax, %cx
movl -0x8c(%rbp), %eax
movswl %cx, %ecx
cmpl %ecx, %eax
jle 0x29ed5
movzbl -0x5a(%rbp), %eax
andl $-0x9, %eax
movb %al, -0x5a(%rbp)
movzbl -0x5a(%rbp), %eax
andl $-0x5, %eax
movb %al, -0x5a(%rbp)
jmp 0x29ed7
movq $0x0, -0x68(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2c440
movw %ax, -0x6c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2c480
movw %ax, -0x6a(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0xb8(%rbp)
movb -0x39(%rbp), %al
movb %al, -0xa9(%rbp)
movq -0x50(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xa8(%rbp)
movb -0x5a(%rbp), %al
movb %al, -0x99(%rbp)
movq -0x50(%rbp), %rbx
addq $0x12, %rbx
movq -0x68(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x18(%rbp), %rdi
callq 0x7180
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
movb -0xa9(%rbp), %cl
movq -0xa8(%rbp), %r8
movb -0x99(%rbp), %r9b
movq -0x98(%rbp), %r10
leaq -0x2a(%rbp), %rdi
leaq -0x6c(%rbp), %r11
movzbl %cl, %ecx
movzbl %r9b, %r9d
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movzbl %al, %eax
movl %eax, 0x18(%rsp)
callq 0x5f210
movq -0x50(%rbp), %rax
movw 0x18(%rax), %ax
andw $0x7, %ax
movzbl %al, %eax
cmpl $0x4, %eax
jne 0x2a1f0
movq -0x50(%rbp), %rax
movq (%rax), %rsi
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rdx
movq -0x38(%rbp), %rax
movw 0x30(%rax), %cx
movq -0x38(%rbp), %rax
movw 0x32(%rax), %ax
leaq -0x70(%rbp), %rdi
movl $0x7c18, %r9d           # imm = 0x7C18
movswl %cx, %ecx
movswl %ax, %r8d
movzbl -0x5a(%rbp), %eax
movl %eax, (%rsp)
callq 0x46820
movswl -0x70(%rbp), %eax
movl %eax, -0xc4(%rbp)
movq -0x18(%rbp), %rdi
callq 0x8310
movw %ax, %cx
movl -0xc4(%rbp), %eax
movswl %cx, %ecx
cmpl %ecx, %eax
jle 0x2a0f5
movq -0x50(%rbp), %rax
movswl 0x12(%rax), %eax
movswl -0x70(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0xec(%rbp)
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rdi
movl $0x20, %edx
movl %edx, %esi
callq 0x415e0
movw %ax, %cx
movl -0xec(%rbp), %eax
movzwl %cx, %ecx
imull $0x3, %ecx, %ecx
addl %ecx, %eax
movw %ax, -0x74(%rbp)
movq -0x50(%rbp), %rax
movw 0x14(%rax), %ax
movw %ax, -0x72(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0xe0(%rbp)
movb -0x39(%rbp), %al
movb %al, -0xd1(%rbp)
movq -0x50(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xd0(%rbp)
movb -0x5a(%rbp), %al
movb %al, -0xc5(%rbp)
movq -0x18(%rbp), %rdi
callq 0x7180
movq -0xe8(%rbp), %rsi
movq -0xe0(%rbp), %rdx
movb -0xd1(%rbp), %cl
movq -0xd0(%rbp), %r8
movb -0xc5(%rbp), %r9b
leaq -0x2a(%rbp), %rdi
leaq -0x74(%rbp), %r11
leaq -0x6c(%rbp), %r10
xorl %ebx, %ebx
movzbl %cl, %ecx
movzbl %r9b, %r9d
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movzbl %al, %eax
movl %eax, 0x18(%rsp)
callq 0x5f210
movswl -0x6e(%rbp), %eax
movl %eax, -0xf0(%rbp)
movq -0x18(%rbp), %rdi
callq 0x8350
movw %ax, %cx
movl -0xf0(%rbp), %eax
movswl %cx, %ecx
cmpl %ecx, %eax
jle 0x2a1ee
movq -0x50(%rbp), %rax
movw 0x12(%rax), %ax
movw %ax, -0x74(%rbp)
movq -0x50(%rbp), %rax
movswl 0x14(%rax), %eax
movswl -0x6e(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x11c(%rbp)
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x2c020
movb %al, %cl
movl -0x11c(%rbp), %eax
movzbl %cl, %ecx
addl %ecx, %eax
movw %ax, -0x72(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x110(%rbp)
movb -0x39(%rbp), %al
movb %al, -0x101(%rbp)
movq -0x50(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x100(%rbp)
movb -0x5a(%rbp), %al
movb %al, -0xf1(%rbp)
movq -0x18(%rbp), %rdi
callq 0x7180
movq -0x118(%rbp), %rsi
movq -0x110(%rbp), %rdx
movb -0x101(%rbp), %cl
movq -0x100(%rbp), %r8
movb -0xf1(%rbp), %r9b
leaq -0x2a(%rbp), %rdi
leaq -0x74(%rbp), %r11
leaq -0x6c(%rbp), %r10
xorl %ebx, %ebx
movzbl %cl, %ecx
movzbl %r9b, %r9d
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movzbl %al, %eax
movl %eax, 0x18(%rsp)
callq 0x5f210
jmp 0x2a1f0
jmp 0x2a1f2
jmp 0x2a1f4
movb $0x1, -0x9(%rbp)
movb -0x9(%rbp), %al
andb $0x1, %al
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %rbp
retq
nopw (%rax,%rax)