// File: /workspace/github_c_makefile_star2_O0/space222[P]silo/./nuklear.h
// Function: nk_tree_state_base(nk_context*, nk_tree_type, nk_image*, char const*, nk_collapse_states*)
NK_INTERN int
nk_tree_state_base(struct nk_context *ctx, enum nk_tree_type type,
    struct nk_image *img, const char *title, enum nk_collapse_states *state)
{
    struct nk_window *win;
    struct nk_panel *layout;
    const struct nk_style *style;
    struct nk_command_buffer *out;
    const struct nk_input *in;
    const struct nk_style_button *button;
    enum nk_symbol_type symbol;
    float row_height;

    struct nk_vec2 item_spacing;
    struct nk_rect header = {0,0,0,0};
    struct nk_rect sym = {0,0,0,0};
    struct nk_text text;

    nk_flags ws = 0;
    enum nk_widget_layout_states widget_state;

    NK_ASSERT(ctx);
    NK_ASSERT(ctx->current);
    NK_ASSERT(ctx->current->layout);
    if (!ctx || !ctx->current || !ctx->current->layout)
        return 0;

    /* cache some data */
    win = ctx->current;
    layout = win->layout;
    out = &win->buffer;
    style = &ctx->style;
    item_spacing = style->window.spacing;

    /* calculate header bounds and draw background */
    row_height = style->font->height + 2 * style->tab.padding.y;
    nk_layout_set_min_row_height(ctx, row_height);
    nk_layout_row_dynamic(ctx, row_height, 1);
    nk_layout_reset_min_row_height(ctx);

    widget_state = nk_widget(&header, ctx);
    if (type == NK_TREE_TAB) {
        const struct nk_style_item *background = &style->tab.background;
        if (background->type == NK_STYLE_ITEM_IMAGE) {
            nk_draw_image(out, header, &background->data.image, nk_white);
            text.background = nk_rgba(0,0,0,0);
        } else {
            text.background = background->data.color;
            nk_fill_rect(out, header, 0, style->tab.border_color);
            nk_fill_rect(out, nk_shrink_rect(header, style->tab.border),
                style->tab.rounding, background->data.color);
        }
    } else text.background = style->window.background;

    /* update node state */
    in = (!(layout->flags & NK_WINDOW_ROM)) ? &ctx->input: 0;
    in = (in && widget_state == NK_WIDGET_VALID) ? &ctx->input : 0;
    if (nk_button_behavior(&ws, header, in, NK_BUTTON_DEFAULT))
        *state = (*state == NK_MAXIMIZED) ? NK_MINIMIZED : NK_MAXIMIZED;

    /* select correct button style */
    if (*state == NK_MAXIMIZED) {
        symbol = style->tab.sym_maximize;
        if (type == NK_TREE_TAB)
            button = &style->tab.tab_maximize_button;
        else button = &style->tab.node_maximize_button;
    } else {
        symbol = style->tab.sym_minimize;
        if (type == NK_TREE_TAB)
            button = &style->tab.tab_minimize_button;
        else button = &style->tab.node_minimize_button;
    }

    {/* draw triangle button */
    sym.w = sym.h = style->font->height;
    sym.y = header.y + style->tab.padding.y;
    sym.x = header.x + style->tab.padding.x;
    nk_do_button_symbol(&ws, &win->buffer, sym, symbol, NK_BUTTON_DEFAULT,
        button, 0, style->font);

    if (img) {
        /* draw optional image icon */
        sym.x = sym.x + sym.w + 4 * item_spacing.x;
        nk_draw_image(&win->buffer, sym, img, nk_white);
        sym.w = style->font->height + style->tab.spacing.x;}
    }

    {/* draw label */
    struct nk_rect label;
    header.w = NK_MAX(header.w, sym.w + item_spacing.x);
    label.x = sym.x + sym.w + item_spacing.x;
    label.y = sym.y;
    label.w = header.w - (sym.w + item_spacing.y + style->tab.indent);
    label.h = style->font->height;
    text.text = style->tab.text;
    text.padding = nk_vec2(0,0);
    nk_widget_text(out, label, title, nk_strlen(title), &text,
        NK_TEXT_LEFT, style->font);}

    /* increase x-axis cursor widget position pointer */
    if (*state == NK_MAXIMIZED) {
        layout->at_x = header.x + (float)*layout->offset_x + style->tab.indent;
        layout->bounds.w = NK_MAX(layout->bounds.w, style->tab.indent);
        layout->bounds.w -= (style->tab.indent + style->window.padding.x);
        layout->row.tree_depth++;
        return nk_true;
    } else return nk_false;
}

// Assembly:
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rdi, 0x1b8(%rsp)
movl %esi, 0x1b4(%rsp)
movq %rdx, 0x1a8(%rsp)
movq %rcx, 0x1a0(%rsp)
movq %r8, 0x198(%rsp)
leaq 0x148(%rsp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x20d0
leaq 0x138(%rsp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x20d0
movl $0x0, 0x124(%rsp)
cmpq $0x0, 0x1b8(%rsp)
je 0x20e1e
jmp 0x20e3d
leaq 0x276fa(%rip), %rdi     # 0x4851f
leaq 0x24587(%rip), %rsi     # 0x453b3
movl $0x47ba, %edx           # imm = 0x47BA
leaq 0x29baf(%rip), %rcx     # 0x4a9e7
callq 0x20a0
movq 0x1b8(%rsp), %rax
cmpq $0x0, 0x3fe8(%rax)
je 0x20e51
jmp 0x20e70
leaq 0x260a1(%rip), %rdi     # 0x46ef9
leaq 0x24554(%rip), %rsi     # 0x453b3
movl $0x47bb, %edx           # imm = 0x47BB
leaq 0x29b7c(%rip), %rcx     # 0x4a9e7
callq 0x20a0
movq 0x1b8(%rsp), %rax
movq 0x3fe8(%rax), %rax
cmpq $0x0, 0xa8(%rax)
je 0x20e8b
jmp 0x20eaa
leaq 0x261e3(%rip), %rdi     # 0x47075
leaq 0x2451a(%rip), %rsi     # 0x453b3
movl $0x47bc, %edx           # imm = 0x47BC
leaq 0x29b42(%rip), %rcx     # 0x4a9e7
callq 0x20a0
cmpq $0x0, 0x1b8(%rsp)
je 0x20ee0
movq 0x1b8(%rsp), %rax
cmpq $0x0, 0x3fe8(%rax)
je 0x20ee0
movq 0x1b8(%rsp), %rax
movq 0x3fe8(%rax), %rax
cmpq $0x0, 0xa8(%rax)
jne 0x20ef0
movl $0x0, 0x1c4(%rsp)
jmp 0x21739
movq 0x1b8(%rsp), %rax
movq 0x3fe8(%rax), %rax
movq %rax, 0x190(%rsp)
movq 0x190(%rsp), %rax
movq 0xa8(%rax), %rax
movq %rax, 0x188(%rsp)
movq 0x190(%rsp), %rax
addq $0x68, %rax
movq %rax, 0x178(%rsp)
movq 0x1b8(%rsp), %rax
addq $0x168, %rax            # imm = 0x168
movq %rax, 0x180(%rsp)
movq 0x180(%rsp), %rax
movq 0x1d24(%rax), %rax
movq %rax, 0x158(%rsp)
movq 0x180(%rsp), %rax
movq (%rax), %rax
movss 0x8(%rax), %xmm1
movq 0x180(%rsp), %rax
movss 0x1938(%rax), %xmm0
addss %xmm0, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x160(%rsp)
movq 0x1b8(%rsp), %rdi
movss 0x160(%rsp), %xmm0
callq 0x1e620
movq 0x1b8(%rsp), %rdi
movss 0x160(%rsp), %xmm0
movl $0x1, %esi
callq 0x1e8b0
movq 0x1b8(%rsp), %rdi
callq 0x11d40
movq 0x1b8(%rsp), %rsi
leaq 0x148(%rsp), %rdi
callq 0x1cd90
movl %eax, 0x120(%rsp)
cmpl $0x1, 0x1b4(%rsp)
jne 0x2118c
movq 0x180(%rsp), %rax
addq $0x1638, %rax           # imm = 0x1638
movq %rax, 0x118(%rsp)
movq 0x118(%rsp), %rax
cmpl $0x1, (%rax)
jne 0x2108f
movq 0x178(%rsp), %rdi
movups 0x148(%rsp), %xmm0
movaps %xmm0, 0x100(%rsp)
movq 0x118(%rsp), %rsi
addq $0x8, %rsi
movl $0xffffffff, 0xfc(%rsp) # imm = 0xFFFFFFFF
movsd 0x100(%rsp), %xmm0
movsd 0x108(%rsp), %xmm1
movl 0xfc(%rsp), %edx
callq 0xc3c0
xorl %ecx, %ecx
movl %ecx, %edi
movl %ecx, %esi
movl %ecx, %edx
callq 0x57b0
movl %eax, 0xf8(%rsp)
movl 0xf8(%rsp), %eax
movl %eax, 0x130(%rsp)
jmp 0x2118a
movq 0x118(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0x130(%rsp)
movq 0x178(%rsp), %rdi
movups 0x148(%rsp), %xmm0
movaps %xmm0, 0xe0(%rsp)
movq 0x180(%rsp), %rax
movl 0x1658(%rax), %eax
movl %eax, 0xdc(%rsp)
movsd 0xe0(%rsp), %xmm0
movsd 0xe8(%rsp), %xmm1
movl 0xdc(%rsp), %esi
xorps %xmm2, %xmm2
callq 0xb130
movq 0x178(%rsp), %rax
movq %rax, 0x38(%rsp)
movups 0x148(%rsp), %xmm0
movaps %xmm0, 0xb0(%rsp)
movq 0x180(%rsp), %rax
movss 0x1928(%rax), %xmm2
movsd 0xb0(%rsp), %xmm0
movsd 0xb8(%rsp), %xmm1
callq 0x31050
movq 0x38(%rsp), %rdi
movlpd %xmm0, 0xcc(%rsp)
movlpd %xmm1, 0xd4(%rsp)
movq 0x180(%rsp), %rax
movss 0x192c(%rax), %xmm2
movq 0x118(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0xac(%rsp)
movsd 0xcc(%rsp), %xmm0
movsd 0xd4(%rsp), %xmm1
movl 0xac(%rsp), %esi
callq 0xb130
jmp 0x211a1
movq 0x180(%rsp), %rax
movl 0x1cc0(%rax), %eax
movl %eax, 0x130(%rsp)
movq 0x188(%rsp), %rax
movl 0x4(%rax), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
jne 0x211c5
movq 0x1b8(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x211ce
xorl %eax, %eax
movq %rax, 0x30(%rsp)
jmp 0x211ce
movq 0x30(%rsp), %rax
movq %rax, 0x170(%rsp)
cmpq $0x0, 0x170(%rsp)
je 0x211ff
cmpl $0x1, 0x120(%rsp)
jne 0x211ff
movq 0x1b8(%rsp), %rax
movq %rax, 0x28(%rsp)
jmp 0x21208
xorl %eax, %eax
movq %rax, 0x28(%rsp)
jmp 0x21208
movq 0x28(%rsp), %rax
movq %rax, 0x170(%rsp)
movups 0x148(%rsp), %xmm0
movaps %xmm0, 0x90(%rsp)
movq 0x170(%rsp), %rsi
movsd 0x90(%rsp), %xmm0
movsd 0x98(%rsp), %xmm1
leaq 0x124(%rsp), %rdi
xorl %edx, %edx
callq 0x338c0
cmpl $0x0, %eax
je 0x21274
movq 0x198(%rsp), %rax
movl (%rax), %edx
movl $0x1, %ecx
xorl %eax, %eax
cmpl $0x1, %edx
cmovel %eax, %ecx
movq 0x198(%rsp), %rax
movl %ecx, (%rax)
movq 0x198(%rsp), %rax
cmpl $0x1, (%rax)
jne 0x212da
movq 0x180(%rsp), %rax
movl 0x1924(%rax), %eax
movl %eax, 0x164(%rsp)
cmpl $0x1, 0x1b4(%rsp)
jne 0x212bc
movq 0x180(%rsp), %rax
addq $0x1638, %rax           # imm = 0x1638
addq $0x28, %rax
movq %rax, 0x168(%rsp)
jmp 0x212d8
movq 0x180(%rsp), %rax
addq $0x1638, %rax           # imm = 0x1638
addq $0x188, %rax            # imm = 0x188
movq %rax, 0x168(%rsp)
jmp 0x21335
movq 0x180(%rsp), %rax
movl 0x1920(%rax), %eax
movl %eax, 0x164(%rsp)
cmpl $0x1, 0x1b4(%rsp)
jne 0x21317
movq 0x180(%rsp), %rax
addq $0x1638, %rax           # imm = 0x1638
addq $0xd8, %rax
movq %rax, 0x168(%rsp)
jmp 0x21333
movq 0x180(%rsp), %rax
addq $0x1638, %rax           # imm = 0x1638
addq $0x238, %rax            # imm = 0x238
movq %rax, 0x168(%rsp)
jmp 0x21335
movq 0x180(%rsp), %rax
movq (%rax), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, 0x144(%rsp)
movss %xmm0, 0x140(%rsp)
movss 0x14c(%rsp), %xmm0
movq 0x180(%rsp), %rax
movss 0x1938(%rax), %xmm1
addss %xmm1, %xmm0
movss %xmm0, 0x13c(%rsp)
movss 0x148(%rsp), %xmm0
movq 0x180(%rsp), %rax
movss 0x1934(%rax), %xmm1
addss %xmm1, %xmm0
movss %xmm0, 0x138(%rsp)
movq 0x190(%rsp), %rsi
addq $0x68, %rsi
movups 0x138(%rsp), %xmm0
movaps %xmm0, 0x80(%rsp)
movl 0x164(%rsp), %edx
movq 0x168(%rsp), %r8
movq 0x180(%rsp), %rax
movq (%rax), %rcx
movsd 0x80(%rsp), %xmm0
movsd 0x88(%rsp), %xmm1
movq %rsp, %rax
movq %rcx, (%rax)
xorl %ecx, %ecx
movl %ecx, %r9d
leaq 0x124(%rsp), %rdi
callq 0x1dba0
cmpq $0x0, 0x1a8(%rsp)
je 0x214b1
movss 0x138(%rsp), %xmm1
movss 0x140(%rsp), %xmm0
addss %xmm0, %xmm1
movss 0x158(%rsp), %xmm0
movss 0x23cfb(%rip), %xmm2    # 0x45134
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x138(%rsp)
movq 0x190(%rsp), %rdi
addq $0x68, %rdi
movups 0x138(%rsp), %xmm0
movaps %xmm0, 0x70(%rsp)
movq 0x1a8(%rsp), %rsi
movl $0xffffffff, 0x6c(%rsp) # imm = 0xFFFFFFFF
movsd 0x70(%rsp), %xmm0
movsd 0x78(%rsp), %xmm1
movl 0x6c(%rsp), %edx
callq 0xc3c0
movq 0x180(%rsp), %rax
movq (%rax), %rax
movss 0x8(%rax), %xmm0
movq 0x180(%rsp), %rax
addss 0x193c(%rax), %xmm0
movss %xmm0, 0x140(%rsp)
movss 0x150(%rsp), %xmm1
movss 0x140(%rsp), %xmm0
addss 0x158(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x214eb
movss 0x140(%rsp), %xmm0
addss 0x158(%rsp), %xmm0
movss %xmm0, 0x24(%rsp)
jmp 0x214fa
movss 0x150(%rsp), %xmm0
movss %xmm0, 0x24(%rsp)
movss 0x24(%rsp), %xmm0
movss %xmm0, 0x150(%rsp)
movss 0x138(%rsp), %xmm0
movss 0x140(%rsp), %xmm1
addss %xmm1, %xmm0
movss 0x158(%rsp), %xmm1
addss %xmm1, %xmm0
movss %xmm0, 0x5c(%rsp)
movss 0x13c(%rsp), %xmm0
movss %xmm0, 0x60(%rsp)
movss 0x150(%rsp), %xmm0
movss 0x140(%rsp), %xmm1
movss 0x15c(%rsp), %xmm2
addss %xmm2, %xmm1
movq 0x180(%rsp), %rax
movss 0x1930(%rax), %xmm2
addss %xmm2, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x64(%rsp)
movq 0x180(%rsp), %rax
movq (%rax), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, 0x68(%rsp)
movq 0x180(%rsp), %rax
movl 0x165c(%rax), %eax
movl %eax, 0x134(%rsp)
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0x41b0
movlpd %xmm0, 0x54(%rsp)
movq 0x54(%rsp), %rax
movq %rax, 0x128(%rsp)
movq 0x178(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x5c(%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movq 0x1a0(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x4720
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl %eax, %edx
movq 0x180(%rsp), %rax
movq (%rax), %r9
movsd 0x40(%rsp), %xmm0
movsd 0x48(%rsp), %xmm1
leaq 0x128(%rsp), %rcx
movl $0x11, %r8d
callq 0x24820
movq 0x198(%rsp), %rax
cmpl $0x1, (%rax)
jne 0x2172e
movss 0x148(%rsp), %xmm0
movq 0x188(%rsp), %rax
movq 0x18(%rax), %rax
movl (%rax), %eax
cvtsi2ss %rax, %xmm1
addss %xmm1, %xmm0
movq 0x180(%rsp), %rax
addss 0x1930(%rax), %xmm0
movq 0x188(%rsp), %rax
movss %xmm0, 0x28(%rax)
movq 0x188(%rsp), %rax
movss 0x10(%rax), %xmm1
movq 0x180(%rsp), %rax
movss 0x1930(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x216ae
movq 0x180(%rsp), %rax
movss 0x1930(%rax), %xmm0
movss %xmm0, 0xc(%rsp)
jmp 0x216c1
movq 0x188(%rsp), %rax
movss 0x10(%rax), %xmm0
movss %xmm0, 0xc(%rsp)
movss 0xc(%rsp), %xmm0
movq 0x188(%rsp), %rax
movss %xmm0, 0x10(%rax)
movq 0x180(%rsp), %rax
movss 0x1930(%rax), %xmm1
movq 0x180(%rsp), %rax
addss 0x1d3c(%rax), %xmm1
movq 0x188(%rsp), %rax
movss 0x10(%rax), %xmm0
subss %xmm1, %xmm0
movss %xmm0, 0x10(%rax)
movq 0x188(%rsp), %rax
movl 0xb0(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xb0(%rax)
movl $0x1, 0x1c4(%rsp)
jmp 0x21739
movl $0x0, 0x1c4(%rsp)
movl 0x1c4(%rsp), %eax
addq $0x1c8, %rsp            # imm = 0x1C8
retq
nopl (%rax,%rax)