// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_canvas.c
// Function: lv_canvas_draw_arc
void lv_canvas_draw_arc(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord_t r, int32_t start_angle,
                        int32_t end_angle, const lv_style_t * style)
{
    LV_ASSERT_OBJ(canvas, LV_OBJX_NAME);
    LV_ASSERT_NULL(style);

    lv_img_dsc_t * dsc = lv_canvas_get_img(canvas);

    /* Create a dummy display to fool the lv_draw function.
     * It will think it draws to real screen. */
    lv_area_t mask;
    mask.x1 = 0;
    mask.x2 = dsc->header.w - 1;
    mask.y1 = 0;
    mask.y2 = dsc->header.h - 1;

    lv_disp_t disp;
    memset(&disp, 0, sizeof(lv_disp_t));

    lv_disp_buf_t disp_buf;
    lv_disp_buf_init(&disp_buf, (void *)dsc->data, NULL, dsc->header.w * dsc->header.h);
    lv_area_copy(&disp_buf.area, &mask);

    lv_disp_drv_init(&disp.driver);

    disp.driver.buffer  = &disp_buf;
    disp.driver.hor_res = dsc->header.w;
    disp.driver.ver_res = dsc->header.h;

#if LV_ANTIALIAS
    /*Disable anti-aliasing if drawing with transparent color to chroma keyed canvas*/
    lv_color_t ctransp = LV_COLOR_TRANSP;
    if(dsc->header.cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED &&
        style->body.main_color.full == ctransp.full &&
        style->body.grad_color.full == ctransp.full)
    {
        disp.driver.antialiasing = 0;
    }
#endif

    lv_disp_t * refr_ori = lv_refr_get_disp_refreshing();
    lv_refr_set_disp_refreshing(&disp);

    lv_draw_arc(x, y, r, &mask, start_angle, end_angle, style, LV_OPA_COVER);

    lv_refr_set_disp_refreshing(refr_ori);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x210, %rsp            # imm = 0x210
movw %cx, %ax
movw %dx, %cx
movw %si, %dx
movq 0x10(%rbp), %rsi
movq %rdi, -0x8(%rbp)
movw %dx, -0xa(%rbp)
movw %cx, -0xc(%rbp)
movw %ax, -0xe(%rbp)
movl %r8d, -0x14(%rbp)
movl %r9d, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x285ef
movq -0x8(%rbp), %rsi
leaq 0x3fb14(%rip), %rdi     # 0x680fc
callq 0xd410
jmp 0x285ed
movq 0x10(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x2860e
movq 0x10(%rbp), %rsi
leaq 0x3faf5(%rip), %rdi     # 0x680fc
callq 0xd410
jmp 0x2860c
movq -0x8(%rbp), %rdi
callq 0x26c90
movq %rax, -0x20(%rbp)
movw $0x0, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
shrl $0xa, %eax
andl $0x7ff, %eax            # imm = 0x7FF
subl $0x1, %eax
movw %ax, -0x24(%rbp)
movw $0x0, -0x26(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
shrl $0x15, %eax
subl $0x1, %eax
movw %ax, -0x22(%rbp)
leaq -0x1c8(%rbp), %rdi
xorl %esi, %esi
movl $0x1a0, %edx            # imm = 0x1A0
callq 0x2090
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x20(%rbp), %rax
movl (%rax), %ecx
shrl $0xa, %ecx
andl $0x7ff, %ecx            # imm = 0x7FF
movq -0x20(%rbp), %rax
movl (%rax), %eax
shrl $0x15, %eax
imull %eax, %ecx
leaq -0x1f0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
callq 0xd660
leaq -0x1f0(%rbp), %rdi
addq $0x1c, %rdi
leaq -0x28(%rbp), %rsi
callq 0x27b20
leaq -0x1c8(%rbp), %rdi
callq 0xd5a0
leaq -0x1f0(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
shrl $0xa, %eax
andl $0x7ff, %eax            # imm = 0x7FF
movw %ax, -0x1c8(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
shrl $0x15, %eax
movw %ax, -0x1c6(%rbp)
movw 0x3feea(%rip), %ax      # 0x685d6
movw %ax, -0x1f2(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0x1f, %eax
cmpl $0x6, %eax
jne 0x28737
movq 0x10(%rbp), %rax
movzwl 0x2(%rax), %eax
movzwl -0x1f2(%rbp), %ecx
cmpl %ecx, %eax
jne 0x28737
movq 0x10(%rbp), %rax
movzwl 0x4(%rax), %eax
movzwl -0x1f2(%rbp), %ecx
cmpl %ecx, %eax
jne 0x28737
movb -0x1b8(%rbp), %al
andb $-0x2, %al
orb $0x0, %al
movb %al, -0x1b8(%rbp)
callq 0xafe0
movq %rax, -0x200(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0xaff0
movw -0xa(%rbp), %di
movw -0xc(%rbp), %si
movw -0xe(%rbp), %dx
movl -0x14(%rbp), %eax
movw %ax, %r8w
movl -0x18(%rbp), %eax
movw %ax, %r9w
movq 0x10(%rbp), %rax
leaq -0x28(%rbp), %rcx
movswl %di, %edi
movswl %si, %esi
movzwl %dx, %edx
movzwl %r8w, %r8d
movzwl %r9w, %r9d
movq %rax, (%rsp)
movl $0xff, 0x8(%rsp)
callq 0x634d0
movq -0x200(%rbp), %rdi
callq 0xaff0
addq $0x210, %rsp            # imm = 0x210
popq %rbp
retq
nopl (%rax,%rax)