// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x58, %rsp
movlpd %xmm0, 0x50(%rsp)
movq %rdi, 0x48(%rsp)
movss %xmm1, 0x44(%rsp)
movss %xmm2, 0x40(%rsp)
movss %xmm3, 0x3c(%rsp)
movl %esi, 0x38(%rsp)
movl $0x0, 0x34(%rsp)
cmpq $0x0, 0x48(%rsp)
jne 0x38c18
movq 0x8c404(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
leaq 0x787aa(%rip), %rsi     # 0xb13a0
leaq 0x787c1(%rip), %rdx     # 0xb13be
movl $0x284f, %ecx           # imm = 0x284F
movb $0x0, %al
callq 0x13ec0
movq 0x8c3e0(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
callq 0x149a0
jmp 0x38c1a
cmpq $0x0, 0x48(%rsp)
jne 0x38c27
jmp 0x38da1
movss 0x44(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x38c3c
jp 0x38c3c
jmp 0x38da1
movss 0x3c(%rsp), %xmm0
movss 0x40(%rsp), %xmm1
subss %xmm1, %xmm0
movl 0x38(%rsp), %eax
cvtsi2ss %rax, %xmm1
divss %xmm1, %xmm0
movss %xmm0, 0x30(%rsp)
movss 0x30(%rsp), %xmm0
callq 0x132f0
movss %xmm0, 0x2c(%rsp)
movss 0x30(%rsp), %xmm0
callq 0x13820
movss %xmm0, 0x28(%rsp)
movss 0x40(%rsp), %xmm0
callq 0x13820
mulss 0x44(%rsp), %xmm0
movss %xmm0, 0x24(%rsp)
movss 0x40(%rsp), %xmm0
callq 0x132f0
mulss 0x44(%rsp), %xmm0
movss %xmm0, 0x20(%rsp)
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x38(%rsp), %eax
ja 0x38da1
movss 0x50(%rsp), %xmm0
movss 0x24(%rsp), %xmm1
addss %xmm1, %xmm0
movss %xmm0, 0x14(%rsp)
movss 0x54(%rsp), %xmm0
movss 0x20(%rsp), %xmm1
addss %xmm1, %xmm0
movss %xmm0, 0x10(%rsp)
movq 0x48(%rsp), %rax
movq %rax, (%rsp)
movss 0x14(%rsp), %xmm0
movss 0x10(%rsp), %xmm1
callq 0x13460
movq (%rsp), %rdi
movlpd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x13a50
movss 0x24(%rsp), %xmm0
movss 0x28(%rsp), %xmm2
movss 0x20(%rsp), %xmm1
mulss 0x2c(%rsp), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x20(%rsp), %xmm0
movss 0x28(%rsp), %xmm2
movss 0x24(%rsp), %xmm1
mulss 0x2c(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x18(%rsp)
movss 0x1c(%rsp), %xmm0
movss %xmm0, 0x24(%rsp)
movss 0x18(%rsp), %xmm0
movss %xmm0, 0x20(%rsp)
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x38cb7
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)