// File: /workspace/github_c_makefile_star2_O0/0x0203[P]schack_poc/./nuklear_xlib.h
// Function: nk_xsurf_stroke_rect
NK_INTERN void
nk_xsurf_stroke_rect(XSurface* surf, short x, short y, unsigned short w,
    unsigned short h, unsigned short r, unsigned short line_thickness, struct nk_color col)
{
    unsigned long c = nk_color_from_byte(&col.r);
    XSetForeground(surf->dpy, surf->gc, c);
    XSetLineAttributes(surf->dpy, surf->gc, line_thickness, LineSolid, CapButt, JoinMiter);
    if (r == 0) {XDrawRectangle(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);

    XDrawLine(surf->dpy, surf->drawable, surf->gc, xc, y, xc+wc, y);
    XDrawLine(surf->dpy, surf->drawable, surf->gc, x+w, yc, x+w, yc+hc);
    XDrawLine(surf->dpy, surf->drawable, surf->gc, xc, y+h, xc+wc, y+h);
    XDrawLine(surf->dpy, surf->drawable, surf->gc, x, yc, x, yc+hc);

    XDrawArc(surf->dpy, surf->drawable, surf->gc, xc + wc - r, y,
        (unsigned)r*2, (unsigned)r*2, 0 * 64, 90 * 64);
    XDrawArc(surf->dpy, surf->drawable, surf->gc, x, y,
        (unsigned)r*2, (unsigned)r*2, 90 * 64, 90 * 64);
    XDrawArc(surf->dpy, surf->drawable, surf->gc, x, yc + hc - r,
        (unsigned)r*2, (unsigned)2*r, 180 * 64, 90 * 64);
    XDrawArc(surf->dpy, surf->drawable, surf->gc, xc + wc - r, yc + hc - r,
        (unsigned)r*2, (unsigned)2*r, -90 * 64, 90 * 64);}
    XSetLineAttributes(surf->dpy, surf->gc, 1, LineSolid, CapButt, JoinMiter);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %r8d, -0x38(%rbp)
movl %ecx, %eax
movl -0x38(%rbp), %ecx
movl %eax, -0x34(%rbp)
movl %edx, %eax
movl -0x34(%rbp), %edx
movl %eax, -0x30(%rbp)
movl %esi, %eax
movl -0x30(%rbp), %esi
movl %eax, -0x2c(%rbp)
movq %rdi, %r8
movl -0x2c(%rbp), %edi
movw %r9w, %ax
movl 0x18(%rbp), %r9d
movw 0x10(%rbp), %r9w
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 0x18(%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
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movzwl 0x10(%rbp), %edx
xorl %r9d, %r9d
movl $0x1, %r8d
movl %r9d, %ecx
callq 0x3310
movzwl -0x12(%rbp), %eax
cmpl $0x0, %eax
jne 0x31ef7
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 0x32d0
jmp 0x321a3
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)
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 -0xc(%rbp), %r8d
movswl -0x22(%rbp), %r9d
movswl -0x26(%rbp), %eax
addl %eax, %r9d
movswl -0xc(%rbp), %eax
movl %eax, (%rsp)
callq 0x3220
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
movzwl -0xe(%rbp), %eax
addl %eax, %ecx
movswl -0x24(%rbp), %r8d
movswl -0xa(%rbp), %r9d
movzwl -0xe(%rbp), %eax
addl %eax, %r9d
movswl -0x24(%rbp), %eax
movswl -0x28(%rbp), %r10d
addl %r10d, %eax
movl %eax, (%rsp)
callq 0x3220
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 -0xc(%rbp), %r8d
movzwl -0x10(%rbp), %eax
addl %eax, %r8d
movswl -0x22(%rbp), %r9d
movswl -0x26(%rbp), %eax
addl %eax, %r9d
movswl -0xc(%rbp), %eax
movzwl -0x10(%rbp), %r10d
addl %r10d, %eax
movl %eax, (%rsp)
callq 0x3220
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 -0xa(%rbp), %r9d
movswl -0x24(%rbp), %eax
movswl -0x28(%rbp), %r10d
addl %r10d, %eax
movl %eax, (%rsp)
callq 0x3220
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 0x3470
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 0x3470
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 0x3470
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 0x3470
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movl $0x1, %r8d
xorl %r9d, %r9d
movl %r8d, %edx
movl %r9d, %ecx
callq 0x3310
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)