// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_edit_buffer
NK_API nk_flags
nk_edit_buffer(struct nk_context *ctx, nk_flags flags,
    struct nk_text_edit *edit, nk_plugin_filter filter)
{
    struct nk_window *win;
    struct nk_style *style;
    struct nk_input *in;

    enum nk_widget_layout_states state;
    struct nk_rect bounds;

    nk_flags ret_flags = 0;
    unsigned char prev_state;
    nk_hash hash;

    /* make sure correct values */
    NK_ASSERT(ctx);
    NK_ASSERT(edit);
    NK_ASSERT(ctx->current);
    NK_ASSERT(ctx->current->layout);
    if (!ctx || !ctx->current || !ctx->current->layout)
        return 0;

    win = ctx->current;
    style = &ctx->style;
    state = nk_widget(&bounds, ctx);
    if (!state) return state;
    else if (state == NK_WIDGET_DISABLED)
        flags |= NK_EDIT_READ_ONLY;
    in = (win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;

    /* check if edit is currently hot item */
    hash = win->edit.seq++;
    if (win->edit.active && hash == win->edit.name) {
        if (flags & NK_EDIT_NO_CURSOR)
            edit->cursor = edit->string.len;
        if (!(flags & NK_EDIT_SELECTABLE)) {
            edit->select_start = edit->cursor;
            edit->select_end = edit->cursor;
        }
        if (flags & NK_EDIT_CLIPBOARD)
            edit->clip = ctx->clip;
        edit->active = (unsigned char)win->edit.active;
    } else edit->active = nk_false;
    edit->mode = win->edit.mode;

    filter = (!filter) ? nk_filter_default: filter;
    prev_state = (unsigned char)edit->active;
    in = (flags & NK_EDIT_READ_ONLY) ? 0: in;
    ret_flags = nk_do_edit(&ctx->last_widget_state, &win->buffer, bounds, flags,
                    filter, edit, &style->edit, in, style->font);

    if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER)
        ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_TEXT];
    if (edit->active && prev_state != edit->active) {
        /* current edit is now hot */
        win->edit.active = nk_true;
        win->edit.name = hash;
    } else if (prev_state && !edit->active) {
        /* current edit is now cold */
        win->edit.active = nk_false;
    } return ret_flags;
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x78(%rsp)
movl %esi, 0x74(%rsp)
movq %rdx, 0x68(%rsp)
movq %rcx, 0x60(%rsp)
movl $0x0, 0x30(%rsp)
cmpq $0x0, 0x78(%rsp)
jne 0x70fed
movq 0x5402f(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
leaq 0x403d5(%rip), %rsi     # 0xb13a0
leaq 0x403ec(%rip), %rdx     # 0xb13be
movl $0x6d70, %ecx           # imm = 0x6D70
movb $0x0, %al
callq 0x13ec0
movq 0x5400b(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
callq 0x149a0
jmp 0x70fef
jmp 0x70ff1
cmpq $0x0, 0x68(%rsp)
jne 0x7102c
movq 0x53ff0(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
leaq 0x40396(%rip), %rsi     # 0xb13a0
leaq 0x403ad(%rip), %rdx     # 0xb13be
movl $0x6d71, %ecx           # imm = 0x6D71
movb $0x0, %al
callq 0x13ec0
movq 0x53fcc(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
callq 0x149a0
jmp 0x7102e
jmp 0x71030
movq 0x78(%rsp), %rax
cmpq $0x0, 0x4780(%rax)
jne 0x71072
movq 0x53faa(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
leaq 0x40350(%rip), %rsi     # 0xb13a0
leaq 0x40367(%rip), %rdx     # 0xb13be
movl $0x6d72, %ecx           # imm = 0x6D72
movb $0x0, %al
callq 0x13ec0
movq 0x53f86(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
callq 0x149a0
jmp 0x71074
jmp 0x71076
movq 0x78(%rsp), %rax
movq 0x4780(%rax), %rax
cmpq $0x0, 0xa8(%rax)
jne 0x710bf
movq 0x53f5d(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
leaq 0x40303(%rip), %rsi     # 0xb13a0
leaq 0x4031a(%rip), %rdx     # 0xb13be
movl $0x6d73, %ecx           # imm = 0x6D73
movb $0x0, %al
callq 0x13ec0
movq 0x53f39(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
callq 0x149a0
jmp 0x710c1
cmpq $0x0, 0x78(%rsp)
je 0x710ee
movq 0x78(%rsp), %rax
cmpq $0x0, 0x4780(%rax)
je 0x710ee
movq 0x78(%rsp), %rax
movq 0x4780(%rax), %rax
cmpq $0x0, 0xa8(%rax)
jne 0x710fe
movl $0x0, 0x84(%rsp)
jmp 0x71400
movq 0x78(%rsp), %rax
movq 0x4780(%rax), %rax
movq %rax, 0x58(%rsp)
movq 0x78(%rsp), %rax
addq $0x168, %rax            # imm = 0x168
movq %rax, 0x50(%rsp)
movq 0x78(%rsp), %rsi
leaq 0x34(%rsp), %rdi
callq 0x139c0
movl %eax, 0x44(%rsp)
cmpl $0x0, 0x44(%rsp)
jne 0x71149
movl 0x44(%rsp), %eax
movl %eax, 0x84(%rsp)
jmp 0x71400
cmpl $0x3, 0x44(%rsp)
jne 0x7115b
movl 0x74(%rsp), %eax
orl $0x1, %eax
movl %eax, 0x74(%rsp)
jmp 0x7115d
movq 0x58(%rsp), %rax
movq 0xa8(%rax), %rax
movl 0x4(%rax), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
je 0x7117f
xorl %eax, %eax
movq %rax, 0x20(%rsp)
jmp 0x71189
movq 0x78(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x58(%rsp), %rcx
movl 0x184(%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x184(%rcx)
movl %eax, 0x28(%rsp)
movq 0x58(%rsp), %rax
cmpl $0x0, 0x18c(%rax)
je 0x7127e
movl 0x28(%rsp), %eax
movq 0x58(%rsp), %rcx
cmpl 0x180(%rcx), %eax
jne 0x7127e
movl 0x74(%rsp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x711f6
movq 0x68(%rsp), %rax
movl 0x90(%rax), %ecx
movq 0x68(%rsp), %rax
movl %ecx, 0xa8(%rax)
movl 0x74(%rsp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
jne 0x7122e
movq 0x68(%rsp), %rax
movl 0xa8(%rax), %ecx
movq 0x68(%rsp), %rax
movl %ecx, 0xac(%rax)
movq 0x68(%rsp), %rax
movl 0xa8(%rax), %ecx
movq 0x68(%rsp), %rax
movl %ecx, 0xb0(%rax)
movl 0x74(%rsp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x71264
movq 0x68(%rsp), %rax
movq 0x78(%rsp), %rcx
movq 0x2580(%rcx), %rdx
movq %rdx, (%rax)
movq 0x2588(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x2590(%rcx), %rcx
movq %rcx, 0x10(%rax)
movq 0x58(%rsp), %rax
movl 0x18c(%rax), %eax
movb %al, %cl
movq 0x68(%rsp), %rax
movb %cl, 0xb9(%rax)
jmp 0x7128a
movq 0x68(%rsp), %rax
movb $0x0, 0xb9(%rax)
movq 0x58(%rsp), %rax
movb 0x1a8(%rax), %cl
movq 0x68(%rsp), %rax
movb %cl, 0xb4(%rax)
cmpq $0x0, 0x60(%rsp)
jne 0x712b6
movq 0x53d11(%rip), %rax     # 0xc4fc0
movq %rax, 0x18(%rsp)
jmp 0x712c0
movq 0x60(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x68(%rsp), %rax
movb 0xb9(%rax), %al
movb %al, 0x2f(%rsp)
movl 0x74(%rsp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x712ee
xorl %eax, %eax
movq %rax, 0x10(%rsp)
jmp 0x712f8
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x78(%rsp), %rdi
addq $0x2598, %rdi           # imm = 0x2598
movq 0x58(%rsp), %rsi
addq $0x68, %rsi
movl 0x74(%rsp), %edx
movq 0x60(%rsp), %rcx
movq 0x68(%rsp), %r8
movq 0x50(%rsp), %rax
movq %rax, %r9
addq $0x10f8, %r9            # imm = 0x10F8
movq 0x48(%rsp), %r10
movq (%rax), %r11
movsd 0x34(%rsp), %xmm0
movsd 0x3c(%rsp), %xmm1
movq %rsp, %rax
movq %r11, 0x8(%rax)
movq %r10, (%rax)
callq 0x71410
movl %eax, 0x30(%rsp)
movq 0x78(%rsp), %rax
movl 0x2598(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x71386
movq 0x78(%rsp), %rax
movq 0x178(%rax), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x1a8(%rax)
movq 0x68(%rsp), %rax
movzbl 0xb9(%rax), %eax
cmpl $0x0, %eax
je 0x713cc
movzbl 0x2f(%rsp), %eax
movq 0x68(%rsp), %rcx
movzbl 0xb9(%rcx), %ecx
cmpl %ecx, %eax
je 0x713cc
movq 0x58(%rsp), %rax
movl $0x1, 0x18c(%rax)
movl 0x28(%rsp), %ecx
movq 0x58(%rsp), %rax
movl %ecx, 0x180(%rax)
jmp 0x713f5
movzbl 0x2f(%rsp), %eax
cmpl $0x0, %eax
je 0x713f3
movq 0x68(%rsp), %rax
cmpb $0x0, 0xb9(%rax)
jne 0x713f3
movq 0x58(%rsp), %rax
movl $0x0, 0x18c(%rax)
jmp 0x713f5
movl 0x30(%rsp), %eax
movl %eax, 0x84(%rsp)
movl 0x84(%rsp), %eax
addq $0x88, %rsp
retq
nop