// File: /workspace/github_c_makefile_star2_O0/0x0203[P]schack_poc/./nuklear_xlib.h
// Function: nk_xsurf_fill_rect
NK_INTERN void
nk_xsurf_fill_rect(XSurface* surf, short x, short y, unsigned short w,
    unsigned short h, unsigned short r, struct nk_color col)
{
    unsigned long c = nk_color_from_byte(&col.r);
    XSetForeground(surf->dpy, surf->gc, c);
    if (r == 0) {XFillRectangle(surf->dpy, surf->drawable, surf->gc, x, y, w, h); return;}

    {short xc = x + r;
    short yc = y + r;
    short wc = (short)(w - 2 * r);
    short hc = (short)(h - 2 * r);

    XPoint pnts[12];
    pnts[0].x = x;
    pnts[0].y = yc;
    pnts[1].x = xc;
    pnts[1].y = yc;
    pnts[2].x = xc;
    pnts[2].y = y;

    pnts[3].x = xc + wc;
    pnts[3].y = y;
    pnts[4].x = xc + wc;
    pnts[4].y = yc;
    pnts[5].x = x + w;
    pnts[5].y = yc;

    pnts[6].x = x + w;
    pnts[6].y = yc + hc;
    pnts[7].x = xc + wc;
    pnts[7].y = yc + hc;
    pnts[8].x = xc + wc;
    pnts[8].y = y + h;

    pnts[9].x = xc;
    pnts[9].y = y + h;
    pnts[10].x = xc;
    pnts[10].y = yc + hc;
    pnts[11].x = x;
    pnts[11].y = yc + hc;

    XFillPolygon(surf->dpy, surf->drawable, surf->gc, pnts, 12, Convex, CoordModeOrigin);
    XFillArc(surf->dpy, surf->drawable, surf->gc, xc + wc - r, y,
        (unsigned)r*2, (unsigned)r*2, 0 * 64, 90 * 64);
    XFillArc(surf->dpy, surf->drawable, surf->gc, x, y,
        (unsigned)r*2, (unsigned)r*2, 90 * 64, 90 * 64);
    XFillArc(surf->dpy, surf->drawable, surf->gc, x, yc + hc - r,
        (unsigned)r*2, (unsigned)2*r, 180 * 64, 90 * 64);
    XFillArc(surf->dpy, surf->drawable, surf->gc, xc + wc - r, yc + hc - r,
        (unsigned)r*2, (unsigned)2*r, -90 * 64, 90 * 64);}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movl %r8d, -0x70(%rbp)
movl %ecx, %eax
movl -0x70(%rbp), %ecx
movl %eax, -0x6c(%rbp)
movl %edx, %eax
movl -0x6c(%rbp), %edx
movl %eax, -0x68(%rbp)
movl %esi, %eax
movl -0x68(%rbp), %esi
movl %eax, -0x64(%rbp)
movq %rdi, %r8
movl -0x64(%rbp), %edi
movw %r9w, %ax
movl 0x10(%rbp), %r9d
movq %r8, -0x8(%rbp)
movw %di, -0xa(%rbp)
movw %si, -0xc(%rbp)
movw %dx, -0xe(%rbp)
movw %cx, -0x10(%rbp)
movw %ax, -0x12(%rbp)
leaq 0x10(%rbp), %rdi
callq 0x31c40
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x3260
movzwl -0x12(%rbp), %eax
cmpl $0x0, %eax
jne 0x32261
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x8(%rbp), %rax
movq (%rax), %rdx
movswl -0xa(%rbp), %ecx
movswl -0xc(%rbp), %r8d
movzwl -0xe(%rbp), %r9d
movzwl -0x10(%rbp), %eax
movl %eax, (%rsp)
callq 0x3270
jmp 0x32529
movswl -0xa(%rbp), %eax
movzwl -0x12(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x22(%rbp)
movswl -0xc(%rbp), %eax
movzwl -0x12(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x24(%rbp)
movzwl -0xe(%rbp), %eax
movzwl -0x12(%rbp), %ecx
shll %ecx
subl %ecx, %eax
movw %ax, -0x26(%rbp)
movzwl -0x10(%rbp), %eax
movzwl -0x12(%rbp), %ecx
shll %ecx
subl %ecx, %eax
movw %ax, -0x28(%rbp)
movw -0xa(%rbp), %ax
movw %ax, -0x60(%rbp)
movw -0x24(%rbp), %ax
movw %ax, -0x5e(%rbp)
movw -0x22(%rbp), %ax
movw %ax, -0x5c(%rbp)
movw -0x24(%rbp), %ax
movw %ax, -0x5a(%rbp)
movw -0x22(%rbp), %ax
movw %ax, -0x58(%rbp)
movw -0xc(%rbp), %ax
movw %ax, -0x56(%rbp)
movswl -0x22(%rbp), %eax
movswl -0x26(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x54(%rbp)
movw -0xc(%rbp), %ax
movw %ax, -0x52(%rbp)
movswl -0x22(%rbp), %eax
movswl -0x26(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x50(%rbp)
movw -0x24(%rbp), %ax
movw %ax, -0x4e(%rbp)
movswl -0xa(%rbp), %eax
movzwl -0xe(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x4c(%rbp)
movw -0x24(%rbp), %ax
movw %ax, -0x4a(%rbp)
movswl -0xa(%rbp), %eax
movzwl -0xe(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x48(%rbp)
movswl -0x24(%rbp), %eax
movswl -0x28(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x46(%rbp)
movswl -0x22(%rbp), %eax
movswl -0x26(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x44(%rbp)
movswl -0x24(%rbp), %eax
movswl -0x28(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x42(%rbp)
movswl -0x22(%rbp), %eax
movswl -0x26(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x40(%rbp)
movswl -0xc(%rbp), %eax
movzwl -0x10(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x3e(%rbp)
movw -0x22(%rbp), %ax
movw %ax, -0x3c(%rbp)
movswl -0xc(%rbp), %eax
movzwl -0x10(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x3a(%rbp)
movw -0x22(%rbp), %ax
movw %ax, -0x38(%rbp)
movswl -0x24(%rbp), %eax
movswl -0x28(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x36(%rbp)
movw -0xa(%rbp), %ax
movw %ax, -0x34(%rbp)
movswl -0x24(%rbp), %eax
movswl -0x28(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x32(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x8(%rbp), %rax
movq (%rax), %rdx
leaq -0x60(%rbp), %rcx
movl $0xc, %r8d
movl $0x2, %r9d
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x33e0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x8(%rbp), %rax
movq (%rax), %rdx
movswl -0x22(%rbp), %ecx
movswl -0x26(%rbp), %eax
addl %eax, %ecx
movzwl -0x12(%rbp), %eax
subl %eax, %ecx
movswl -0xc(%rbp), %r8d
movzwl -0x12(%rbp), %r9d
shll %r9d
movzwl -0x12(%rbp), %eax
shll %eax
xorl %r10d, %r10d
movl %eax, (%rsp)
movl $0x0, 0x8(%rsp)
movl $0x1680, 0x10(%rsp)     # imm = 0x1680
callq 0x3250
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x8(%rbp), %rax
movq (%rax), %rdx
movswl -0xa(%rbp), %ecx
movswl -0xc(%rbp), %r8d
movzwl -0x12(%rbp), %r9d
shll %r9d
movzwl -0x12(%rbp), %eax
shll %eax
movl %eax, (%rsp)
movl $0x1680, 0x8(%rsp)      # imm = 0x1680
movl $0x1680, 0x10(%rsp)     # imm = 0x1680
callq 0x3250
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x8(%rbp), %rax
movq (%rax), %rdx
movswl -0xa(%rbp), %ecx
movswl -0x24(%rbp), %r8d
movswl -0x28(%rbp), %eax
addl %eax, %r8d
movzwl -0x12(%rbp), %eax
subl %eax, %r8d
movzwl -0x12(%rbp), %r9d
shll %r9d
movzwl -0x12(%rbp), %eax
shll %eax
movl %eax, (%rsp)
movl $0x2d00, 0x8(%rsp)      # imm = 0x2D00
movl $0x1680, 0x10(%rsp)     # imm = 0x1680
callq 0x3250
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x8(%rbp), %rax
movq (%rax), %rdx
movswl -0x22(%rbp), %ecx
movswl -0x26(%rbp), %eax
addl %eax, %ecx
movzwl -0x12(%rbp), %eax
subl %eax, %ecx
movswl -0x24(%rbp), %r8d
movswl -0x28(%rbp), %eax
addl %eax, %r8d
movzwl -0x12(%rbp), %eax
subl %eax, %r8d
movzwl -0x12(%rbp), %r9d
shll %r9d
movzwl -0x12(%rbp), %eax
shll %eax
movl %eax, (%rsp)
movl $0xffffe980, 0x8(%rsp)  # imm = 0xFFFFE980
movl $0x1680, 0x10(%rsp)     # imm = 0x1680
callq 0x3250
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)