// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_clear
NK_API void
nk_clear(struct nk_context *ctx)
{
    struct nk_window *iter;
    struct nk_window *next;
    NK_ASSERT(ctx);

    if (!ctx) return;
    if (ctx->use_pool)
        nk_buffer_clear(&ctx->memory);
    else nk_buffer_reset(&ctx->memory, NK_BUFFER_FRONT);

    ctx->build = 0;
    ctx->memory.calls = 0;
    ctx->last_widget_state = 0;
    ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_ARROW];
    NK_MEMSET(&ctx->overlay, 0, sizeof(ctx->overlay));

    /* garbage collector */
    iter = ctx->begin;
    while (iter) {
        /* make sure valid minimized windows do not get removed */
        if ((iter->flags & NK_WINDOW_MINIMIZED) &&
            !(iter->flags & NK_WINDOW_CLOSED) &&
            iter->seq == ctx->seq) {
            iter = iter->next;
            continue;
        }
        /* remove hotness from hidden or closed windows*/
        if (((iter->flags & NK_WINDOW_HIDDEN) ||
            (iter->flags & NK_WINDOW_CLOSED)) &&
            iter == ctx->active) {
            ctx->active = iter->prev;
            ctx->end = iter->prev;
            if (!ctx->end)
                ctx->begin = 0;
            if (ctx->active)
                ctx->active->flags &= ~(unsigned)NK_WINDOW_ROM;
        }
        /* free unused popup windows */
        if (iter->popup.win && iter->popup.win->seq != ctx->seq) {
            nk_free_window(ctx, iter->popup.win);
            iter->popup.win = 0;
        }
        /* remove unused window state tables */
        {struct nk_table *n, *it = iter->tables;
        while (it) {
            n = it->next;
            if (it->seq != ctx->seq) {
                nk_remove_table(iter, it);
                nk_zero(it, sizeof(union nk_page_data));
                nk_free_table(ctx, it);
                if (it == iter->tables)
                    iter->tables = n;
            } it = n;
        }}
        /* window itself is not used anymore so free */
        if (iter->seq != ctx->seq || iter->flags & NK_WINDOW_CLOSED) {
            next = iter->next;
            nk_remove_window(ctx, iter);
            nk_free_window(ctx, iter);
            iter = next;
        } else iter = iter->next;
    }
    ctx->seq++;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x53ef4
movq 0x71128(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
leaq 0x5d4ce(%rip), %rsi     # 0xb13a0
leaq 0x5d4e5(%rip), %rdx     # 0xb13be
movl $0x4ac6, %ecx           # imm = 0x4AC6
movb $0x0, %al
callq 0x13ec0
movq 0x71104(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
callq 0x149a0
jmp 0x53ef6
cmpq $0x0, 0x20(%rsp)
jne 0x53f03
jmp 0x54226
movq 0x20(%rsp), %rax
cmpl $0x0, 0x471c(%rax)
je 0x53f24
movq 0x20(%rsp), %rdi
addq $0x2508, %rdi           # imm = 0x2508
callq 0x13f40
jmp 0x53f37
movq 0x20(%rsp), %rdi
addq $0x2508, %rdi           # imm = 0x2508
xorl %esi, %esi
callq 0x13890
movq 0x20(%rsp), %rax
movl $0x0, 0x4718(%rax)
movq 0x20(%rsp), %rax
movq $0x0, 0x2570(%rax)
movq 0x20(%rsp), %rax
movl $0x0, 0x2598(%rax)
movq 0x20(%rsp), %rax
movq 0x170(%rax), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x1a8(%rax)
movq 0x20(%rsp), %rdi
addq $0x46d8, %rdi           # imm = 0x46D8
xorl %esi, %esi
movl $0x40, %edx
callq 0x49d50
movq 0x20(%rsp), %rax
movq 0x4768(%rax), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0x54212
movq 0x18(%rsp), %rax
movl 0x48(%rax), %eax
andl $0x8000, %eax           # imm = 0x8000
cmpl $0x0, %eax
je 0x53ffd
movq 0x18(%rsp), %rax
movl 0x48(%rax), %eax
andl $0x4000, %eax           # imm = 0x4000
cmpl $0x0, %eax
jne 0x53ffd
movq 0x18(%rsp), %rax
movl (%rax), %eax
movq 0x20(%rsp), %rcx
cmpl 0x4794(%rcx), %eax
jne 0x53ffd
movq 0x18(%rsp), %rax
movq 0x1c8(%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0x53fa6
movq 0x18(%rsp), %rax
movl 0x48(%rax), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
jne 0x54025
movq 0x18(%rsp), %rax
movl 0x48(%rax), %eax
andl $0x4000, %eax           # imm = 0x4000
cmpl $0x0, %eax
je 0x540b0
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rcx
cmpq 0x4778(%rcx), %rax
jne 0x540b0
movq 0x18(%rsp), %rax
movq 0x1d0(%rax), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x4778(%rax)
movq 0x18(%rsp), %rax
movq 0x1d0(%rax), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x4770(%rax)
movq 0x20(%rsp), %rax
cmpq $0x0, 0x4770(%rax)
jne 0x54087
movq 0x20(%rsp), %rax
movq $0x0, 0x4768(%rax)
movq 0x20(%rsp), %rax
cmpq $0x0, 0x4778(%rax)
je 0x540ae
movq 0x20(%rsp), %rax
movq 0x4778(%rax), %rax
movl 0x48(%rax), %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
movl %ecx, 0x48(%rax)
jmp 0x540b0
movq 0x18(%rsp), %rax
cmpq $0x0, 0x120(%rax)
je 0x54100
movq 0x18(%rsp), %rax
movq 0x120(%rax), %rax
movl (%rax), %eax
movq 0x20(%rsp), %rcx
cmpl 0x4794(%rcx), %eax
je 0x54100
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rax
movq 0x120(%rax), %rsi
callq 0x54230
movq 0x18(%rsp), %rax
movq $0x0, 0x120(%rax)
movq 0x18(%rsp), %rax
movq 0x1b8(%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
je 0x5419b
movq (%rsp), %rax
movq 0x1e8(%rax), %rax
movq %rax, 0x8(%rsp)
movq (%rsp), %rax
movl (%rax), %eax
movq 0x20(%rsp), %rcx
cmpl 0x4794(%rcx), %eax
je 0x5418d
movq 0x18(%rsp), %rdi
movq (%rsp), %rsi
callq 0x54340
movq (%rsp), %rdi
movl $0x1f8, %esi            # imm = 0x1F8
callq 0x2f0e0
movq 0x20(%rsp), %rdi
movq (%rsp), %rsi
callq 0x54400
movq (%rsp), %rax
movq 0x18(%rsp), %rcx
cmpq 0x1b8(%rcx), %rax
jne 0x5418b
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x1b8(%rax)
jmp 0x5418d
movq 0x8(%rsp), %rax
movq %rax, (%rsp)
jmp 0x54110
movq 0x18(%rsp), %rax
movl (%rax), %eax
movq 0x20(%rsp), %rcx
cmpl 0x4794(%rcx), %eax
jne 0x541c1
movq 0x18(%rsp), %rax
movl 0x48(%rax), %eax
andl $0x4000, %eax           # imm = 0x4000
cmpl $0x0, %eax
je 0x541fc
movq 0x18(%rsp), %rax
movq 0x1c8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x54440
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x54230
movq 0x10(%rsp), %rax
movq %rax, 0x18(%rsp)
jmp 0x5420d
movq 0x18(%rsp), %rax
movq 0x1c8(%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0x53fa6
movq 0x20(%rsp), %rax
movl 0x4794(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4794(%rax)
addq $0x28, %rsp
retq
nopl (%rax,%rax)