// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_draw_rect.c
// Function: lv_draw_rect_main_mid
static void lv_draw_rect_main_mid(const lv_area_t * coords, const lv_area_t * mask, const lv_style_t * style,
                                  lv_opa_t opa_scale)
{
    uint16_t radius = style->body.radius;
    bool aa         = lv_disp_get_antialiasing(lv_refr_get_disp_refreshing());

    lv_color_t mcolor = style->body.main_color;
    lv_color_t gcolor = style->body.grad_color;
    uint8_t mix;
    lv_coord_t height = lv_area_get_height(coords);
    lv_coord_t width  = lv_area_get_width(coords);
    lv_opa_t opa = opa_scale == LV_OPA_COVER ? style->body.opa : (uint16_t)((uint16_t)style->body.opa * opa_scale) >> 8;

    radius = lv_draw_cont_radius_corr(radius, width, height);

    /*If the radius is too big then there is no body*/
    if(radius > height / 2) return;

    lv_area_t work_area;
    work_area.x1 = coords->x1;
    work_area.x2 = coords->x2;

    if(mcolor.full == gcolor.full) {
        work_area.y1 = coords->y1 + radius;
        work_area.y2 = coords->y2 - radius;

        if(style->body.radius != 0) {

            if(aa) {
                work_area.y1 += 2;
                work_area.y2 -= 2;
            } else {
                work_area.y1 += 1;
                work_area.y2 -= 1;
            }
        }

        lv_draw_fill(&work_area, mask, mcolor, opa);
    } else {
        lv_coord_t row;
        lv_coord_t row_start = coords->y1 + radius;
        lv_coord_t row_end   = coords->y2 - radius;
        lv_color_t act_color;

        if(style->body.radius != 0) {
            if(aa) {
                row_start += 2;
                row_end -= 2;
            } else {
                row_start += 1;
                row_end -= 1;
            }
        }
        if(row_start < 0) row_start = 0;

        for(row = row_start; row <= row_end; row++) {
            work_area.y1 = row;
            work_area.y2 = row;
            mix          = (uint32_t)((uint32_t)(coords->y2 - work_area.y1) * 255) / height;
            act_color    = lv_color_mix(mcolor, gcolor, mix);

            lv_draw_fill(&work_area, mask, act_color, opa);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb %cl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq -0x18(%rbp), %rax
movw 0x6(%rax), %ax
movw %ax, -0x1c(%rbp)
callq 0xafe0
movq %rax, %rdi
callq 0xdb00
andb $0x1, %al
movb %al, -0x1d(%rbp)
movq -0x18(%rbp), %rax
movw 0x2(%rax), %ax
movw %ax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movw 0x4(%rax), %ax
movw %ax, -0x22(%rbp)
movq -0x8(%rbp), %rdi
callq 0x5ab10
movw %ax, -0x26(%rbp)
movq -0x8(%rbp), %rdi
callq 0x5ab30
movw %ax, -0x28(%rbp)
movzbl -0x19(%rbp), %eax
cmpl $0xff, %eax
jne 0x5ad01
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %eax
movl %eax, -0x40(%rbp)
jmp 0x5ad1c
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %eax
movzwl %ax, %eax
movzbl -0x19(%rbp), %ecx
imull %ecx, %eax
movzwl %ax, %eax
sarl $0x8, %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
movb %al, -0x29(%rbp)
movw -0x1c(%rbp), %cx
movw -0x28(%rbp), %ax
movzwl %cx, %edi
movswl %ax, %esi
movswl -0x26(%rbp), %edx
callq 0x5e0e0
movw %ax, -0x1c(%rbp)
movzwl -0x1c(%rbp), %eax
movl %eax, -0x44(%rbp)
movswl -0x26(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x44(%rbp), %eax
cmpl %ecx, %eax
jle 0x5ad5e
jmp 0x5af0d
movq -0x8(%rbp), %rax
movw (%rax), %ax
movw %ax, -0x32(%rbp)
movq -0x8(%rbp), %rax
movw 0x4(%rax), %ax
movw %ax, -0x2e(%rbp)
movzwl -0x20(%rbp), %eax
movzwl -0x22(%rbp), %ecx
cmpl %ecx, %eax
jne 0x5ae08
movq -0x8(%rbp), %rax
movswl 0x2(%rax), %eax
movzwl -0x1c(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movswl 0x6(%rax), %eax
movzwl -0x1c(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movswl 0x6(%rax), %eax
cmpl $0x0, %eax
je 0x5adec
testb $0x1, -0x1d(%rbp)
je 0x5add4
movswl -0x30(%rbp), %eax
addl $0x2, %eax
movw %ax, -0x30(%rbp)
movswl -0x2c(%rbp), %eax
subl $0x2, %eax
movw %ax, -0x2c(%rbp)
jmp 0x5adea
movswl -0x30(%rbp), %eax
addl $0x1, %eax
movw %ax, -0x30(%rbp)
movswl -0x2c(%rbp), %eax
subl $0x1, %eax
movw %ax, -0x2c(%rbp)
jmp 0x5adec
movq -0x10(%rbp), %rsi
movb -0x29(%rbp), %al
leaq -0x32(%rbp), %rdi
movzwl -0x20(%rbp), %edx
movzbl %al, %ecx
callq 0x58ea0
jmp 0x5af0d
movq -0x8(%rbp), %rax
movswl 0x2(%rax), %eax
movzwl -0x1c(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x36(%rbp)
movq -0x8(%rbp), %rax
movswl 0x6(%rax), %eax
movzwl -0x1c(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movswl 0x6(%rax), %eax
cmpl $0x0, %eax
je 0x5ae6f
testb $0x1, -0x1d(%rbp)
je 0x5ae57
movswl -0x36(%rbp), %eax
addl $0x2, %eax
movw %ax, -0x36(%rbp)
movswl -0x38(%rbp), %eax
subl $0x2, %eax
movw %ax, -0x38(%rbp)
jmp 0x5ae6d
movswl -0x36(%rbp), %eax
addl $0x1, %eax
movw %ax, -0x36(%rbp)
movswl -0x38(%rbp), %eax
subl $0x1, %eax
movw %ax, -0x38(%rbp)
jmp 0x5ae6f
movswl -0x36(%rbp), %eax
cmpl $0x0, %eax
jge 0x5ae7e
movw $0x0, -0x36(%rbp)
movw -0x36(%rbp), %ax
movw %ax, -0x34(%rbp)
movswl -0x34(%rbp), %eax
movswl -0x38(%rbp), %ecx
cmpl %ecx, %eax
jg 0x5af0b
movw -0x34(%rbp), %ax
movw %ax, -0x30(%rbp)
movw -0x34(%rbp), %ax
movw %ax, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movswl 0x6(%rax), %eax
movswl -0x30(%rbp), %ecx
subl %ecx, %eax
imull $0xff, %eax, %eax
movswl -0x26(%rbp), %ecx
xorl %edx, %edx
divl %ecx
movb %al, -0x23(%rbp)
movb -0x23(%rbp), %al
movw -0x20(%rbp), %cx
movzwl %cx, %edi
movzwl -0x22(%rbp), %esi
movzbl %al, %edx
callq 0x5e1a0
movw %ax, -0x3c(%rbp)
movw -0x3c(%rbp), %ax
movw %ax, -0x3a(%rbp)
movq -0x10(%rbp), %rsi
movb -0x29(%rbp), %al
leaq -0x32(%rbp), %rdi
movzwl -0x3a(%rbp), %edx
movzbl %al, %ecx
callq 0x58ea0
movw -0x34(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x34(%rbp)
jmp 0x5ae86
jmp 0x5af0d
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)