// File: /workspace/github_c_makefile_star2_O2/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_draw_list_path_arc_to
NK_API void
nk_draw_list_path_arc_to(struct nk_draw_list *list, struct nk_vec2 center,
    float radius, float a_min, float a_max, unsigned int segments)
{
    unsigned int i = 0;
    NK_ASSERT(list);
    if (!list) return;
    if (radius == 0.0f) return;

    /*  This algorithm for arc drawing relies on these two trigonometric identities[1]:
            sin(a + b) = sin(a) * cos(b) + cos(a) * sin(b)
            cos(a + b) = cos(a) * cos(b) - sin(a) * sin(b)

        Two coordinates (x, y) of a point on a circle centered on
        the origin can be written in polar form as:
            x = r * cos(a)
            y = r * sin(a)
        where r is the radius of the circle,
            a is the angle between (x, y) and the origin.

        This allows us to rotate the coordinates around the
        origin by an angle b using the following transformation:
            x' = r * cos(a + b) = x * cos(b) - y * sin(b)
            y' = r * sin(a + b) = y * cos(b) + x * sin(b)

        [1] https://en.wikipedia.org/wiki/List_of_trigonometric_identities#Angle_sum_and_difference_identities
    */
    {const float d_angle = (a_max - a_min) / (float)segments;
    const float sin_d = (float)NK_SIN(d_angle);
    const float cos_d = (float)NK_COS(d_angle);

    float cx = (float)NK_COS(a_min) * radius;
    float cy = (float)NK_SIN(a_min) * radius;
    for(i = 0; i <= segments; ++i) {
        float new_cx, new_cy;
        const float x = center.x + cx;
        const float y = center.y + cy;
        nk_draw_list_path_line_to(list, nk_vec2(x, y));

        new_cx = cx * cos_d - cy * sin_d;
        new_cy = cy * cos_d + cx * sin_d;
        cx = new_cx;
        cy = new_cy;
    }}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x60, %rsp
movaps %xmm0, 0x50(%rsp)
testq %rdi, %rdi
je 0x28f6c
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x28fa0
jp 0x28fa0
addq $0x60, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x5c07d(%rip), %rbx     # 0x84ff0
movq (%rbx), %rdi
leaq 0x40d8f(%rip), %rsi     # 0x69d0c
leaq 0x40da6(%rip), %rdx     # 0x69d2a
movl $0x284f, %ecx           # imm = 0x284F
xorl %eax, %eax
callq 0x12ea0
movq (%rbx), %rdi
addq $0x60, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x13960
movl %esi, %ebx
movq %rdi, %r14
subss %xmm2, %xmm3
movl %esi, %eax
cvtsi2ss %rax, %xmm0
divss %xmm0, %xmm3
movss %xmm3, 0x20(%rsp)
movaps %xmm3, %xmm0
movaps %xmm1, 0x10(%rsp)
movss %xmm2, 0xc(%rsp)
callq 0x122f0
movaps %xmm0, 0x30(%rsp)
movss 0x20(%rsp), %xmm0
callq 0x127f0
movaps %xmm0, 0x20(%rsp)
movss 0xc(%rsp), %xmm0
callq 0x127f0
movaps %xmm0, 0x40(%rsp)
movss 0xc(%rsp), %xmm0
callq 0x122f0
movaps 0x10(%rsp), %xmm1
movaps 0x40(%rsp), %xmm2
unpcklps %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
shufps $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
mulps %xmm2, %xmm1
movaps 0x20(%rsp), %xmm0
shufps $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movaps %xmm0, 0x20(%rsp)
movaps 0x30(%rsp), %xmm0
shufps $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movaps %xmm0, 0x30(%rsp)
xorl %ebp, %ebp
cmpl %ebx, %ebp
ja 0x28f63
movaps %xmm1, %xmm0
addps 0x50(%rsp), %xmm0
movq %r14, %rdi
movaps %xmm1, 0x10(%rsp)
callq 0x12a20
movaps 0x10(%rsp), %xmm0
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
xorps 0x3d514(%rip), %xmm0    # 0x66570
movaps 0x10(%rsp), %xmm1
shufps $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
movss %xmm0, %xmm1            # xmm1 = xmm0[0],xmm1[1,2,3]
mulps 0x30(%rsp), %xmm1
movaps 0x10(%rsp), %xmm0
mulps 0x20(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
movaps 0x10(%rsp), %xmm0
addps %xmm1, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps 0x10(%rsp), %xmm1
incl %ebp
jmp 0x2902f