// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_bar.c
// Function: lv_bar_design
static bool lv_bar_design(lv_obj_t * bar, const lv_area_t * mask, lv_design_mode_t mode)
{
    if(mode == LV_DESIGN_COVER_CHK) {
        /*Return false if the object is not covers the mask area*/
        return ancestor_design_f(bar, mask, mode);
    } else if(mode == LV_DESIGN_DRAW_MAIN) {
        lv_opa_t opa_scale = lv_obj_get_opa_scale(bar);

#if LV_USE_GROUP == 0
        ancestor_design_f(bar, mask, mode);
#else
        /* Draw the borders later if the bar is focused.
         * At value = 100% the indicator can cover to whole background and the focused style won't
         * be visible*/
        if(lv_obj_is_focused(bar)) {
            const lv_style_t * style_bg = lv_bar_get_style(bar, LV_BAR_STYLE_BG);
            lv_style_t style_tmp;
            lv_style_copy(&style_tmp, style_bg);
            style_tmp.body.border.width = 0;
            lv_draw_rect(&bar->coords, mask, &style_tmp, opa_scale);
        } else {
            ancestor_design_f(bar, mask, mode);
        }
#endif
        lv_bar_ext_t * ext = lv_obj_get_ext_attr(bar);

        if(ext->cur_value != ext->min_value || ext->sym
#if LV_USE_ANIMATION
           || ext->anim_start != LV_BAR_ANIM_STATE_INV
#endif
        ) {
            const lv_style_t * style_indic = lv_bar_get_style(bar, LV_BAR_STYLE_INDIC);
            lv_area_t indic_area;
            lv_area_copy(&indic_area, &bar->coords);
            indic_area.x1 += style_indic->body.padding.left;
            indic_area.x2 -= style_indic->body.padding.right;
            indic_area.y1 += style_indic->body.padding.top;
            indic_area.y2 -= style_indic->body.padding.bottom;

            lv_coord_t w = lv_area_get_width(&indic_area);
            lv_coord_t h = lv_area_get_height(&indic_area);

            if(w >= h) {
                /*Horizontal*/
#if LV_USE_ANIMATION
                if(ext->anim_state != LV_BAR_ANIM_STATE_INV) {
                    /*Calculate the coordinates of anim. start and end*/
                    lv_coord_t anim_start_x =
                        (int32_t)((int32_t)w * (ext->anim_start - ext->min_value)) / (ext->max_value - ext->min_value);
                    lv_coord_t anim_end_x =
                        (int32_t)((int32_t)w * (ext->anim_end - ext->min_value)) / (ext->max_value - ext->min_value);

                    /*Calculate the real position based on `anim_state` (between `anim_start` and
                     * `anim_end`)*/
                    indic_area.x2 =
                        anim_start_x + (((anim_end_x - anim_start_x) * ext->anim_state) >> LV_BAR_ANIM_STATE_NORM);
                } else
#endif
                {
                    indic_area.x2 =
                        (int32_t)((int32_t)w * (ext->cur_value - ext->min_value)) / (ext->max_value - ext->min_value);
                }

                indic_area.x2 = indic_area.x1 + indic_area.x2 - 1;
                if(ext->sym && ext->min_value < 0 && ext->max_value > 0) {
                    /*Calculate the coordinate of the zero point*/
                    lv_coord_t zero;
                    zero = indic_area.x1 + (-ext->min_value * w) / (ext->max_value - ext->min_value);
                    if(indic_area.x2 > zero)
                        indic_area.x1 = zero;
                    else {
                        indic_area.x1 = indic_area.x2;
                        indic_area.x2 = zero;
                    }
                }
            } else {
#if LV_USE_ANIMATION
                if(ext->anim_state != LV_BAR_ANIM_STATE_INV) {
                    /*Calculate the coordinates of anim. start and end*/
                    lv_coord_t anim_start_y =
                        (int32_t)((int32_t)h * (ext->anim_start - ext->min_value)) / (ext->max_value - ext->min_value);
                    lv_coord_t anim_end_y =
                        (int32_t)((int32_t)h * (ext->anim_end - ext->min_value)) / (ext->max_value - ext->min_value);

                    /*Calculate the real position based on `anim_state` (between `anim_start` and
                     * `anim_end`)*/
                    indic_area.y1 =
                        anim_start_y + (((anim_end_y - anim_start_y) * ext->anim_state) >> LV_BAR_ANIM_STATE_NORM);
                } else
#endif
                {
                    indic_area.y1 =
                        (int32_t)((int32_t)h * (ext->cur_value - ext->min_value)) / (ext->max_value - ext->min_value);
                }

                indic_area.y1 = indic_area.y2 - indic_area.y1 + 1;

                if(ext->sym && ext->min_value < 0 && ext->max_value > 0) {
                    /*Calculate the coordinate of the zero point*/
                    lv_coord_t zero;
                    zero = indic_area.y2 - (-ext->min_value * h) / (ext->max_value - ext->min_value);
                    if(indic_area.y1 < zero)
                        indic_area.y2 = zero;
                    else {
                        indic_area.y2 = indic_area.y1;
                        indic_area.y1 = zero;
                    }
                }
            }

            /*Draw the indicator*/
            lv_draw_rect(&indic_area, mask, style_indic, opa_scale);
        }
    } else if(mode == LV_DESIGN_DRAW_POST) {
#if LV_USE_GROUP
        /*Draw the border*/
        if(lv_obj_is_focused(bar)) {
            lv_opa_t opa_scale          = lv_obj_get_opa_scale(bar);
            const lv_style_t * style_bg = lv_bar_get_style(bar, LV_BAR_STYLE_BG);
            lv_style_t style_tmp;
            lv_style_copy(&style_tmp, style_bg);
            style_tmp.body.opa          = LV_OPA_TRANSP;
            style_tmp.body.shadow.width = 0;
            lv_draw_rect(&bar->coords, mask, &style_tmp, opa_scale);
        }
#endif
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movb %dl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movb %al, -0x19(%rbp)
movzbl -0x19(%rbp), %eax
cmpl $0x2, %eax
jne 0xeb90
movq 0x7a7f8(%rip), %rax     # 0x89370
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movzbl -0x19(%rbp), %edx
callq *%rax
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0xf138
movzbl -0x19(%rbp), %eax
cmpl $0x0, %eax
jne 0xf0b3
movq -0x10(%rbp), %rdi
callq 0xa710
movb %al, -0x1a(%rbp)
movq -0x10(%rbp), %rdi
callq 0xaa20
testb $0x1, %al
jne 0xebb8
jmp 0xebf5
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0xf7a0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0xc550
movw $0x0, -0x64(%rbp)
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
movq -0x18(%rbp), %rsi
leaq -0x70(%rbp), %rdx
movzbl -0x1a(%rbp), %ecx
callq 0x5a9e0
jmp 0xec0a
movq 0x7a774(%rip), %rax     # 0x89370
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movzbl -0x19(%rbp), %edx
callq *%rax
movq -0x10(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movswl (%rax), %eax
movq -0x78(%rbp), %rcx
movswl 0x2(%rcx), %ecx
cmpl %ecx, %eax
jne 0xec4c
movq -0x78(%rbp), %rax
movb 0xe(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xec4c
movq -0x78(%rbp), %rax
movswl 0x6(%rax), %eax
cmpl $-0x1, %eax
je 0xf0b1
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0xf7a0
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
leaq -0x88(%rbp), %rdi
callq 0xf830
movq -0x80(%rbp), %rax
movswl 0x1a(%rax), %ecx
movswl -0x88(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x88(%rbp)
movq -0x80(%rbp), %rax
movswl 0x1c(%rax), %ecx
movswl -0x84(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x84(%rbp)
movq -0x80(%rbp), %rax
movswl 0x16(%rax), %ecx
movswl -0x86(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x86(%rbp)
movq -0x80(%rbp), %rax
movswl 0x18(%rax), %ecx
movswl -0x82(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x82(%rbp)
leaq -0x88(%rbp), %rdi
callq 0xf850
movw %ax, -0x8a(%rbp)
leaq -0x88(%rbp), %rdi
callq 0xf870
movw %ax, -0x8c(%rbp)
movswl -0x8a(%rbp), %eax
movswl -0x8c(%rbp), %ecx
cmpl %ecx, %eax
jl 0xeed5
movq -0x78(%rbp), %rax
movswl 0xa(%rax), %eax
cmpl $-0x1, %eax
je 0xedbf
movswl -0x8a(%rbp), %eax
movq -0x78(%rbp), %rcx
movswl 0x6(%rcx), %ecx
movq -0x78(%rbp), %rdx
movswl 0x2(%rdx), %edx
subl %edx, %ecx
imull %ecx, %eax
movq -0x78(%rbp), %rcx
movswl 0x4(%rcx), %ecx
movq -0x78(%rbp), %rdx
movswl 0x2(%rdx), %edx
subl %edx, %ecx
cltd
idivl %ecx
movw %ax, -0x8e(%rbp)
movswl -0x8a(%rbp), %eax
movq -0x78(%rbp), %rcx
movswl 0x8(%rcx), %ecx
movq -0x78(%rbp), %rdx
movswl 0x2(%rdx), %edx
subl %edx, %ecx
imull %ecx, %eax
movq -0x78(%rbp), %rcx
movswl 0x4(%rcx), %ecx
movq -0x78(%rbp), %rdx
movswl 0x2(%rdx), %edx
subl %edx, %ecx
cltd
idivl %ecx
movw %ax, -0x90(%rbp)
movswl -0x8e(%rbp), %eax
movswl -0x90(%rbp), %ecx
movswl -0x8e(%rbp), %edx
subl %edx, %ecx
movq -0x78(%rbp), %rdx
movswl 0xa(%rdx), %edx
imull %edx, %ecx
sarl $0x8, %ecx
addl %ecx, %eax
movw %ax, -0x84(%rbp)
jmp 0xedf6
movswl -0x8a(%rbp), %eax
movq -0x78(%rbp), %rcx
movswl (%rcx), %ecx
movq -0x78(%rbp), %rdx
movswl 0x2(%rdx), %edx
subl %edx, %ecx
imull %ecx, %eax
movq -0x78(%rbp), %rcx
movswl 0x4(%rcx), %ecx
movq -0x78(%rbp), %rdx
movswl 0x2(%rdx), %edx
subl %edx, %ecx
cltd
idivl %ecx
movw %ax, -0x84(%rbp)
movswl -0x88(%rbp), %eax
movswl -0x84(%rbp), %ecx
addl %ecx, %eax
subl $0x1, %eax
movw %ax, -0x84(%rbp)
movq -0x78(%rbp), %rax
movb 0xe(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0xeed0
movq -0x78(%rbp), %rax
movswl 0x2(%rax), %eax
cmpl $0x0, %eax
jge 0xeed0
movq -0x78(%rbp), %rax
movswl 0x4(%rax), %eax
cmpl $0x0, %eax
jle 0xeed0
movswl -0x88(%rbp), %eax
movl %eax, -0xf4(%rbp)
movq -0x78(%rbp), %rax
movswl 0x2(%rax), %ecx
xorl %eax, %eax
subl %ecx, %eax
movswl -0x8a(%rbp), %ecx
imull %ecx, %eax
movq -0x78(%rbp), %rcx
movswl 0x4(%rcx), %ecx
movq -0x78(%rbp), %rdx
movswl 0x2(%rdx), %edx
subl %edx, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0xf4(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x92(%rbp)
movswl -0x84(%rbp), %eax
movswl -0x92(%rbp), %ecx
cmpl %ecx, %eax
jle 0xeeb2
movw -0x92(%rbp), %ax
movw %ax, -0x88(%rbp)
jmp 0xeece
movw -0x84(%rbp), %ax
movw %ax, -0x88(%rbp)
movw -0x92(%rbp), %ax
movw %ax, -0x84(%rbp)
jmp 0xeed0
jmp 0xf099
movq -0x78(%rbp), %rax
movswl 0xa(%rax), %eax
cmpl $-0x1, %eax
je 0xef86
movswl -0x8c(%rbp), %eax
movq -0x78(%rbp), %rcx
movswl 0x6(%rcx), %ecx
movq -0x78(%rbp), %rdx
movswl 0x2(%rdx), %edx
subl %edx, %ecx
imull %ecx, %eax
movq -0x78(%rbp), %rcx
movswl 0x4(%rcx), %ecx
movq -0x78(%rbp), %rdx
movswl 0x2(%rdx), %edx
subl %edx, %ecx
cltd
idivl %ecx
movw %ax, -0x94(%rbp)
movswl -0x8c(%rbp), %eax
movq -0x78(%rbp), %rcx
movswl 0x8(%rcx), %ecx
movq -0x78(%rbp), %rdx
movswl 0x2(%rdx), %edx
subl %edx, %ecx
imull %ecx, %eax
movq -0x78(%rbp), %rcx
movswl 0x4(%rcx), %ecx
movq -0x78(%rbp), %rdx
movswl 0x2(%rdx), %edx
subl %edx, %ecx
cltd
idivl %ecx
movw %ax, -0x96(%rbp)
movswl -0x94(%rbp), %eax
movswl -0x96(%rbp), %ecx
movswl -0x94(%rbp), %edx
subl %edx, %ecx
movq -0x78(%rbp), %rdx
movswl 0xa(%rdx), %edx
imull %edx, %ecx
sarl $0x8, %ecx
addl %ecx, %eax
movw %ax, -0x86(%rbp)
jmp 0xefbd
movswl -0x8c(%rbp), %eax
movq -0x78(%rbp), %rcx
movswl (%rcx), %ecx
movq -0x78(%rbp), %rdx
movswl 0x2(%rdx), %edx
subl %edx, %ecx
imull %ecx, %eax
movq -0x78(%rbp), %rcx
movswl 0x4(%rcx), %ecx
movq -0x78(%rbp), %rdx
movswl 0x2(%rdx), %edx
subl %edx, %ecx
cltd
idivl %ecx
movw %ax, -0x86(%rbp)
movswl -0x82(%rbp), %eax
movswl -0x86(%rbp), %ecx
subl %ecx, %eax
addl $0x1, %eax
movw %ax, -0x86(%rbp)
movq -0x78(%rbp), %rax
movb 0xe(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0xf097
movq -0x78(%rbp), %rax
movswl 0x2(%rax), %eax
cmpl $0x0, %eax
jge 0xf097
movq -0x78(%rbp), %rax
movswl 0x4(%rax), %eax
cmpl $0x0, %eax
jle 0xf097
movswl -0x82(%rbp), %eax
movl %eax, -0xf8(%rbp)
movq -0x78(%rbp), %rax
movswl 0x2(%rax), %ecx
xorl %eax, %eax
subl %ecx, %eax
movswl -0x8c(%rbp), %ecx
imull %ecx, %eax
movq -0x78(%rbp), %rcx
movswl 0x4(%rcx), %ecx
movq -0x78(%rbp), %rdx
movswl 0x2(%rdx), %edx
subl %edx, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0xf8(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x98(%rbp)
movswl -0x86(%rbp), %eax
movswl -0x98(%rbp), %ecx
cmpl %ecx, %eax
jge 0xf079
movw -0x98(%rbp), %ax
movw %ax, -0x82(%rbp)
jmp 0xf095
movw -0x86(%rbp), %ax
movw %ax, -0x82(%rbp)
movw -0x98(%rbp), %ax
movw %ax, -0x86(%rbp)
jmp 0xf097
jmp 0xf099
movq -0x18(%rbp), %rsi
movq -0x80(%rbp), %rdx
leaq -0x88(%rbp), %rdi
movzbl -0x1a(%rbp), %ecx
callq 0x5a9e0
jmp 0xf132
movzbl -0x19(%rbp), %eax
cmpl $0x1, %eax
jne 0xf130
movq -0x10(%rbp), %rdi
callq 0xaa20
testb $0x1, %al
jne 0xf0cb
jmp 0xf12e
movq -0x10(%rbp), %rdi
callq 0xa710
movb %al, -0x99(%rbp)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0xf7a0
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rsi
leaq -0xf0(%rbp), %rdi
callq 0xc550
movb $0x0, -0xe8(%rbp)
movw $0x0, -0xde(%rbp)
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
movq -0x18(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
movzbl -0x99(%rbp), %ecx
callq 0x5a9e0
jmp 0xf130
jmp 0xf132
jmp 0xf134
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopw %cs:(%rax,%rax)