// File: /workspace/github_c_makefile_star2_O0/0x0203[P]schack_poc/./nuklear_xlib.h
// Function: nk_xlib_render
NK_API void
nk_xlib_render(Drawable screen, struct nk_color clear)
{
    const struct nk_command *cmd;
    struct nk_context *ctx = &xlib.ctx;
    XSurface *surf = xlib.surf;

    nk_xsurf_clear(xlib.surf, nk_color_from_byte(&clear.r));
    nk_foreach(cmd, &xlib.ctx)
    {
        switch (cmd->type) {
        case NK_COMMAND_NOP: break;
        case NK_COMMAND_SCISSOR: {
            const struct nk_command_scissor *s =(const struct nk_command_scissor*)cmd;
            nk_xsurf_scissor(surf, s->x, s->y, s->w, s->h);
        } break;
        case NK_COMMAND_LINE: {
            const struct nk_command_line *l = (const struct nk_command_line *)cmd;
            nk_xsurf_stroke_line(surf, l->begin.x, l->begin.y, l->end.x,
                l->end.y, l->line_thickness, l->color);
        } break;
        case NK_COMMAND_RECT: {
            const struct nk_command_rect *r = (const struct nk_command_rect *)cmd;
            nk_xsurf_stroke_rect(surf, r->x, r->y, NK_MAX(r->w -r->line_thickness, 0),
                NK_MAX(r->h - r->line_thickness, 0), (unsigned short)r->rounding,
                r->line_thickness, r->color);
        } break;
        case NK_COMMAND_RECT_FILLED: {
            const struct nk_command_rect_filled *r = (const struct nk_command_rect_filled *)cmd;
            nk_xsurf_fill_rect(surf, r->x, r->y, r->w, r->h,
                (unsigned short)r->rounding, r->color);
        } break;
        case NK_COMMAND_CIRCLE: {
            const struct nk_command_circle *c = (const struct nk_command_circle *)cmd;
            nk_xsurf_stroke_circle(surf, c->x, c->y, c->w, c->h, c->line_thickness, c->color);
        } break;
        case NK_COMMAND_CIRCLE_FILLED: {
            const struct nk_command_circle_filled *c = (const struct nk_command_circle_filled *)cmd;
            nk_xsurf_fill_circle(surf, c->x, c->y, c->w, c->h, c->color);
        } break;
        case NK_COMMAND_TRIANGLE: {
            const struct nk_command_triangle*t = (const struct nk_command_triangle*)cmd;
            nk_xsurf_stroke_triangle(surf, t->a.x, t->a.y, t->b.x, t->b.y,
                t->c.x, t->c.y, t->line_thickness, t->color);
        } break;
        case NK_COMMAND_TRIANGLE_FILLED: {
            const struct nk_command_triangle_filled *t = (const struct nk_command_triangle_filled *)cmd;
            nk_xsurf_fill_triangle(surf, t->a.x, t->a.y, t->b.x, t->b.y,
                t->c.x, t->c.y, t->color);
        } break;
        case NK_COMMAND_POLYGON: {
            const struct nk_command_polygon *p =(const struct nk_command_polygon*)cmd;
            nk_xsurf_stroke_polygon(surf, p->points, p->point_count, p->line_thickness,p->color);
        } break;
        case NK_COMMAND_POLYGON_FILLED: {
            const struct nk_command_polygon_filled *p = (const struct nk_command_polygon_filled *)cmd;
            nk_xsurf_fill_polygon(surf, p->points, p->point_count, p->color);
        } break;
        case NK_COMMAND_POLYLINE: {
            const struct nk_command_polyline *p = (const struct nk_command_polyline *)cmd;
            nk_xsurf_stroke_polyline(surf, p->points, p->point_count, p->line_thickness, p->color);
        } break;
        case NK_COMMAND_TEXT: {
            const struct nk_command_text *t = (const struct nk_command_text*)cmd;
            nk_xsurf_draw_text(surf, t->x, t->y, t->w, t->h,
                (const char*)t->string, t->length,
                (XFont*)t->font->userdata.ptr,
                t->background, t->foreground);
        } break;
        case NK_COMMAND_CURVE: {
            const struct nk_command_curve *q = (const struct nk_command_curve *)cmd;
            nk_xsurf_stroke_curve(surf, q->begin, q->ctrl[0], q->ctrl[1],
                q->end, 22, q->line_thickness, q->color);
        } break;
        case NK_COMMAND_IMAGE: {
            const struct nk_command_image *i = (const struct nk_command_image *)cmd;
            nk_xsurf_draw_image(surf, i->x, i->y, i->w, i->h, i->img, i->col);
        } break;
        case NK_COMMAND_RECT_MULTI_COLOR:
        case NK_COMMAND_ARC:
        case NK_COMMAND_ARC_FILLED:
        case NK_COMMAND_CUSTOM:
        default: break;
        }
    }
    nk_clear(ctx);
    nk_xsurf_blit(screen, surf, surf->w, surf->h);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0xe8, %rsp
movl %esi, -0xc(%rbp)
movq %rdi, -0x18(%rbp)
leaq 0x2319e(%rip), %rax     # 0x546c8
addq $0x38, %rax
movq %rax, -0x28(%rbp)
movq 0x271c7(%rip), %rax     # 0x58700
movq %rax, -0x30(%rbp)
movq 0x271bc(%rip), %rax     # 0x58700
movq %rax, -0xa8(%rbp)
leaq -0xc(%rbp), %rdi
callq 0x31c40
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
callq 0x31bd0
leaq 0x2315e(%rip), %rdi     # 0x546c8
addq $0x38, %rdi
callq 0x11de0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x31b9f
movq -0x20(%rbp), %rax
movl (%rax), %eax
movq %rax, -0xb0(%rbp)
subq $0x12, %rax
ja 0x31b7e
movq -0xb0(%rbp), %rax
leaq 0x10ba9(%rip), %rcx     # 0x42150
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x31b80
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rax
movswl 0x10(%rax), %ecx
cvtsi2ss %ecx, %xmm0
movswl 0x12(%rax), %ecx
cvtsi2ss %ecx, %xmm1
movzwl 0x14(%rax), %ecx
cvtsi2ss %ecx, %xmm2
movzwl 0x16(%rax), %eax
cvtsi2ss %eax, %xmm3
callq 0x31ca0
jmp 0x31b80
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rax
movw 0x12(%rax), %si
movq -0x40(%rbp), %rax
movw 0x14(%rax), %dx
movq -0x40(%rbp), %rax
movw 0x16(%rax), %cx
movq -0x40(%rbp), %rax
movw 0x18(%rax), %r8w
movq -0x40(%rbp), %rax
movzwl 0x10(%rax), %r9d
movq -0x40(%rbp), %rax
movl 0x1a(%rax), %eax
movswl %si, %esi
movswl %dx, %edx
movswl %cx, %ecx
movswl %r8w, %r8d
movl %eax, (%rsp)
callq 0x31d50
jmp 0x31b80
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x48(%rbp), %rax
movw 0x14(%rax), %ax
movw %ax, -0xb4(%rbp)
movq -0x48(%rbp), %rax
movw 0x16(%rax), %ax
movw %ax, -0xb2(%rbp)
movq -0x48(%rbp), %rax
movzwl 0x18(%rax), %eax
movq -0x48(%rbp), %rcx
movzwl 0x12(%rcx), %ecx
subl %ecx, %eax
cmpl $0x0, %eax
jge 0x31698
xorl %eax, %eax
movl %eax, -0xc4(%rbp)
jmp 0x316b0
movq -0x48(%rbp), %rax
movzwl 0x18(%rax), %eax
movq -0x48(%rbp), %rcx
movzwl 0x12(%rcx), %ecx
subl %ecx, %eax
movl %eax, -0xc4(%rbp)
movl -0xc4(%rbp), %eax
movw %ax, -0xc6(%rbp)
movq -0x48(%rbp), %rax
movzwl 0x1a(%rax), %eax
movq -0x48(%rbp), %rcx
movzwl 0x12(%rcx), %ecx
subl %ecx, %eax
cmpl $0x0, %eax
jge 0x316de
xorl %eax, %eax
movl %eax, -0xcc(%rbp)
jmp 0x316f6
movq -0x48(%rbp), %rax
movzwl 0x1a(%rax), %eax
movq -0x48(%rbp), %rcx
movzwl 0x12(%rcx), %ecx
subl %ecx, %eax
movl %eax, -0xcc(%rbp)
movw -0xc6(%rbp), %cx
movw -0xb2(%rbp), %dx
movw -0xb4(%rbp), %si
movq -0xc0(%rbp), %rdi
movl -0xcc(%rbp), %eax
movw %ax, %r8w
movq -0x48(%rbp), %rax
movw 0x10(%rax), %r9w
movq -0x48(%rbp), %rax
movw 0x12(%rax), %r10w
movq -0x48(%rbp), %rax
movl 0x1c(%rax), %eax
movswl %si, %esi
movswl %dx, %edx
movzwl %cx, %ecx
movzwl %r8w, %r8d
movzwl %r9w, %r9d
movzwl %r10w, %r10d
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x31e20
jmp 0x31b80
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rdi
movq -0x50(%rbp), %rax
movw 0x12(%rax), %si
movq -0x50(%rbp), %rax
movw 0x14(%rax), %dx
movq -0x50(%rbp), %rax
movw 0x16(%rax), %cx
movq -0x50(%rbp), %rax
movw 0x18(%rax), %r8w
movq -0x50(%rbp), %rax
movw 0x10(%rax), %r9w
movq -0x50(%rbp), %rax
movl 0x1a(%rax), %eax
movswl %si, %esi
movswl %dx, %edx
movzwl %cx, %ecx
movzwl %r8w, %r8d
movzwl %r9w, %r9d
movl %eax, (%rsp)
callq 0x321b0
jmp 0x31b80
movq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rdi
movq -0x58(%rbp), %rax
movw 0x10(%rax), %si
movq -0x58(%rbp), %rax
movw 0x12(%rax), %dx
movq -0x58(%rbp), %rax
movw 0x16(%rax), %cx
movq -0x58(%rbp), %rax
movw 0x18(%rax), %r8w
movq -0x58(%rbp), %rax
movw 0x14(%rax), %r9w
movq -0x58(%rbp), %rax
movl 0x1a(%rax), %eax
movswl %si, %esi
movswl %dx, %edx
movzwl %cx, %ecx
movzwl %r8w, %r8d
movzwl %r9w, %r9d
movl %eax, (%rsp)
callq 0x32540
jmp 0x31b80
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rdi
movq -0x60(%rbp), %rax
movw 0x10(%rax), %si
movq -0x60(%rbp), %rax
movw 0x12(%rax), %dx
movq -0x60(%rbp), %rax
movw 0x14(%rax), %cx
movq -0x60(%rbp), %rax
movw 0x16(%rax), %ax
movq -0x60(%rbp), %r8
movl 0x18(%r8), %r9d
movswl %si, %esi
movswl %dx, %edx
movzwl %cx, %ecx
movzwl %ax, %r8d
callq 0x32640
jmp 0x31b80
movq -0x20(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x30(%rbp), %rdi
movq -0x68(%rbp), %rax
movw 0x12(%rax), %si
movq -0x68(%rbp), %rax
movw 0x14(%rax), %dx
movq -0x68(%rbp), %rax
movw 0x16(%rax), %cx
movq -0x68(%rbp), %rax
movw 0x18(%rax), %r8w
movq -0x68(%rbp), %rax
movw 0x1a(%rax), %r9w
movq -0x68(%rbp), %rax
movw 0x1c(%rax), %r11w
movq -0x68(%rbp), %rax
movw 0x10(%rax), %r10w
movq -0x68(%rbp), %rax
movl 0x1e(%rax), %eax
movswl %si, %esi
movswl %dx, %edx
movswl %cx, %ecx
movswl %r8w, %r8d
movswl %r9w, %r9d
movswl %r11w, %r11d
movl %r11d, (%rsp)
movzwl %r10w, %r10d
movl %r10d, 0x8(%rsp)
movl %eax, 0x10(%rsp)
callq 0x326e0
jmp 0x31b80
movq -0x20(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x30(%rbp), %rdi
movq -0x70(%rbp), %rax
movw 0x10(%rax), %si
movq -0x70(%rbp), %rax
movw 0x12(%rax), %dx
movq -0x70(%rbp), %rax
movw 0x14(%rax), %cx
movq -0x70(%rbp), %rax
movw 0x16(%rax), %r8w
movq -0x70(%rbp), %rax
movw 0x18(%rax), %r9w
movq -0x70(%rbp), %rax
movw 0x1a(%rax), %r10w
movq -0x70(%rbp), %rax
movl 0x1c(%rax), %eax
movswl %si, %esi
movswl %dx, %edx
movswl %cx, %ecx
movswl %r8w, %r8d
movswl %r9w, %r9d
movswl %r10w, %r10d
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x32840
jmp 0x31b80
movq -0x20(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x30(%rbp), %rdi
movq -0x78(%rbp), %rsi
addq $0x18, %rsi
movq -0x78(%rbp), %rax
movzwl 0x16(%rax), %edx
movq -0x78(%rbp), %rax
movw 0x14(%rax), %ax
movq -0x78(%rbp), %rcx
movl 0x10(%rcx), %r8d
movzwl %ax, %ecx
callq 0x32920
jmp 0x31b80
movq -0x20(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x30(%rbp), %rdi
movq -0x80(%rbp), %rsi
addq $0x16, %rsi
movq -0x80(%rbp), %rax
movzwl 0x14(%rax), %edx
movq -0x80(%rbp), %rax
movl 0x10(%rax), %ecx
callq 0x32a90
jmp 0x31b80
movq -0x20(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x30(%rbp), %rdi
movq -0x88(%rbp), %rsi
addq $0x18, %rsi
movq -0x88(%rbp), %rax
movzwl 0x16(%rax), %edx
movq -0x88(%rbp), %rax
movw 0x14(%rax), %ax
movq -0x88(%rbp), %rcx
movl 0x10(%rcx), %r8d
movzwl %ax, %ecx
callq 0x32b90
jmp 0x31b80
movq -0x20(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x30(%rbp), %rdi
movq -0x90(%rbp), %rax
movw 0x20(%rax), %si
movq -0x90(%rbp), %rax
movw 0x22(%rax), %dx
movq -0x90(%rbp), %rax
movw 0x24(%rax), %cx
movq -0x90(%rbp), %rax
movw 0x26(%rax), %r8w
movq -0x90(%rbp), %r9
addq $0x30, %r9
movq -0x90(%rbp), %rax
movl 0x2c(%rax), %ebx
movq -0x90(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %r11
movq -0x90(%rbp), %r10
movq -0x90(%rbp), %rax
movl 0x18(%r10), %r10d
movl 0x1c(%rax), %eax
movswl %si, %esi
movswl %dx, %edx
movzwl %cx, %ecx
movzwl %r8w, %r8d
movl %ebx, (%rsp)
movq %r11, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movl %eax, 0x18(%rsp)
callq 0x32cb0
jmp 0x31b80
movq -0x20(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x30(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq -0x98(%rbp), %rdx
movq -0x98(%rbp), %rcx
movq -0x98(%rbp), %r8
movq -0x98(%rbp), %rax
movw 0x10(%rax), %r10w
movq -0x98(%rbp), %rax
movl 0x12(%rsi), %esi
movl 0x1a(%rdx), %edx
movl 0x1e(%rcx), %ecx
movl 0x16(%r8), %r8d
movl 0x22(%rax), %eax
movl $0x16, %r9d
movzwl %r10w, %r10d
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x32e10
jmp 0x31b80
movq -0x20(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x30(%rbp), %rdi
movq -0xa0(%rbp), %rax
movw 0x10(%rax), %si
movq -0xa0(%rbp), %rax
movw 0x12(%rax), %dx
movq -0xa0(%rbp), %rax
movw 0x14(%rax), %cx
movq -0xa0(%rbp), %rax
movw 0x16(%rax), %r8w
movq -0xa0(%rbp), %rax
addq $0x18, %rax
movq -0xa0(%rbp), %r9
movl 0x30(%r9), %r9d
movswl %si, %esi
movswl %dx, %edx
movzwl %cx, %ecx
movzwl %r8w, %r8d
movq (%rax), %r10
movq %r10, (%rsp)
movq 0x8(%rax), %r10
movq %r10, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x33070
jmp 0x31b80
jmp 0x31b7e
jmp 0x31b80
jmp 0x31b82
movq -0x20(%rbp), %rsi
leaq 0x22b3b(%rip), %rdi     # 0x546c8
addq $0x38, %rdi
callq 0x12270
movq %rax, -0x20(%rbp)
jmp 0x31577
movq -0x28(%rbp), %rdi
callq 0x115b0
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x30(%rbp), %rax
movl 0x28(%rax), %edx
movq -0x30(%rbp), %rax
movl 0x2c(%rax), %ecx
callq 0x33180
addq $0xe8, %rsp
popq %rbx
popq %rbp
retq
nopl (%rax)