// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x168, %rsp            # imm = 0x168
movq %rdi, 0x158(%rsp)
movl %esi, 0x154(%rsp)
movq %rdx, 0x148(%rsp)
movq %rcx, 0x140(%rsp)
movq %r8, 0x138(%rsp)
leaq 0xe8(%rsp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x13c40
leaq 0xd8(%rsp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x13c40
movl $0x0, 0xc4(%rsp)
cmpq $0x0, 0x158(%rsp)
jne 0x6228f
movq 0x62d8d(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
leaq 0x4f133(%rip), %rsi     # 0xb13a0
leaq 0x4f14a(%rip), %rdx     # 0xb13be
movl $0x57d6, %ecx           # imm = 0x57D6
movb $0x0, %al
callq 0x13ec0
movq 0x62d69(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
callq 0x149a0
jmp 0x62291
jmp 0x62293
movq 0x158(%rsp), %rax
cmpq $0x0, 0x4780(%rax)
jne 0x622d8
movq 0x62d44(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
leaq 0x4f0ea(%rip), %rsi     # 0xb13a0
leaq 0x4f101(%rip), %rdx     # 0xb13be
movl $0x57d7, %ecx           # imm = 0x57D7
movb $0x0, %al
callq 0x13ec0
movq 0x62d20(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
callq 0x149a0
jmp 0x622da
jmp 0x622dc
movq 0x158(%rsp), %rax
movq 0x4780(%rax), %rax
cmpq $0x0, 0xa8(%rax)
jne 0x62328
movq 0x62cf4(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
leaq 0x4f09a(%rip), %rsi     # 0xb13a0
leaq 0x4f0b1(%rip), %rdx     # 0xb13be
movl $0x57d8, %ecx           # imm = 0x57D8
movb $0x0, %al
callq 0x13ec0
movq 0x62cd0(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
callq 0x149a0
jmp 0x6232a
cmpq $0x0, 0x158(%rsp)
je 0x62360
movq 0x158(%rsp), %rax
cmpq $0x0, 0x4780(%rax)
je 0x62360
movq 0x158(%rsp), %rax
movq 0x4780(%rax), %rax
cmpq $0x0, 0xa8(%rax)
jne 0x62370
movl $0x0, 0x164(%rsp)
jmp 0x62c37
movq 0x158(%rsp), %rax
movq 0x4780(%rax), %rax
movq %rax, 0x130(%rsp)
movq 0x130(%rsp), %rax
movq 0xa8(%rax), %rax
movq %rax, 0x128(%rsp)
movq 0x130(%rsp), %rax
addq $0x68, %rax
movq %rax, 0x118(%rsp)
movq 0x158(%rsp), %rax
addq $0x168, %rax            # imm = 0x168
movq %rax, 0x120(%rsp)
movq 0x120(%rsp), %rax
movq 0x234c(%rax), %rax
movq %rax, 0xf8(%rsp)
movq 0x120(%rsp), %rax
movq (%rax), %rax
movss 0x8(%rax), %xmm1
movq 0x120(%rsp), %rax
movss 0x1e98(%rax), %xmm0
addss %xmm0, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x100(%rsp)
movq 0x158(%rsp), %rdi
movss 0x100(%rsp), %xmm0
callq 0x14af0
movq 0x158(%rsp), %rdi
movss 0x100(%rsp), %xmm0
movl $0x1, %esi
callq 0x13f60
movq 0x158(%rsp), %rdi
callq 0x14e40
movq 0x158(%rsp), %rsi
leaq 0xe8(%rsp), %rdi
callq 0x139c0
movl %eax, 0xc0(%rsp)
cmpl $0x1, 0x154(%rsp)
jne 0x62694
movq 0x120(%rsp), %rax
addq $0x1af0, %rax           # imm = 0x1AF0
movq %rax, 0xb8(%rsp)
movq 0xb8(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x78(%rsp)
testl %eax, %eax
je 0x62599
jmp 0x624a6
movl 0x78(%rsp), %eax
subl $0x1, %eax
je 0x624bf
jmp 0x624b1
movl 0x78(%rsp), %eax
subl $0x2, %eax
je 0x6252c
jmp 0x62692
movq 0x118(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0xb8(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x70(%rsp)
movq 0x120(%rsp), %rax
movss 0x1ea4(%rax), %xmm0
movl 0x4edbd(%rip), %edi     # 0xb12b0
callq 0x15100
movq 0x68(%rsp), %rdi
movq 0x70(%rsp), %rsi
movl %eax, 0xb4(%rsp)
movsd 0xe8(%rsp), %xmm0
movsd 0xf0(%rsp), %xmm1
movl 0xb4(%rsp), %edx
callq 0x14690
jmp 0x62692
movq 0x118(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0xb8(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x60(%rsp)
movq 0x120(%rsp), %rax
movss 0x1ea4(%rax), %xmm0
movl 0x4ed50(%rip), %edi     # 0xb12b0
callq 0x15100
movq 0x58(%rsp), %rdi
movq 0x60(%rsp), %rsi
movl %eax, 0xb0(%rsp)
movsd 0xe8(%rsp), %xmm0
movsd 0xf0(%rsp), %xmm1
movl 0xb0(%rsp), %edx
callq 0x152a0
jmp 0x62692
movq 0x118(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x120(%rsp), %rax
movss 0x1ea4(%rax), %xmm0
movl 0x1b18(%rax), %edi
callq 0x15100
movq 0x40(%rsp), %rdi
movl %eax, 0xac(%rsp)
movsd 0xe8(%rsp), %xmm0
movsd 0xf0(%rsp), %xmm1
movl 0xac(%rsp), %esi
xorps %xmm2, %xmm2
callq 0x13f10
movq 0x118(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x120(%rsp), %rax
movss 0x1e88(%rax), %xmm2
movsd 0xe8(%rsp), %xmm0
movsd 0xf0(%rsp), %xmm1
callq 0x75600
movlpd %xmm0, 0x9c(%rsp)
movlpd %xmm1, 0xa4(%rsp)
movq 0x120(%rsp), %rax
movss 0x1e8c(%rax), %xmm0
movss %xmm0, 0x54(%rsp)
movss 0x1ea4(%rax), %xmm0
movq 0xb8(%rsp), %rax
movl 0x8(%rax), %edi
callq 0x15100
movq 0x48(%rsp), %rdi
movss 0x54(%rsp), %xmm2
movl %eax, 0x98(%rsp)
movsd 0x9c(%rsp), %xmm0
movsd 0xa4(%rsp), %xmm1
movl 0x98(%rsp), %esi
callq 0x13f10
jmp 0x626a9
movq 0x120(%rsp), %rax
movl 0x22e0(%rax), %eax
movl %eax, 0xd0(%rsp)
movq 0x128(%rsp), %rax
movl 0x4(%rax), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
jne 0x626cd
movq 0x158(%rsp), %rax
movq %rax, 0x38(%rsp)
jmp 0x626d6
xorl %eax, %eax
movq %rax, 0x38(%rsp)
jmp 0x626d6
movq 0x38(%rsp), %rax
movq %rax, 0x110(%rsp)
cmpq $0x0, 0x110(%rsp)
je 0x62707
cmpl $0x1, 0xc0(%rsp)
jne 0x62707
movq 0x158(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x62710
xorl %eax, %eax
movq %rax, 0x30(%rsp)
jmp 0x62710
movq 0x30(%rsp), %rax
movq %rax, 0x110(%rsp)
movq 0x110(%rsp), %rsi
movsd 0xe8(%rsp), %xmm0
movsd 0xf0(%rsp), %xmm1
leaq 0xc4(%rsp), %rdi
xorl %edx, %edx
callq 0x78060
cmpl $0x0, %eax
je 0x6276c
movq 0x138(%rsp), %rax
movl (%rax), %edx
movl $0x1, %ecx
xorl %eax, %eax
cmpl $0x1, %edx
cmovel %eax, %ecx
movq 0x138(%rsp), %rax
movl %ecx, (%rax)
movq 0x138(%rsp), %rax
cmpl $0x1, (%rax)
jne 0x627d2
movq 0x120(%rsp), %rax
movl 0x1e84(%rax), %eax
movl %eax, 0x104(%rsp)
cmpl $0x1, 0x154(%rsp)
jne 0x627b4
movq 0x120(%rsp), %rax
addq $0x1af0, %rax           # imm = 0x1AF0
addq $0x30, %rax
movq %rax, 0x108(%rsp)
jmp 0x627d0
movq 0x120(%rsp), %rax
addq $0x1af0, %rax           # imm = 0x1AF0
addq $0x1e0, %rax            # imm = 0x1E0
movq %rax, 0x108(%rsp)
jmp 0x6282d
movq 0x120(%rsp), %rax
movl 0x1e80(%rax), %eax
movl %eax, 0x104(%rsp)
cmpl $0x1, 0x154(%rsp)
jne 0x6280f
movq 0x120(%rsp), %rax
addq $0x1af0, %rax           # imm = 0x1AF0
addq $0x108, %rax            # imm = 0x108
movq %rax, 0x108(%rsp)
jmp 0x6282b
movq 0x120(%rsp), %rax
addq $0x1af0, %rax           # imm = 0x1AF0
addq $0x2b8, %rax            # imm = 0x2B8
movq %rax, 0x108(%rsp)
jmp 0x6282d
movq 0x120(%rsp), %rax
movq (%rax), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, 0xe4(%rsp)
movss %xmm0, 0xe0(%rsp)
movss 0xec(%rsp), %xmm0
movq 0x120(%rsp), %rax
movss 0x1e98(%rax), %xmm1
addss %xmm1, %xmm0
movss %xmm0, 0xdc(%rsp)
movss 0xe8(%rsp), %xmm0
movq 0x120(%rsp), %rax
movss 0x1e94(%rax), %xmm1
addss %xmm1, %xmm0
movss %xmm0, 0xd8(%rsp)
movq 0x130(%rsp), %rsi
addq $0x68, %rsi
movl 0x104(%rsp), %edx
movq 0x108(%rsp), %r8
movq 0x120(%rsp), %rax
movq (%rax), %rcx
movsd 0xd8(%rsp), %xmm0
movsd 0xe0(%rsp), %xmm1
movq %rsp, %rax
movq %rcx, (%rax)
xorl %ecx, %ecx
movl %ecx, %r9d
leaq 0xc4(%rsp), %rdi
callq 0x5e910
cmpq $0x0, 0x148(%rsp)
je 0x6298c
movss 0xd8(%rsp), %xmm1
movss 0xe0(%rsp), %xmm0
addss %xmm0, %xmm1
movss 0xf8(%rsp), %xmm0
movss 0x4ac1b(%rip), %xmm2    # 0xad53c
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0xd8(%rsp)
movq 0x130(%rsp), %rdi
addq $0x68, %rdi
movq 0x148(%rsp), %rsi
movsd 0xd8(%rsp), %xmm0
movsd 0xe0(%rsp), %xmm1
movl 0x4e952(%rip), %edx     # 0xb12b0
callq 0x14690
movq 0x120(%rsp), %rax
movq (%rax), %rax
movss 0x8(%rax), %xmm0
movq 0x120(%rsp), %rax
addss 0x1e9c(%rax), %xmm0
movss %xmm0, 0xe0(%rsp)
movss 0xf0(%rsp), %xmm1
movss 0xe0(%rsp), %xmm0
addss 0xf8(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x629c6
movss 0xe0(%rsp), %xmm0
addss 0xf8(%rsp), %xmm0
movss %xmm0, 0x2c(%rsp)
jmp 0x629d5
movss 0xf0(%rsp), %xmm0
movss %xmm0, 0x2c(%rsp)
movss 0x2c(%rsp), %xmm0
movss %xmm0, 0xf0(%rsp)
movss 0xd8(%rsp), %xmm0
movss 0xe0(%rsp), %xmm1
addss %xmm1, %xmm0
movss 0xf8(%rsp), %xmm1
addss %xmm1, %xmm0
movss %xmm0, 0x88(%rsp)
movss 0xdc(%rsp), %xmm0
movss %xmm0, 0x8c(%rsp)
movss 0xf0(%rsp), %xmm0
movss 0xe0(%rsp), %xmm1
movss 0xfc(%rsp), %xmm2
addss %xmm2, %xmm1
movq 0x120(%rsp), %rax
movss 0x1e90(%rax), %xmm2
addss %xmm2, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x90(%rsp)
movq 0x120(%rsp), %rax
movq (%rax), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, 0x94(%rsp)
movq 0x120(%rsp), %rax
movss 0x1ea4(%rax), %xmm0
movl 0x1b1c(%rax), %edi
callq 0x15100
movl %eax, 0x84(%rsp)
movl 0x84(%rsp), %eax
movl %eax, 0xd4(%rsp)
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0x13460
movlpd %xmm0, 0x7c(%rsp)
movq 0x7c(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq 0x118(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x140(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x14050
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl %eax, %edx
movq 0x120(%rsp), %rax
movq (%rax), %r9
movsd 0x88(%rsp), %xmm0
movsd 0x90(%rsp), %xmm1
leaq 0xc8(%rsp), %rcx
movl $0x11, %r8d
callq 0x66ac0
movq 0x138(%rsp), %rax
cmpl $0x1, (%rax)
jne 0x62c2c
movss 0xe8(%rsp), %xmm0
movq 0x128(%rsp), %rax
movq 0x18(%rax), %rax
movl (%rax), %eax
cvtsi2ss %rax, %xmm1
addss %xmm1, %xmm0
movq 0x120(%rsp), %rax
addss 0x1e90(%rax), %xmm0
movq 0x128(%rsp), %rax
movss %xmm0, 0x28(%rax)
movq 0x128(%rsp), %rax
movss 0x10(%rax), %xmm1
movq 0x120(%rsp), %rax
movss 0x1e90(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x62bac
movq 0x120(%rsp), %rax
movss 0x1e90(%rax), %xmm0
movss %xmm0, 0x14(%rsp)
jmp 0x62bbf
movq 0x128(%rsp), %rax
movss 0x10(%rax), %xmm0
movss %xmm0, 0x14(%rsp)
movss 0x14(%rsp), %xmm0
movq 0x128(%rsp), %rax
movss %xmm0, 0x10(%rax)
movq 0x120(%rsp), %rax
movss 0x1e90(%rax), %xmm1
movq 0x120(%rsp), %rax
addss 0x2364(%rax), %xmm1
movq 0x128(%rsp), %rax
movss 0x10(%rax), %xmm0
subss %xmm1, %xmm0
movss %xmm0, 0x10(%rax)
movq 0x128(%rsp), %rax
movl 0xb0(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xb0(%rax)
movl $0x1, 0x164(%rsp)
jmp 0x62c37
movl $0x0, 0x164(%rsp)
movl 0x164(%rsp), %eax
addq $0x168, %rsp            # imm = 0x168
retq
nopw %cs:(%rax,%rax)