// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_line.c
// Function: lv_line_design
static bool lv_line_design(lv_obj_t * line, const lv_area_t * mask, lv_design_mode_t mode)
{
    /*A line never covers an area*/
    if(mode == LV_DESIGN_COVER_CHK)
        return false;
    else if(mode == LV_DESIGN_DRAW_MAIN) {
        lv_line_ext_t * ext = lv_obj_get_ext_attr(line);

        if(ext->point_num == 0 || ext->point_array == NULL) return false;

        const lv_style_t * style = lv_obj_get_style(line);
        lv_opa_t opa_scale       = lv_obj_get_opa_scale(line);
        lv_area_t area;
        lv_obj_get_coords(line, &area);
        lv_coord_t x_ofs = area.x1;
        lv_coord_t y_ofs = area.y1;
        lv_point_t p1;
        lv_point_t p2;
        lv_coord_t h = lv_obj_get_height(line);
        uint16_t i;

        lv_style_t circle_style_tmp; /*If rounded...*/
        if(style->line.rounded) {
            lv_style_copy(&circle_style_tmp, style);
            circle_style_tmp.body.radius     = LV_RADIUS_CIRCLE;
            circle_style_tmp.body.main_color = style->line.color;
            circle_style_tmp.body.grad_color = style->line.color;
            circle_style_tmp.body.opa        = style->line.opa;
        }
        lv_area_t circle_area;

        /*Read all points and draw the lines*/
        for(i = 0; i < ext->point_num - 1; i++) {

            p1.x = ext->point_array[i].x + x_ofs;
            p2.x = ext->point_array[i + 1].x + x_ofs;

            if(ext->y_inv == 0) {
                p1.y = ext->point_array[i].y + y_ofs;
                p2.y = ext->point_array[i + 1].y + y_ofs;
            } else {
                p1.y = h - ext->point_array[i].y + y_ofs;
                p2.y = h - ext->point_array[i + 1].y + y_ofs;
            }
            lv_draw_line(&p1, &p2, mask, style, opa_scale);

            /*Draw circle on the joints if enabled*/
            if(style->line.rounded) {
                circle_area.x1 = p1.x - ((style->line.width - 1) >> 1) - ((style->line.width - 1) & 0x1);
                circle_area.y1 = p1.y - ((style->line.width - 1) >> 1) - ((style->line.width - 1) & 0x1);
                circle_area.x2 = p1.x + ((style->line.width - 1) >> 1);
                circle_area.y2 = p1.y + ((style->line.width - 1) >> 1);
                lv_draw_rect(&circle_area, mask, &circle_style_tmp, opa_scale);
            }
        }

        /*Draw circle on the last point too if enabled*/
        if(style->line.rounded) {
            circle_area.x1 = p2.x - ((style->line.width - 1) >> 1) - ((style->line.width - 1) & 0x1);
            circle_area.y1 = p2.y - ((style->line.width - 1) >> 1) - ((style->line.width - 1) & 0x1);
            circle_area.x2 = p2.x + ((style->line.width - 1) >> 1);
            circle_area.y2 = p2.y + ((style->line.width - 1) >> 1);
            lv_draw_rect(&circle_area, mask, &circle_style_tmp, opa_scale);
        }
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movb %dl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movb %al, -0x19(%rbp)
movzbl -0x19(%rbp), %eax
cmpl $0x2, %eax
jne 0x15fca
movb $0x0, -0x1(%rbp)
jmp 0x1631f
movzbl -0x19(%rbp), %eax
cmpl $0x0, %eax
jne 0x16319
movq -0x10(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movzwl 0x8(%rax), %eax
cmpl $0x0, %eax
je 0x15ffb
movq -0x28(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x16004
movb $0x0, -0x1(%rbp)
jmp 0x1631f
movq -0x10(%rbp), %rdi
callq 0xa080
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0xa710
movb %al, -0x31(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x3a(%rbp), %rsi
callq 0x7fb0
movw -0x3a(%rbp), %ax
movw %ax, -0x3c(%rbp)
movw -0x38(%rbp), %ax
movw %ax, -0x3e(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
movw %ax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movb 0x41(%rax), %al
andb $0x1, %al
cmpb $0x0, %al
je 0x16098
movq -0x30(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0xc550
movw $0x7c18, -0x92(%rbp)    # imm = 0x7C18
movq -0x30(%rbp), %rax
movw 0x3c(%rax), %ax
movw %ax, -0x96(%rbp)
movq -0x30(%rbp), %rax
movw 0x3c(%rax), %ax
movw %ax, -0x94(%rbp)
movq -0x30(%rbp), %rax
movb 0x40(%rax), %al
movb %al, -0x90(%rbp)
movw $0x0, -0x4a(%rbp)
movzwl -0x4a(%rbp), %eax
movq -0x28(%rbp), %rcx
movzwl 0x8(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x16263
movq -0x28(%rbp), %rax
movq (%rax), %rax
movzwl -0x4a(%rbp), %ecx
movswl (%rax,%rcx,4), %eax
movswl -0x3c(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x42(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movzwl -0x4a(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movswl (%rax,%rcx,4), %eax
movswl -0x3c(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x46(%rbp)
movq -0x28(%rbp), %rax
movb 0xa(%rax), %al
shrb %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x1613c
movq -0x28(%rbp), %rax
movq (%rax), %rax
movzwl -0x4a(%rbp), %ecx
movswl 0x2(%rax,%rcx,4), %eax
movswl -0x3e(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x40(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movzwl -0x4a(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movswl 0x2(%rax,%rcx,4), %eax
movswl -0x3e(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x44(%rbp)
jmp 0x16182
movswl -0x48(%rbp), %eax
movq -0x28(%rbp), %rcx
movq (%rcx), %rcx
movzwl -0x4a(%rbp), %edx
movswl 0x2(%rcx,%rdx,4), %ecx
subl %ecx, %eax
movswl -0x3e(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x40(%rbp)
movswl -0x48(%rbp), %eax
movq -0x28(%rbp), %rcx
movq (%rcx), %rcx
movzwl -0x4a(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movswl 0x2(%rcx,%rdx,4), %ecx
subl %ecx, %eax
movswl -0x3e(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x44(%rbp)
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %rcx
leaq -0x42(%rbp), %rdi
leaq -0x46(%rbp), %rsi
movzbl -0x31(%rbp), %r8d
callq 0x5fcd0
movq -0x30(%rbp), %rax
movb 0x41(%rax), %al
andb $0x1, %al
cmpb $0x0, %al
je 0x16250
movswl -0x42(%rbp), %eax
movq -0x30(%rbp), %rcx
movswl 0x3e(%rcx), %ecx
subl $0x1, %ecx
sarl %ecx
subl %ecx, %eax
movq -0x30(%rbp), %rcx
movswl 0x3e(%rcx), %ecx
subl $0x1, %ecx
andl $0x1, %ecx
subl %ecx, %eax
movw %ax, -0xa0(%rbp)
movswl -0x40(%rbp), %eax
movq -0x30(%rbp), %rcx
movswl 0x3e(%rcx), %ecx
subl $0x1, %ecx
sarl %ecx
subl %ecx, %eax
movq -0x30(%rbp), %rcx
movswl 0x3e(%rcx), %ecx
subl $0x1, %ecx
andl $0x1, %ecx
subl %ecx, %eax
movw %ax, -0x9e(%rbp)
movswl -0x42(%rbp), %eax
movq -0x30(%rbp), %rcx
movswl 0x3e(%rcx), %ecx
subl $0x1, %ecx
sarl %ecx
addl %ecx, %eax
movw %ax, -0x9c(%rbp)
movswl -0x40(%rbp), %eax
movq -0x30(%rbp), %rcx
movswl 0x3e(%rcx), %ecx
subl $0x1, %ecx
sarl %ecx
addl %ecx, %eax
movw %ax, -0x9a(%rbp)
movq -0x18(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
leaq -0x98(%rbp), %rdx
movzbl -0x31(%rbp), %ecx
callq 0x5a9e0
jmp 0x16252
movw -0x4a(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x4a(%rbp)
jmp 0x1609e
movq -0x30(%rbp), %rax
movb 0x41(%rax), %al
andb $0x1, %al
cmpb $0x0, %al
je 0x16317
movswl -0x46(%rbp), %eax
movq -0x30(%rbp), %rcx
movswl 0x3e(%rcx), %ecx
subl $0x1, %ecx
sarl %ecx
subl %ecx, %eax
movq -0x30(%rbp), %rcx
movswl 0x3e(%rcx), %ecx
subl $0x1, %ecx
andl $0x1, %ecx
subl %ecx, %eax
movw %ax, -0xa0(%rbp)
movswl -0x44(%rbp), %eax
movq -0x30(%rbp), %rcx
movswl 0x3e(%rcx), %ecx
subl $0x1, %ecx
sarl %ecx
subl %ecx, %eax
movq -0x30(%rbp), %rcx
movswl 0x3e(%rcx), %ecx
subl $0x1, %ecx
andl $0x1, %ecx
subl %ecx, %eax
movw %ax, -0x9e(%rbp)
movswl -0x46(%rbp), %eax
movq -0x30(%rbp), %rcx
movswl 0x3e(%rcx), %ecx
subl $0x1, %ecx
sarl %ecx
addl %ecx, %eax
movw %ax, -0x9c(%rbp)
movswl -0x44(%rbp), %eax
movq -0x30(%rbp), %rcx
movswl 0x3e(%rcx), %ecx
subl $0x1, %ecx
sarl %ecx
addl %ecx, %eax
movw %ax, -0x9a(%rbp)
movq -0x18(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
leaq -0x98(%rbp), %rdx
movzbl -0x31(%rbp), %ecx
callq 0x5a9e0
jmp 0x16319
jmp 0x1631b
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)