// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movl %r9d, %ebx
movl %r8d, %ebp
movl %ecx, %r12d
movl %edx, %r15d
movl %esi, %r13d
movq %rdi, %r14
callq 0x80d4
testb %al, %al
je 0x18b1d
movl %r15d, 0xc(%rsp)
movq 0x210(%rsp), %r15
movq %r15, %rdi
callq 0x80d4
testb %al, %al
je 0x18b2e
movl %r12d, 0x8(%rsp)
movq %r14, %rdi
callq 0x176bd
movq %rax, %r14
xorl %eax, %eax
movw %ax, (%rsp)
movl (%r14), %ecx
shrl $0xa, %ecx
movl $0x7ff, %edx            # imm = 0x7FF
andl %edx, %ecx
movl $0x7ff, %r12d           # imm = 0x7FF
decl %ecx
movw %cx, 0x4(%rsp)
movw %ax, 0x2(%rsp)
movl (%r14), %eax
shrl $0x15, %eax
decl %eax
movw %ax, 0x6(%rsp)
leaq 0x38(%rsp), %r15
movl $0x1a0, %edx            # imm = 0x1A0
movq %r15, %rdi
xorl %esi, %esi
callq 0x20a0
movq 0x8(%r14), %rsi
movl (%r14), %ecx
movl %ecx, %eax
shrl $0xa, %eax
andl %r12d, %eax
shrl $0x15, %ecx
imull %eax, %ecx
leaq 0x10(%rsp), %r12
movq %r12, %rdi
xorl %edx, %edx
callq 0x8350
movq (%rsp), %rax
movq %rax, 0x1c(%r12)
movq %r15, %rdi
callq 0x831c
movq %r12, 0x8(%r15)
movl (%r14), %eax
shrl $0xa, %eax
movl $0x7ff, %ecx            # imm = 0x7FF
andl %ecx, %eax
movw %ax, (%r15)
movl (%r14), %eax
shrl $0x15, %eax
movw %ax, 0x2(%r15)
movq 0x210(%rsp), %r15
movl (%r14), %eax
andl $0x1f, %eax
cmpl $0x6, %eax
jne 0x18ac1
cmpw $0x7e0, 0x2(%r15)       # imm = 0x7E0
jne 0x18ac1
cmpw $0x7e0, 0x4(%r15)       # imm = 0x7E0
jne 0x18ac1
andb $-0x2, 0x48(%rsp)
callq 0x72ad
movq %rax, %r14
leaq 0x38(%rsp), %rdi
callq 0x72b5
movl $0xffff, %eax           # imm = 0xFFFF
andl %eax, %ebp
andl %eax, %ebx
movswl %r13w, %edi
movswl 0xc(%rsp), %esi
movzwl 0x8(%rsp), %edx
movq %rsp, %rcx
movl %ebp, %r8d
movl %ebx, %r9d
pushq $0xff
pushq %r15
callq 0x3c64c
addq $0x10, %rsp
movq %r14, %rdi
callq 0x72b5
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x26610(%rip), %rdi     # 0x3f134
movq %r14, %rsi
callq 0x829e
jmp 0x18b2c
leaq 0x265ff(%rip), %rdi     # 0x3f134
movq %r15, %rsi
callq 0x829e
jmp 0x18b3d
nop