// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_draw_list_fill_poly_convex
NK_API void
nk_draw_list_fill_poly_convex(struct nk_draw_list *list,
    const struct nk_vec2 *points, const unsigned int points_count,
    struct nk_color color, enum nk_anti_aliasing aliasing)
{
    struct nk_colorf col;
    struct nk_colorf col_trans;

    NK_STORAGE const nk_size pnt_align = NK_ALIGNOF(struct nk_vec2);
    NK_STORAGE const nk_size pnt_size = sizeof(struct nk_vec2);
    NK_ASSERT(list);
    if (!list || points_count < 3) return;

#ifdef NK_INCLUDE_COMMAND_USERDATA
    nk_draw_list_push_userdata(list, list->userdata);
#endif

    color.a = (nk_byte)((float)color.a * list->config.global_alpha);
    nk_color_fv(&col.r, color);
    col_trans = col;
    col_trans.a = 0;

    if (aliasing == NK_ANTI_ALIASING_ON) {
        nk_size i = 0;
        nk_size i0 = 0;
        nk_size i1 = 0;

        const float AA_SIZE = 1.0f;
        nk_size vertex_offset = 0;
        nk_size index = list->vertex_count;

        const nk_size idx_count = (points_count-2)*3 + points_count*6;
        const nk_size vtx_count = (points_count*2);

        void *vtx = nk_draw_list_alloc_vertices(list, vtx_count);
        nk_draw_index *ids = nk_draw_list_alloc_elements(list, idx_count);

        nk_size size = 0;
        struct nk_vec2 *normals = 0;
        unsigned int vtx_inner_idx = (unsigned int)(index + 0);
        unsigned int vtx_outer_idx = (unsigned int)(index + 1);
        if (!vtx || !ids) return;

        /* temporary allocate normals */
        vertex_offset = (nk_size)((nk_byte*)vtx - (nk_byte*)list->vertices->memory.ptr);
        nk_buffer_mark(list->vertices, NK_BUFFER_FRONT);
        size = pnt_size * points_count;
        normals = (struct nk_vec2*) nk_buffer_alloc(list->vertices, NK_BUFFER_FRONT, size, pnt_align);
        if (!normals) return;
        vtx = (void*)((nk_byte*)list->vertices->memory.ptr + vertex_offset);

        /* add elements */
        for (i = 2; i < points_count; i++) {
            ids[0] = (nk_draw_index)(vtx_inner_idx);
            ids[1] = (nk_draw_index)(vtx_inner_idx + ((i-1) << 1));
            ids[2] = (nk_draw_index)(vtx_inner_idx + (i << 1));
            ids += 3;
        }

        /* compute normals */
        for (i0 = points_count-1, i1 = 0; i1 < points_count; i0 = i1++) {
            struct nk_vec2 p0 = points[i0];
            struct nk_vec2 p1 = points[i1];
            struct nk_vec2 diff = nk_vec2_sub(p1, p0);

            /* vec2 inverted length  */
            float len = nk_vec2_len_sqr(diff);
            if (len != 0.0f)
                len = NK_INV_SQRT(len);
            else len = 1.0f;
            diff = nk_vec2_muls(diff, len);

            normals[i0].x = diff.y;
            normals[i0].y = -diff.x;
        }

        /* add vertices + indexes */
        for (i0 = points_count-1, i1 = 0; i1 < points_count; i0 = i1++) {
            const struct nk_vec2 uv = list->config.tex_null.uv;
            struct nk_vec2 n0 = normals[i0];
            struct nk_vec2 n1 = normals[i1];
            struct nk_vec2 dm = nk_vec2_muls(nk_vec2_add(n0, n1), 0.5f);
            float dmr2 = dm.x*dm.x + dm.y*dm.y;
            if (dmr2 > 0.000001f) {
                float scale = 1.0f / dmr2;
                scale = NK_MIN(scale, 100.0f);
                dm = nk_vec2_muls(dm, scale);
            }
            dm = nk_vec2_muls(dm, AA_SIZE * 0.5f);

            /* add vertices */
            vtx = nk_draw_vertex(vtx, &list->config, nk_vec2_sub(points[i1], dm), uv, col);
            vtx = nk_draw_vertex(vtx, &list->config, nk_vec2_add(points[i1], dm), uv, col_trans);

            /* add indexes */
            ids[0] = (nk_draw_index)(vtx_inner_idx+(i1<<1));
            ids[1] = (nk_draw_index)(vtx_inner_idx+(i0<<1));
            ids[2] = (nk_draw_index)(vtx_outer_idx+(i0<<1));
            ids[3] = (nk_draw_index)(vtx_outer_idx+(i0<<1));
            ids[4] = (nk_draw_index)(vtx_outer_idx+(i1<<1));
            ids[5] = (nk_draw_index)(vtx_inner_idx+(i1<<1));
            ids += 6;
        }
        /* free temporary normals + points */
        nk_buffer_reset(list->vertices, NK_BUFFER_FRONT);
    } else {
        nk_size i = 0;
        nk_size index = list->vertex_count;
        const nk_size idx_count = (points_count-2)*3;
        const nk_size vtx_count = points_count;
        void *vtx = nk_draw_list_alloc_vertices(list, vtx_count);
        nk_draw_index *ids = nk_draw_list_alloc_elements(list, idx_count);

        if (!vtx || !ids) return;
        for (i = 0; i < vtx_count; ++i)
            vtx = nk_draw_vertex(vtx, &list->config, points[i], list->config.tex_null.uv, col);
        for (i = 2; i < points_count; ++i) {
            ids[0] = (nk_draw_index)index;
            ids[1] = (nk_draw_index)(index+ i - 1);
            ids[2] = (nk_draw_index)(index+i);
            ids += 3;
        }
    }
}

// Assembly:
subq $0x188, %rsp            # imm = 0x188
movl %ecx, 0x184(%rsp)
movq %rdi, 0x178(%rsp)
movq %rsi, 0x170(%rsp)
movl %edx, 0x16c(%rsp)
movl %r8d, 0x168(%rsp)
cmpq $0x0, 0x178(%rsp)
jne 0x37a7b
movq 0x8d5a1(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
leaq 0x79947(%rip), %rsi     # 0xb13a0
leaq 0x7995e(%rip), %rdx     # 0xb13be
movl $0x27ad, %ecx           # imm = 0x27AD
movb $0x0, %al
callq 0x13ec0
movq 0x8d57d(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
callq 0x149a0
jmp 0x37a7d
cmpq $0x0, 0x178(%rsp)
je 0x37a92
cmpl $0x3, 0x16c(%rsp)
jae 0x37a97
jmp 0x38579
movzbl 0x187(%rsp), %eax
cvtsi2ss %eax, %xmm0
movq 0x178(%rsp), %rax
movss 0x70(%rax), %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movb %al, 0x187(%rsp)
leaq 0x158(%rsp), %rdi
movl 0x184(%rsp), %esi
callq 0x13870
movq 0x158(%rsp), %rax
movq %rax, 0x148(%rsp)
movq 0x160(%rsp), %rax
movq %rax, 0x150(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x154(%rsp)
cmpl $0x1, 0x168(%rsp)
jne 0x38411
movq $0x0, 0x140(%rsp)
movq $0x0, 0x138(%rsp)
movq $0x0, 0x130(%rsp)
movss 0x759af(%rip), %xmm0    # 0xad4e8
movss %xmm0, 0x12c(%rsp)
movq $0x0, 0x120(%rsp)
movq 0x178(%rsp), %rax
movl 0xcc(%rax), %eax
movq %rax, 0x118(%rsp)
movl 0x16c(%rsp), %eax
subl $0x2, %eax
imull $0x3, %eax, %eax
imull $0x6, 0x16c(%rsp), %ecx
addl %ecx, %eax
movl %eax, %eax
movq %rax, 0x110(%rsp)
movl 0x16c(%rsp), %eax
shll %eax
movl %eax, %eax
movq %rax, 0x108(%rsp)
movq 0x178(%rsp), %rdi
movq 0x108(%rsp), %rsi
callq 0x37600
movq %rax, 0x100(%rsp)
movq 0x178(%rsp), %rdi
movq 0x110(%rsp), %rsi
callq 0x37730
movq %rax, 0xf8(%rsp)
movq $0x0, 0xf0(%rsp)
movq $0x0, 0xe8(%rsp)
movq 0x118(%rsp), %rax
addq $0x0, %rax
movl %eax, 0xe4(%rsp)
movq 0x118(%rsp), %rax
addq $0x1, %rax
movl %eax, 0xe0(%rsp)
cmpq $0x0, 0x100(%rsp)
je 0x37c26
cmpq $0x0, 0xf8(%rsp)
jne 0x37c2b
jmp 0x38579
movq 0x100(%rsp), %rax
movq 0x178(%rsp), %rcx
movq 0xb8(%rcx), %rcx
movq 0x40(%rcx), %rcx
subq %rcx, %rax
movq %rax, 0x120(%rsp)
movq 0x178(%rsp), %rax
movq 0xb8(%rax), %rdi
xorl %esi, %esi
callq 0x15110
movl 0x16c(%rsp), %eax
shlq $0x3, %rax
movq %rax, 0xf0(%rsp)
movq 0x178(%rsp), %rax
movq 0xb8(%rax), %rdi
movq 0xf0(%rsp), %rdx
xorl %esi, %esi
movl $0x4, %ecx
callq 0x2f2e0
movq %rax, 0xe8(%rsp)
cmpq $0x0, 0xe8(%rsp)
jne 0x37cb5
jmp 0x38579
movq 0x178(%rsp), %rax
movq 0xb8(%rax), %rax
movq 0x40(%rax), %rax
addq 0x120(%rsp), %rax
movq %rax, 0x100(%rsp)
movq $0x2, 0x140(%rsp)
movq 0x140(%rsp), %rax
movl 0x16c(%rsp), %ecx
cmpq %rcx, %rax
jae 0x37d8a
movl 0xe4(%rsp), %eax
movw %ax, %cx
movq 0xf8(%rsp), %rax
movw %cx, (%rax)
movl 0xe4(%rsp), %eax
movq 0x140(%rsp), %rcx
subq $0x1, %rcx
shlq %rcx
addq %rcx, %rax
movw %ax, %cx
movq 0xf8(%rsp), %rax
movw %cx, 0x2(%rax)
movl 0xe4(%rsp), %eax
movq 0x140(%rsp), %rcx
shlq %rcx
addq %rcx, %rax
movw %ax, %cx
movq 0xf8(%rsp), %rax
movw %cx, 0x4(%rax)
movq 0xf8(%rsp), %rax
addq $0x6, %rax
movq %rax, 0xf8(%rsp)
movq 0x140(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x140(%rsp)
jmp 0x37ce4
movl 0x16c(%rsp), %eax
subl $0x1, %eax
movl %eax, %eax
movq %rax, 0x138(%rsp)
movq $0x0, 0x130(%rsp)
movq 0x130(%rsp), %rax
movl 0x16c(%rsp), %ecx
cmpq %rcx, %rax
jae 0x37f57
movq 0x170(%rsp), %rax
movq 0x138(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0xd8(%rsp)
movq 0x170(%rsp), %rax
movq 0x130(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0xd0(%rsp)
movss 0xd0(%rsp), %xmm0
movss 0xd4(%rsp), %xmm1
movss 0xd8(%rsp), %xmm3
movss 0xdc(%rsp), %xmm2
subss %xmm3, %xmm0
subss %xmm2, %xmm1
callq 0x13460
movlpd %xmm0, 0xc8(%rsp)
movss 0xc8(%rsp), %xmm0
movss 0xc8(%rsp), %xmm2
movss 0xcc(%rsp), %xmm1
mulss 0xcc(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0xc4(%rsp)
movss 0xc4(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x37e7e
jp 0x37e7e
jmp 0x37e97
movss 0xc4(%rsp), %xmm0
callq 0x37810
movss %xmm0, 0xc4(%rsp)
jmp 0x37ea8
movss 0x75649(%rip), %xmm0    # 0xad4e8
movss %xmm0, 0xc4(%rsp)
movss 0xc4(%rsp), %xmm2
movss 0xc8(%rsp), %xmm0
movss 0xcc(%rsp), %xmm1
mulss %xmm2, %xmm0
mulss %xmm2, %xmm1
callq 0x13460
movlpd %xmm0, 0xbc(%rsp)
movq 0xbc(%rsp), %rax
movq %rax, 0xc8(%rsp)
movss 0xcc(%rsp), %xmm0
movq 0xe8(%rsp), %rax
movq 0x138(%rsp), %rcx
movss %xmm0, (%rax,%rcx,8)
movss 0xc8(%rsp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movq 0xe8(%rsp), %rax
movq 0x138(%rsp), %rcx
movss %xmm0, 0x4(%rax,%rcx,8)
movq 0x130(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x130(%rsp)
movq %rax, 0x138(%rsp)
jmp 0x37daa
movl 0x16c(%rsp), %eax
subl $0x1, %eax
movl %eax, %eax
movq %rax, 0x138(%rsp)
movq $0x0, 0x130(%rsp)
movq 0x130(%rsp), %rax
movl 0x16c(%rsp), %ecx
cmpq %rcx, %rax
jae 0x383f6
movq 0x178(%rsp), %rax
movq 0x90(%rax), %rax
movq %rax, 0xb0(%rsp)
movq 0xe8(%rsp), %rax
movq 0x138(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0xa8(%rsp)
movq 0xe8(%rsp), %rax
movq 0x130(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0xa0(%rsp)
movss 0xa8(%rsp), %xmm0
movss 0xac(%rsp), %xmm1
movss 0xa0(%rsp), %xmm3
movss 0xa4(%rsp), %xmm2
addss %xmm3, %xmm0
addss %xmm2, %xmm1
callq 0x13460
movlpd %xmm0, 0x90(%rsp)
movss 0x90(%rsp), %xmm0
movss 0x754eb(%rip), %xmm1    # 0xad514
movss %xmm1, 0x28(%rsp)
mulss %xmm1, %xmm0
movss %xmm0, 0x2c(%rsp)
movss 0xa8(%rsp), %xmm0
movss 0xac(%rsp), %xmm1
movss 0xa0(%rsp), %xmm3
movss 0xa4(%rsp), %xmm2
addss %xmm3, %xmm0
addss %xmm2, %xmm1
callq 0x13460
movss 0x28(%rsp), %xmm2
movaps %xmm0, %xmm1
movss 0x2c(%rsp), %xmm0
movlpd %xmm1, 0x88(%rsp)
movss 0x8c(%rsp), %xmm1
mulss %xmm2, %xmm1
callq 0x13460
movlpd %xmm0, 0x98(%rsp)
movss 0x98(%rsp), %xmm0
movss 0x98(%rsp), %xmm2
movss 0x9c(%rsp), %xmm1
mulss 0x9c(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x84(%rsp)
movss 0x84(%rsp), %xmm0
movss 0x75435(%rip), %xmm1    # 0xad518
ucomiss %xmm1, %xmm0
jbe 0x38183
movss 0x753f4(%rip), %xmm0    # 0xad4e8
divss 0x84(%rsp), %xmm0
movss %xmm0, 0x80(%rsp)
movss 0x7540e(%rip), %xmm0    # 0xad51c
ucomiss 0x80(%rsp), %xmm0
jbe 0x38129
movss 0x80(%rsp), %xmm0
movss %xmm0, 0x24(%rsp)
jmp 0x38139
movss 0x753eb(%rip), %xmm0    # 0xad51c
movss %xmm0, 0x24(%rsp)
jmp 0x38139
movss 0x24(%rsp), %xmm0
movss %xmm0, 0x80(%rsp)
movss 0x80(%rsp), %xmm2
movss 0x98(%rsp), %xmm0
movss 0x9c(%rsp), %xmm1
mulss %xmm2, %xmm0
mulss %xmm2, %xmm1
callq 0x13460
movlpd %xmm0, 0x78(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x98(%rsp)
movss 0x98(%rsp), %xmm0
movss 0x9c(%rsp), %xmm1
movss 0x75377(%rip), %xmm2    # 0xad514
mulss %xmm2, %xmm0
mulss %xmm2, %xmm1
callq 0x13460
movlpd %xmm0, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x100(%rsp), %rax
movq %rax, (%rsp)
movq 0x178(%rsp), %rax
addq $0x70, %rax
movq %rax, 0x8(%rsp)
movq 0x170(%rsp), %rax
movq 0x130(%rsp), %rcx
movss (%rax,%rcx,8), %xmm0
movss 0x4(%rax,%rcx,8), %xmm1
movss 0x98(%rsp), %xmm3
movss 0x9c(%rsp), %xmm2
subss %xmm3, %xmm0
subss %xmm2, %xmm1
callq 0x13460
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movlpd %xmm0, 0x68(%rsp)
movsd 0x68(%rsp), %xmm0
movsd 0xb0(%rsp), %xmm1
movsd 0x158(%rsp), %xmm2
movsd 0x160(%rsp), %xmm3
callq 0x378c0
movq %rax, 0x100(%rsp)
movq 0x100(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x178(%rsp), %rax
addq $0x70, %rax
movq %rax, 0x18(%rsp)
movq 0x170(%rsp), %rax
movq 0x130(%rsp), %rcx
movss (%rax,%rcx,8), %xmm0
movss 0x4(%rax,%rcx,8), %xmm1
movss 0x98(%rsp), %xmm3
movss 0x9c(%rsp), %xmm2
addss %xmm3, %xmm0
addss %xmm2, %xmm1
callq 0x13460
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movlpd %xmm0, 0x60(%rsp)
movsd 0x60(%rsp), %xmm0
movsd 0xb0(%rsp), %xmm1
movsd 0x148(%rsp), %xmm2
movsd 0x150(%rsp), %xmm3
callq 0x378c0
movq %rax, 0x100(%rsp)
movl 0xe4(%rsp), %eax
movq 0x130(%rsp), %rcx
shlq %rcx
addq %rcx, %rax
movw %ax, %cx
movq 0xf8(%rsp), %rax
movw %cx, (%rax)
movl 0xe4(%rsp), %eax
movq 0x138(%rsp), %rcx
shlq %rcx
addq %rcx, %rax
movw %ax, %cx
movq 0xf8(%rsp), %rax
movw %cx, 0x2(%rax)
movl 0xe0(%rsp), %eax
movq 0x138(%rsp), %rcx
shlq %rcx
addq %rcx, %rax
movw %ax, %cx
movq 0xf8(%rsp), %rax
movw %cx, 0x4(%rax)
movl 0xe0(%rsp), %eax
movq 0x138(%rsp), %rcx
shlq %rcx
addq %rcx, %rax
movw %ax, %cx
movq 0xf8(%rsp), %rax
movw %cx, 0x6(%rax)
movl 0xe0(%rsp), %eax
movq 0x130(%rsp), %rcx
shlq %rcx
addq %rcx, %rax
movw %ax, %cx
movq 0xf8(%rsp), %rax
movw %cx, 0x8(%rax)
movl 0xe4(%rsp), %eax
movq 0x130(%rsp), %rcx
shlq %rcx
addq %rcx, %rax
movw %ax, %cx
movq 0xf8(%rsp), %rax
movw %cx, 0xa(%rax)
movq 0xf8(%rsp), %rax
addq $0xc, %rax
movq %rax, 0xf8(%rsp)
movq 0x130(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x130(%rsp)
movq %rax, 0x138(%rsp)
jmp 0x37f77
movq 0x178(%rsp), %rax
movq 0xb8(%rax), %rdi
xorl %esi, %esi
callq 0x13890
jmp 0x38579
movq $0x0, 0x58(%rsp)
movq 0x178(%rsp), %rax
movl 0xcc(%rax), %eax
movq %rax, 0x50(%rsp)
movl 0x16c(%rsp), %eax
subl $0x2, %eax
imull $0x3, %eax, %eax
movl %eax, %eax
movq %rax, 0x48(%rsp)
movl 0x16c(%rsp), %eax
movq %rax, 0x40(%rsp)
movq 0x178(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x37600
movq %rax, 0x38(%rsp)
movq 0x178(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x37730
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x38(%rsp)
je 0x3848b
cmpq $0x0, 0x30(%rsp)
jne 0x38490
jmp 0x38579
movq $0x0, 0x58(%rsp)
movq 0x58(%rsp), %rax
cmpq 0x40(%rsp), %rax
jae 0x384ff
movq 0x38(%rsp), %rdi
movq 0x178(%rsp), %rax
movq %rax, %rsi
addq $0x70, %rsi
movq 0x170(%rsp), %rcx
movq 0x58(%rsp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movsd 0x90(%rax), %xmm1
movsd 0x158(%rsp), %xmm2
movsd 0x160(%rsp), %xmm3
callq 0x378c0
movq %rax, 0x38(%rsp)
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0x38499
movq $0x2, 0x58(%rsp)
movq 0x58(%rsp), %rax
movl 0x16c(%rsp), %ecx
cmpq %rcx, %rax
jae 0x38577
movq 0x50(%rsp), %rax
movw %ax, %cx
movq 0x30(%rsp), %rax
movw %cx, (%rax)
movq 0x50(%rsp), %rax
addq 0x58(%rsp), %rax
subq $0x1, %rax
movw %ax, %cx
movq 0x30(%rsp), %rax
movw %cx, 0x2(%rax)
movq 0x50(%rsp), %rax
addq 0x58(%rsp), %rax
movw %ax, %cx
movq 0x30(%rsp), %rax
movw %cx, 0x4(%rax)
movq 0x30(%rsp), %rax
addq $0x6, %rax
movq %rax, 0x30(%rsp)
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0x38508
jmp 0x38579
addq $0x188, %rsp            # imm = 0x188
retq
nopw %cs:(%rax,%rax)