// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_textedit_text
NK_API void
nk_textedit_text(struct nk_text_edit *state, const char *text, int total_len)
{
    nk_rune unicode;
    int glyph_len;
    int text_len = 0;

    NK_ASSERT(state);
    NK_ASSERT(text);
    if (!text || !total_len || state->mode == NK_TEXT_EDIT_MODE_VIEW) return;

    glyph_len = nk_utf_decode(text, &unicode, total_len);
    while ((text_len < total_len) && glyph_len)
    {
        /* don't insert a backward delete, just process the event */
        if (unicode == 127) goto next;
        /* can't add newline in single-line mode */
        if (unicode == '\n' && state->single_line) goto next;
        /* filter incoming text */
        if (state->filter && !state->filter(state, unicode)) goto next;

        if (!NK_TEXT_HAS_SELECTION(state) &&
            state->cursor < state->string.len)
        {
            if (state->mode == NK_TEXT_EDIT_MODE_REPLACE) {
                nk_textedit_makeundo_replace(state, state->cursor, 1, 1);
                nk_str_delete_runes(&state->string, state->cursor, 1);
            }
            if (nk_str_insert_text_utf8(&state->string, state->cursor,
                                        text+text_len, 1))
            {
                ++state->cursor;
                state->has_preferred_x = 0;
            }
        } else {
            nk_textedit_delete_selection(state); /* implicitly clamps */
            if (nk_str_insert_text_utf8(&state->string, state->cursor,
                                        text+text_len, 1))
            {
                nk_textedit_makeundo_insert(state, state->cursor, 1);
                state->cursor = NK_MIN(state->cursor + 1, state->string.len);
                state->has_preferred_x = 0;
            }
        }
        next:
        text_len += glyph_len;
        glyph_len = nk_utf_decode(text + text_len, &unicode, total_len-text_len);
    }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl %edx, 0x14(%rsp)
movl $0x0, 0x8(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x6f975
movq 0x556a7(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
leaq 0x41a4d(%rip), %rsi     # 0xb13a0
leaq 0x41a64(%rip), %rdx     # 0xb13be
movl $0x67d0, %ecx           # imm = 0x67D0
movb $0x0, %al
callq 0x13ec0
movq 0x55683(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
callq 0x149a0
jmp 0x6f977
jmp 0x6f979
cmpq $0x0, 0x18(%rsp)
jne 0x6f9b4
movq 0x55668(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
leaq 0x41a0e(%rip), %rsi     # 0xb13a0
leaq 0x41a25(%rip), %rdx     # 0xb13be
movl $0x67d1, %ecx           # imm = 0x67D1
movb $0x0, %al
callq 0x13ec0
movq 0x55644(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
callq 0x149a0
jmp 0x6f9b6
cmpq $0x0, 0x18(%rsp)
je 0x6f9d6
cmpl $0x0, 0x14(%rsp)
je 0x6f9d6
movq 0x20(%rsp), %rax
movzbl 0xb4(%rax), %eax
cmpl $0x0, %eax
jne 0x6f9db
jmp 0x6fc2e
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %edx
leaq 0x10(%rsp), %rsi
callq 0x14030
movl %eax, 0xc(%rsp)
movl 0x8(%rsp), %ecx
xorl %eax, %eax
cmpl 0x14(%rsp), %ecx
movb %al, 0x7(%rsp)
jge 0x6fa0e
cmpl $0x0, 0xc(%rsp)
setne %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x6fa1b
jmp 0x6fc2e
cmpl $0x7f, 0x10(%rsp)
jne 0x6fa27
jmp 0x6fbfa
cmpl $0xa, 0x10(%rsp)
jne 0x6fa44
movq 0x20(%rsp), %rax
movzbl 0xb8(%rax), %eax
cmpl $0x0, %eax
je 0x6fa44
jmp 0x6fbfa
movq 0x20(%rsp), %rax
cmpq $0x0, 0x98(%rax)
je 0x6fa74
movq 0x20(%rsp), %rax
movq 0x98(%rax), %rax
movq 0x20(%rsp), %rdi
movl 0x10(%rsp), %esi
callq *%rax
cmpl $0x0, %eax
jne 0x6fa74
jmp 0x6fbfa
movq 0x20(%rsp), %rax
movl 0xac(%rax), %eax
movq 0x20(%rsp), %rcx
cmpl 0xb0(%rcx), %eax
jne 0x6fb4c
movq 0x20(%rsp), %rax
movl 0xa8(%rax), %eax
movq 0x20(%rsp), %rcx
cmpl 0x90(%rcx), %eax
jge 0x6fb4c
movq 0x20(%rsp), %rax
movzbl 0xb4(%rax), %eax
cmpl $0x2, %eax
jne 0x6faf7
movq 0x20(%rsp), %rdi
movq 0x20(%rsp), %rax
movl 0xa8(%rax), %esi
movl $0x1, %ecx
movl %ecx, %edx
callq 0x6fc40
movq 0x20(%rsp), %rdi
addq $0x18, %rdi
movq 0x20(%rsp), %rax
movl 0xa8(%rax), %esi
movl $0x1, %edx
callq 0x13e40
movq 0x20(%rsp), %rdi
addq $0x18, %rdi
movq 0x20(%rsp), %rax
movl 0xa8(%rax), %esi
movq 0x18(%rsp), %rdx
movslq 0x8(%rsp), %rax
addq %rax, %rdx
movl $0x1, %ecx
callq 0x14be0
cmpl $0x0, %eax
je 0x6fb47
movq 0x20(%rsp), %rax
movl 0xa8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xa8(%rax)
movq 0x20(%rsp), %rax
movb $0x0, 0xb7(%rax)
jmp 0x6fbf8
movq 0x20(%rsp), %rdi
callq 0x150d0
movq 0x20(%rsp), %rdi
addq $0x18, %rdi
movq 0x20(%rsp), %rax
movl 0xa8(%rax), %esi
movq 0x18(%rsp), %rdx
movslq 0x8(%rsp), %rax
addq %rax, %rdx
movl $0x1, %ecx
callq 0x14be0
cmpl $0x0, %eax
je 0x6fbf6
movq 0x20(%rsp), %rdi
movq 0x20(%rsp), %rax
movl 0xa8(%rax), %esi
movl $0x1, %edx
callq 0x6f8e0
movq 0x20(%rsp), %rax
movl 0xa8(%rax), %eax
addl $0x1, %eax
movq 0x20(%rsp), %rcx
cmpl 0x90(%rcx), %eax
jge 0x6fbce
movq 0x20(%rsp), %rax
movl 0xa8(%rax), %eax
addl $0x1, %eax
movl %eax, (%rsp)
jmp 0x6fbdc
movq 0x20(%rsp), %rax
movl 0x90(%rax), %eax
movl %eax, (%rsp)
movl (%rsp), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0xa8(%rax)
movq 0x20(%rsp), %rax
movb $0x0, 0xb7(%rax)
jmp 0x6fbf8
jmp 0x6fbfa
movl 0xc(%rsp), %eax
addl 0x8(%rsp), %eax
movl %eax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
movslq 0x8(%rsp), %rax
addq %rax, %rdi
movl 0x14(%rsp), %edx
subl 0x8(%rsp), %edx
leaq 0x10(%rsp), %rsi
callq 0x14030
movl %eax, 0xc(%rsp)
jmp 0x6f9f2
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)