// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_build
NK_LIB void
nk_build(struct nk_context *ctx)
{
    struct nk_window *it = 0;
    struct nk_command *cmd = 0;
    nk_byte *buffer = 0;

    /* draw cursor overlay */
    if (!ctx->style.cursor_active)
        ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_ARROW];
    if (ctx->style.cursor_active && !ctx->input.mouse.grabbed && ctx->style.cursor_visible) {
        struct nk_rect mouse_bounds;
        const struct nk_cursor *cursor = ctx->style.cursor_active;
        nk_command_buffer_init(&ctx->overlay, &ctx->memory, NK_CLIPPING_OFF);
        nk_start_buffer(ctx, &ctx->overlay);

        mouse_bounds.x = ctx->input.mouse.pos.x - cursor->offset.x;
        mouse_bounds.y = ctx->input.mouse.pos.y - cursor->offset.y;
        mouse_bounds.w = cursor->size.x;
        mouse_bounds.h = cursor->size.y;

        nk_draw_image(&ctx->overlay, mouse_bounds, &cursor->img, nk_white);
        nk_finish_buffer(ctx, &ctx->overlay);
    }
    /* build one big draw command list out of all window buffers */
    it = ctx->begin;
    buffer = (nk_byte*)ctx->memory.memory.ptr;
    while (it != 0) {
        struct nk_window *next = it->next;
        if (it->buffer.last == it->buffer.begin || (it->flags & NK_WINDOW_HIDDEN)||
            it->seq != ctx->seq)
            goto cont;

        cmd = nk_ptr_add(struct nk_command, buffer, it->buffer.last);
        while (next && ((next->buffer.last == next->buffer.begin) ||
            (next->flags & NK_WINDOW_HIDDEN) || next->seq != ctx->seq))
            next = next->next; /* skip empty command buffers */

        if (next) cmd->next = next->buffer.begin;
        cont: it = next;
    }
    /* append all popup draw commands into lists */
    it = ctx->begin;
    while (it != 0) {
        struct nk_window *next = it->next;
        struct nk_popup_buffer *buf;
        if (!it->popup.buf.active)
            goto skip;

        buf = &it->popup.buf;
        cmd->next = buf->begin;
        cmd = nk_ptr_add(struct nk_command, buffer, buf->last);
        buf->active = nk_false;
        skip: it = next;
    }
    if (cmd) {
        /* append overlay commands */
        if (ctx->overlay.end != ctx->overlay.begin)
            cmd->next = ctx->overlay.begin;
        else cmd->next = ctx->memory.allocated;
    }
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq $0x0, 0x48(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movq 0x50(%rsp), %rax
cmpq $0x0, 0x1a8(%rax)
jne 0x5466b
movq 0x50(%rsp), %rax
movq 0x170(%rax), %rcx
movq 0x50(%rsp), %rax
movq %rcx, 0x1a8(%rax)
movq 0x50(%rsp), %rax
cmpq $0x0, 0x1a8(%rax)
je 0x54784
movq 0x50(%rsp), %rax
cmpb $0x0, 0x165(%rax)
jne 0x54784
movq 0x50(%rsp), %rax
cmpl $0x0, 0x1b8(%rax)
je 0x54784
movq 0x50(%rsp), %rax
movq 0x1a8(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %rsi
movq %rsi, %rdi
addq $0x46d8, %rdi           # imm = 0x46D8
addq $0x2508, %rsi           # imm = 0x2508
xorl %edx, %edx
callq 0x55b50
movq 0x50(%rsp), %rdi
movq %rdi, %rsi
addq $0x46d8, %rsi           # imm = 0x46D8
callq 0x855b0
movq 0x50(%rsp), %rax
movss 0x144(%rax), %xmm0
movq 0x20(%rsp), %rax
movss 0x20(%rax), %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x28(%rsp)
movq 0x50(%rsp), %rax
movss 0x148(%rax), %xmm0
movq 0x20(%rsp), %rax
movss 0x24(%rax), %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x2c(%rsp)
movq 0x20(%rsp), %rax
movss 0x18(%rax), %xmm0
movss %xmm0, 0x30(%rsp)
movq 0x20(%rsp), %rax
movss 0x1c(%rax), %xmm0
movss %xmm0, 0x34(%rsp)
movq 0x50(%rsp), %rdi
addq $0x46d8, %rdi           # imm = 0x46D8
movq 0x20(%rsp), %rsi
movsd 0x28(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
movl 0x5cb47(%rip), %edx     # 0xb12b0
callq 0x14690
movq 0x50(%rsp), %rdi
movq 0x50(%rsp), %rsi
addq $0x46d8, %rsi           # imm = 0x46D8
callq 0x856b0
movq 0x50(%rsp), %rax
movq 0x4768(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x50(%rsp), %rax
movq 0x2548(%rax), %rax
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x48(%rsp)
je 0x548d4
movq 0x48(%rsp), %rax
movq 0x1c8(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x48(%rsp), %rax
movq 0xa0(%rax), %rax
movq 0x48(%rsp), %rcx
cmpq 0x90(%rcx), %rax
je 0x54803
movq 0x48(%rsp), %rax
movl 0x48(%rax), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
jne 0x54803
movq 0x48(%rsp), %rax
movl (%rax), %eax
movq 0x50(%rsp), %rcx
cmpl 0x4794(%rcx), %eax
je 0x54808
jmp 0x548c5
movq 0x38(%rsp), %rax
movq 0x48(%rsp), %rcx
addq 0xa0(%rcx), %rax
movq %rax, 0x40(%rsp)
xorl %eax, %eax
cmpq $0x0, 0x18(%rsp)
movb %al, 0x7(%rsp)
je 0x54886
movq 0x18(%rsp), %rax
movq 0xa0(%rax), %rcx
movq 0x18(%rsp), %rdx
movb $0x1, %al
cmpq 0x90(%rdx), %rcx
movb %al, 0x6(%rsp)
je 0x5487e
movq 0x18(%rsp), %rax
movl 0x48(%rax), %ecx
andl $0x2000, %ecx           # imm = 0x2000
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, 0x6(%rsp)
jne 0x5487e
movq 0x18(%rsp), %rax
movl (%rax), %eax
movq 0x50(%rsp), %rcx
cmpl 0x4794(%rcx), %eax
setne %al
movb %al, 0x6(%rsp)
movb 0x6(%rsp), %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x54890
jmp 0x548a6
movq 0x18(%rsp), %rax
movq 0x1c8(%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0x5481e
cmpq $0x0, 0x18(%rsp)
je 0x548c3
movq 0x18(%rsp), %rax
movq 0x90(%rax), %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x8(%rax)
jmp 0x548c5
movq 0x18(%rsp), %rax
movq %rax, 0x48(%rsp)
jmp 0x547a6
movq 0x50(%rsp), %rax
movq 0x4768(%rax), %rax
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x48(%rsp)
je 0x5495e
movq 0x48(%rsp), %rax
movq 0x1c8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x48(%rsp), %rax
cmpl $0x0, 0x150(%rax)
jne 0x5490e
jmp 0x54952
movq 0x48(%rsp), %rax
addq $0x120, %rax            # imm = 0x120
addq $0x10, %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq (%rax), %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x38(%rsp), %rax
movq 0x8(%rsp), %rcx
addq 0x10(%rcx), %rax
movq %rax, 0x40(%rsp)
movq 0x8(%rsp), %rax
movl $0x0, 0x20(%rax)
movq 0x10(%rsp), %rax
movq %rax, 0x48(%rsp)
jmp 0x548e5
cmpq $0x0, 0x40(%rsp)
je 0x549ae
movq 0x50(%rsp), %rax
movq 0x4708(%rax), %rax
movq 0x50(%rsp), %rcx
cmpq 0x4700(%rcx), %rax
je 0x54997
movq 0x50(%rsp), %rax
movq 0x4700(%rax), %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x8(%rax)
jmp 0x549ac
movq 0x50(%rsp), %rax
movq 0x2560(%rax), %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x8(%rax)
jmp 0x549ae
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)