// File: /workspace/github_c_makefile_star2_O3/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_tree_state_base
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;

        switch(background->type) {
            case NK_STYLE_ITEM_IMAGE:
                nk_draw_image(out, header, &background->data.image, nk_rgb_factor(nk_white, style->tab.color_factor));
                break;
            case NK_STYLE_ITEM_NINE_SLICE:
                nk_draw_nine_slice(out, header, &background->data.slice, nk_rgb_factor(nk_white, style->tab.color_factor));
                break;
            case NK_STYLE_ITEM_COLOR:
                nk_fill_rect(out, header, 0, nk_rgb_factor(style->tab.border_color, style->tab.color_factor));
                nk_fill_rect(out, nk_shrink_rect(header, style->tab.border),
                    style->tab.rounding, nk_rgb_factor(background->data.color, style->tab.color_factor));
                break;
        }
    } 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 = nk_rgb_factor(style->tab.text, style->tab.color_factor);
    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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r8, %r14
movq %rcx, 0x80(%rsp)
movq %rdx, 0x70(%rsp)
movl %esi, %ebp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movl $0x0, 0x38(%rsp)
testq %rdi, %rdi
jne 0x422ca
movq 0x44d4b(%rip), %r15     # 0x86ff0
movq (%r15), %rdi
leaq 0x2eaed(%rip), %rsi     # 0x70d9c
leaq 0x2eb04(%rip), %rdx     # 0x70dba
movl $0x57d6, %ecx           # imm = 0x57D6
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
movq 0x4780(%rbx), %r13
testq %r13, %r13
jne 0x42309
movq 0x44d13(%rip), %r15     # 0x86ff0
movq (%r15), %rdi
leaq 0x2eab5(%rip), %rsi     # 0x70d9c
leaq 0x2eacc(%rip), %rdx     # 0x70dba
movl $0x57d7, %ecx           # imm = 0x57D7
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
movq 0x4780(%rbx), %r13
cmpq $0x0, 0xa8(%r13)
jne 0x42354
movq 0x44cd6(%rip), %r12     # 0x86ff0
movq (%r12), %rdi
leaq 0x2ea77(%rip), %rsi     # 0x70d9c
leaq 0x2ea8e(%rip), %rdx     # 0x70dba
xorl %r15d, %r15d
movl $0x57d8, %ecx           # imm = 0x57D8
xorl %eax, %eax
callq 0x12d80
movq (%r12), %rdi
callq 0x13780
movq 0x4780(%rbx), %r13
testq %r13, %r13
je 0x426b7
movq 0xa8(%r13), %r12
testq %r12, %r12
je 0x426b4
addq $0x68, %r13
movss 0x24b4(%rbx), %xmm0
movss %xmm0, 0x50(%rsp)
movss 0x24b8(%rbx), %xmm0
movss %xmm0, 0x3c(%rsp)
movq 0x168(%rbx), %rax
movss 0x2000(%rbx), %xmm0
addss %xmm0, %xmm0
addss 0x8(%rax), %xmm0
movss %xmm0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x138c0
movq %rbx, %rdi
xorl %esi, %esi
movss 0x20(%rsp), %xmm0
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x407cc
movq %rbx, %rdi
callq 0x13bf0
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x128e0
movl %eax, %r15d
cmpl $0x1, %ebp
jne 0x42457
movl 0x1c58(%rbx), %eax
testl %eax, %eax
je 0x4272c
cmpl $0x2, %eax
je 0x426cc
cmpl $0x1, %eax
jne 0x42464
leaq 0x1c60(%rbx), %rsi
movss 0x200c(%rbx), %xmm0
movss 0x2b497(%rip), %xmm1    # 0x6d8a8
mulss %xmm0, %xmm1
cvttss2si %xmm1, %eax
movl $0xff, %ecx
andl %ecx, %eax
ucomiss 0x2b47d(%rip), %xmm0    # 0x6d8a4
cmovnel %eax, %ecx
cmovpl %eax, %ecx
movl %ecx, %eax
shll $0x10, %eax
movl %ecx, %edx
shll $0x8, %edx
orl %eax, %edx
addl %ecx, %edx
addl $0xff000000, %edx       # imm = 0xFF000000
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movq %r13, %rdi
callq 0x134d0
jmp 0x42464
movl 0x2448(%rbx), %eax
movl %eax, 0x90(%rsp)
movl $0x1000, %eax           # imm = 0x1000
andl 0x4(%r12), %eax
xorl $0x1, %r15d
xorl %esi, %esi
orl %eax, %r15d
cmoveq %rbx, %rsi
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
leaq 0x38(%rsp), %rdi
movaps %xmm0, 0x20(%rsp)
xorl %edx, %edx
callq 0x5160c
movl (%r14), %ecx
testl %eax, %eax
je 0x424c3
xorl %eax, %eax
cmpl $0x1, %ecx
setne %al
movl %eax, (%r14)
je 0x424c8
leaq 0x1fec(%rbx), %rax
cmpl $0x1, %ebp
movl $0x1c88, %ecx           # imm = 0x1C88
movl $0x1e38, %r8d           # imm = 0x1E38
jmp 0x424dd
cmpl $0x1, %ecx
je 0x424ac
leaq 0x1fe8(%rbx), %rax
cmpl $0x1, %ebp
movl $0x1d60, %ecx           # imm = 0x1D60
movl $0x1f10, %r8d           # imm = 0x1F10
cmoveq %rcx, %r8
movaps 0x20(%rsp), %xmm0
movl (%rax), %edx
addq %rbx, %r8
movq 0x168(%rbx), %rax
movss 0x8(%rax), %xmm1
movaps %xmm1, 0x60(%rsp)
shufps $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
movsd 0x1ffc(%rbx), %xmm2
addps %xmm2, %xmm0
movaps %xmm0, 0x20(%rsp)
movq %rax, (%rsp)
leaq 0x38(%rsp), %rdi
movq %r13, %rsi
movaps %xmm1, 0x40(%rsp)
xorl %ecx, %ecx
xorl %r9d, %r9d
callq 0x3ffe3
movq 0x70(%rsp), %rsi
testq %rsi, %rsi
je 0x42599
movaps 0x20(%rsp), %xmm0
movaps 0x60(%rsp), %xmm2
addss %xmm0, %xmm2
movss 0x2b3d1(%rip), %xmm1    # 0x6d91c
mulss 0x50(%rsp), %xmm1
addss %xmm2, %xmm1
movss %xmm1, %xmm0            # xmm0 = xmm1[0],xmm0[1,2,3]
movq %r13, %rdi
movaps %xmm0, 0x20(%rsp)
movaps 0x40(%rsp), %xmm1
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x134d0
movq 0x168(%rbx), %rax
movss 0x8(%rax), %xmm0
movss 0x2004(%rbx), %xmm1
addss %xmm0, %xmm1
movaps 0x40(%rsp), %xmm2
movss %xmm1, %xmm2            # xmm2 = xmm1[0],xmm2[1,2,3]
movss 0x50(%rsp), %xmm1
jmp 0x425b0
movq 0x168(%rbx), %rax
movss 0x8(%rax), %xmm0
movss 0x50(%rsp), %xmm1
movaps 0x40(%rsp), %xmm2
movaps %xmm1, %xmm3
addss %xmm2, %xmm3
maxss 0x18(%rsp), %xmm3
movss %xmm3, 0x18(%rsp)
movaps 0x20(%rsp), %xmm4
addss %xmm2, %xmm4
addss %xmm1, %xmm4
movaps %xmm4, 0x70(%rsp)
movss 0x3c(%rsp), %xmm1
addss %xmm2, %xmm1
addss 0x1ff8(%rbx), %xmm1
subss %xmm1, %xmm3
unpcklps %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1]
movaps %xmm3, 0x50(%rsp)
movss 0x200c(%rbx), %xmm0
movl 0x1c84(%rbx), %edi
callq 0x13e60
leaq 0x88(%rsp), %r15
movl %eax, 0xc(%r15)
movq $0x0, (%r15)
movq 0x80(%rsp), %rbp
movq %rbp, %rdi
callq 0x12f10
movq 0x168(%rbx), %r9
movaps 0x20(%rsp), %xmm0
movaps 0x70(%rsp), %xmm1
movss %xmm1, %xmm0            # xmm0 = xmm1[0],xmm0[1,2,3]
movq %r13, %rdi
movaps 0x50(%rsp), %xmm1
movq %rbp, %rsi
movl %eax, %edx
movq %r15, %rcx
movl $0x11, %r8d
callq 0x451c6
cmpl $0x1, (%r14)
jne 0x426b4
movq 0x18(%r12), %rax
movl (%rax), %eax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
addss 0x10(%rsp), %xmm0
movss 0x1ff8(%rbx), %xmm1
addss %xmm1, %xmm0
movss %xmm0, 0x28(%r12)
movaps %xmm1, %xmm0
maxss 0x10(%r12), %xmm0
addss 0x24cc(%rbx), %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x10(%r12)
incl 0xb0(%r12)
movl $0x1, %r15d
jmp 0x426b7
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1c60(%rbx), %rsi
movss 0x200c(%rbx), %xmm0
movss 0x2b1c5(%rip), %xmm1    # 0x6d8a8
mulss %xmm0, %xmm1
cvttss2si %xmm1, %eax
movl $0xff, %ecx
andl %ecx, %eax
ucomiss 0x2b1ab(%rip), %xmm0    # 0x6d8a4
cmovnel %eax, %ecx
cmovpl %eax, %ecx
movl %ecx, %eax
shll $0x10, %eax
movl %ecx, %edx
shll $0x8, %edx
orl %eax, %edx
addl %ecx, %edx
addl $0xff000000, %edx       # imm = 0xFF000000
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movq %r13, %rdi
callq 0x13fe0
jmp 0x42464
movss 0x200c(%rbx), %xmm0
movl 0x1c80(%rbx), %edi
callq 0x13e60
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
xorps %xmm2, %xmm2
movq %r13, %rdi
movl %eax, %esi
callq 0x12de0
movss 0x1ff0(%rbx), %xmm0
movsd 0x10(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
movaps %xmm0, %xmm3
shufps $0x0, %xmm0, %xmm3      # xmm3 = xmm3[0,0],xmm0[0,0]
addps %xmm1, %xmm3
movaps %xmm3, 0x20(%rsp)
addss %xmm0, %xmm0
shufps $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movaps %xmm0, %xmm1
maxps %xmm2, %xmm1
subps %xmm0, %xmm1
movaps %xmm1, 0x60(%rsp)
movss 0x1ff4(%rbx), %xmm0
movss %xmm0, 0x40(%rsp)
movss 0x200c(%rbx), %xmm0
movl 0x1c60(%rbx), %edi
callq 0x13e60
movq %r13, %rdi
movaps 0x20(%rsp), %xmm0
movaps 0x60(%rsp), %xmm1
movss 0x40(%rsp), %xmm2
movl %eax, %esi
callq 0x12de0
jmp 0x42464