// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbp
movq %rdx, %rbx
movl %esi, 0x4(%rsp)
movq %rdi, %r14
testq %rdi, %rdi
jne 0x47d4b
movq 0x3d2ca(%rip), %r15     # 0x84ff0
movq (%r15), %rdi
leaq 0x21fdc(%rip), %rsi     # 0x69d0c
leaq 0x21ff3(%rip), %rdx     # 0x69d2a
movl $0x6d70, %ecx           # imm = 0x6D70
xorl %eax, %eax
callq 0x12ea0
movq (%r15), %rdi
callq 0x13960
testq %rbx, %rbx
jne 0x47d7c
movq 0x3d299(%rip), %r15     # 0x84ff0
movq (%r15), %rdi
leaq 0x21fab(%rip), %rsi     # 0x69d0c
leaq 0x21fc2(%rip), %rdx     # 0x69d2a
movl $0x6d71, %ecx           # imm = 0x6D71
xorl %eax, %eax
callq 0x12ea0
movq (%r15), %rdi
callq 0x13960
movq 0x4780(%r14), %r13
testq %r13, %r13
jne 0x47dbb
movq 0x3d261(%rip), %r15     # 0x84ff0
movq (%r15), %rdi
leaq 0x21f73(%rip), %rsi     # 0x69d0c
leaq 0x21f8a(%rip), %rdx     # 0x69d2a
movl $0x6d72, %ecx           # imm = 0x6D72
xorl %eax, %eax
callq 0x12ea0
movq (%r15), %rdi
callq 0x13960
movq 0x4780(%r14), %r13
cmpq $0x0, 0xa8(%r13)
jne 0x47e04
movq 0x3d224(%rip), %r15     # 0x84ff0
movq (%r15), %rdi
leaq 0x21f36(%rip), %rsi     # 0x69d0c
leaq 0x21f4d(%rip), %rdx     # 0x69d2a
xorl %r12d, %r12d
movl $0x6d73, %ecx           # imm = 0x6D73
xorl %eax, %eax
callq 0x12ea0
movq (%r15), %rdi
callq 0x13960
movq 0x4780(%r14), %r13
testq %r13, %r13
je 0x47f80
cmpq $0x0, 0xa8(%r13)
je 0x47e38
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x12990
movl %eax, %r12d
testl %eax, %eax
je 0x47f80
cmpl $0x3, %r12d
jne 0x47e40
movl 0x4(%rsp), %edx
orl $0x1, %edx
movq %rbp, %rcx
jmp 0x47e47
xorl %r12d, %r12d
jmp 0x47f80
movq %rbp, %rcx
movl 0x4(%rsp), %edx
movq 0xa8(%r13), %rax
movl 0x4(%rax), %eax
movl 0x184(%r13), %ebp
leal 0x1(%rbp), %esi
movl %esi, 0x184(%r13)
movl 0x18c(%r13), %r15d
testl %r15d, %r15d
je 0x47ec3
cmpl 0x180(%r13), %ebp
jne 0x47ec3
testb $0x10, %dl
je 0x47e88
movl 0x90(%rbx), %esi
movl %esi, 0xa8(%rbx)
testb $0x20, %dl
jne 0x47e9f
movl 0xa8(%rbx), %esi
movl %esi, 0xac(%rbx)
movl %esi, 0xb0(%rbx)
testb $0x40, %dl
je 0x47ec6
movq 0x2590(%r14), %rsi
movq %rsi, 0x10(%rbx)
movups 0x2580(%r14), %xmm0
movups %xmm0, (%rbx)
movl 0x18c(%r13), %r15d
jmp 0x47ec6
xorl %r15d, %r15d
andl $0x1000, %eax           # imm = 0x1000
movb %r15b, 0xb9(%rbx)
movb 0x1a8(%r13), %sil
movb %sil, 0xb4(%rbx)
testq %rcx, %rcx
jne 0x47eec
movq 0x3d0ec(%rip), %rcx     # 0x84fd8
movl %edx, %esi
andl $0x1, %esi
xorl %r10d, %r10d
orl %eax, %esi
cmoveq %r14, %r10
leaq 0x2598(%r14), %rdi
leaq 0x68(%r13), %rsi
leaq 0x1260(%r14), %r9
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movq %rbx, %r8
pushq 0x168(%r14)
pushq %r10
callq 0x47f92
popq %rcx
popq %rdx
movl %eax, %r12d
testb $0x10, 0x2598(%r14)
je 0x47f46
movq 0x178(%r14), %rax
movq %rax, 0x1a8(%r14)
movb 0xb9(%rbx), %al
testb %al, %al
je 0x47f69
cmpb %al, %r15b
je 0x47f69
movl $0x1, 0x18c(%r13)
movl %ebp, 0x180(%r13)
jmp 0x47f80
testb %al, %al
setne %al
testb %r15b, %r15b
sete %cl
orb %al, %cl
jne 0x47f80
andl $0x0, 0x18c(%r13)
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq