// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_arc.c
// Function: lv_arc_design
static bool lv_arc_design(lv_obj_t * arc, const lv_area_t * mask, lv_design_mode_t mode)
{
    /*Return false if the object is not covers the mask_p area*/
    if(mode == LV_DESIGN_COVER_CHK) {
        return false;
    }
    /*Draw the object*/
    else if(mode == LV_DESIGN_DRAW_MAIN) {
        lv_arc_ext_t * ext       = lv_obj_get_ext_attr(arc);
        const lv_style_t * style = lv_arc_get_style(arc, LV_ARC_STYLE_MAIN);

        lv_coord_t r       = (LV_MATH_MIN(lv_obj_get_width(arc), lv_obj_get_height(arc))) / 2;
        lv_coord_t x       = arc->coords.x1 + lv_obj_get_width(arc) / 2;
        lv_coord_t y       = arc->coords.y1 + lv_obj_get_height(arc) / 2;
        lv_opa_t opa_scale = lv_obj_get_opa_scale(arc);
        lv_draw_arc(x, y, r, mask, ext->angle_start, ext->angle_end, style, opa_scale);

        /*Draw circle on the ends if enabled */
        if(style->line.rounded) {
            lv_coord_t thick_half = style->line.width / 2;
            lv_coord_t cir_x      = ((r - thick_half) * lv_trigo_sin(ext->angle_start) >> LV_TRIGO_SHIFT);
            lv_coord_t cir_y      = ((r - thick_half) * lv_trigo_sin(ext->angle_start + 90) >> LV_TRIGO_SHIFT);

            lv_style_t cir_style;
            lv_style_copy(&cir_style, &lv_style_plain);
            cir_style.body.grad_color = style->line.color;
            cir_style.body.main_color = cir_style.body.grad_color;
            cir_style.body.radius     = LV_RADIUS_CIRCLE;
            lv_area_t cir_area;
            cir_area.x1 = cir_x + x - thick_half;
            cir_area.y1 = cir_y + y - thick_half;
            cir_area.x2 = cir_x + x + thick_half;
            cir_area.y2 = cir_y + y + thick_half;

            lv_draw_rect(&cir_area, mask, &cir_style, opa_scale);

            cir_x = ((r - thick_half) * lv_trigo_sin(ext->angle_end) >> LV_TRIGO_SHIFT);
            cir_y = ((r - thick_half) * lv_trigo_sin(ext->angle_end + 90) >> LV_TRIGO_SHIFT);

            cir_area.x1 = cir_x + x - thick_half;
            cir_area.y1 = cir_y + y - thick_half;
            cir_area.x2 = cir_x + x + thick_half;
            cir_area.y2 = cir_y + y + thick_half;

            lv_draw_rect(&cir_area, mask, &cir_style, opa_scale);
        }

    }
    /*Post draw when the children are drawn*/
    else if(mode == LV_DESIGN_DRAW_POST) {
    }

    return true;
}

// Assembly:
testl %edx, %edx
jne 0x8c1a
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %rbx
movq %rdi, %r13
movl %edx, 0xc(%rsp)
callq 0x6ad8
movq %rax, 0x30(%rsp)
movq %r13, %rdi
xorl %esi, %esi
callq 0x8d10
movq %rax, 0x10(%rsp)
movq %r13, %rdi
callq 0x5651
movl %eax, %ebp
movq %r13, %rdi
callq 0x567b
cmpw %ax, %bp
movq %rbx, 0x18(%rsp)
movq %r13, %rdi
jge 0x8a2d
callq 0x5651
jmp 0x8a32
callq 0x567b
movzwl %ax, %ecx
shrl $0xf, %ecx
addl %eax, %ecx
movswl %cx, %r15d
shrl %r15d
movzwl 0x20(%r13), %ebx
movq %r13, %rdi
callq 0x5651
movzwl %ax, %ecx
shrl $0xf, %ecx
addl %eax, %ecx
movswl %cx, %ebp
shrl %ebp
addw %bx, %bp
movzwl 0x22(%r13), %ebx
movq %r13, %rdi
callq 0x567b
movzwl %ax, %ecx
shrl $0xf, %ecx
addl %eax, %ecx
movswl %cx, %r14d
shrl %r14d
addw %bx, %r14w
movq %r13, %rdi
callq 0x69cc
movq 0x30(%rsp), %r13
movzwl (%r13), %r8d
movzwl 0x2(%r13), %r9d
movzbl %al, %eax
movzwl %r15w, %edx
movswl %bp, %edi
movswl %r14w, %esi
movq 0x18(%rsp), %rcx
movq %rax, 0x28(%rsp)
pushq %rax
movq 0x18(%rsp), %r12
pushq %r12
callq 0x3c64c
addq $0x10, %rsp
testb $0x1, 0x41(%r12)
movl 0xc(%rsp), %edx
je 0x8c09
movq 0x10(%rsp), %rax
movzwl 0x3e(%rax), %eax
movl %eax, %ecx
shrl $0xf, %ecx
addl %eax, %ecx
movq %r13, %rax
movswl %cx, %r13d
sarl %r13d
subl %r13d, %r15d
movswl %r15w, %r12d
movswl (%rax), %edi
movq %rax, %rbx
callq 0x2ad8c
movswl %ax, %r15d
imull %r12d, %r15d
movl %r12d, 0x24(%rsp)
movzwl (%rbx), %eax
addl $0x5a, %eax
movswl %ax, %edi
callq 0x2ad8c
movswl %ax, %ebx
imull %r12d, %ebx
leaq 0x573f5(%rip), %rsi     # 0x5ff18
leaq 0x40(%rsp), %r12
movq %r12, %rdi
callq 0x798d
movq 0x10(%rsp), %rax
movzwl 0x3c(%rax), %eax
movw %ax, 0x4(%r12)
movw %ax, 0x2(%r12)
movw $0x7c18, 0x6(%r12)      # imm = 0x7C18
shrl $0xf, %r15d
addl %ebp, %r15d
movl %r15d, %eax
subl %r13d, %eax
leaq 0x38(%rsp), %rdi
movw %ax, (%rdi)
shrl $0xf, %ebx
addl %r14d, %ebx
movl %ebx, %eax
subl %r13d, %eax
movw %ax, 0x2(%rdi)
addl %r13d, %r15d
movw %r15w, 0x4(%rdi)
addl %r13d, %ebx
movw %bx, 0x6(%rdi)
movq 0x18(%rsp), %rsi
movq %r12, %rdx
movq 0x28(%rsp), %rcx
callq 0x365ac
movq 0x30(%rsp), %r15
movswl 0x2(%r15), %edi
callq 0x2ad8c
movswl %ax, %ebx
movl 0x24(%rsp), %r12d
imull %r12d, %ebx
movzwl 0x2(%r15), %eax
addl $0x5a, %eax
movswl %ax, %edi
callq 0x2ad8c
cwtl
imull %r12d, %eax
shrl $0xf, %ebx
addl %ebp, %ebx
movl %ebx, %ecx
subl %r13d, %ecx
leaq 0x38(%rsp), %rdi
movw %cx, (%rdi)
shrl $0xf, %eax
addl %r14d, %eax
movl %eax, %ecx
subl %r13d, %ecx
movw %cx, 0x2(%rdi)
addl %r13d, %ebx
movw %bx, 0x4(%rdi)
addl %r13d, %eax
movw %ax, 0x6(%rdi)
movq 0x18(%rsp), %rsi
leaq 0x40(%rsp), %rdx
movq 0x28(%rsp), %rcx
callq 0x365ac
movl 0xc(%rsp), %edx
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
cmpb $0x2, %dl
setne %al
retq