// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_textedit_redo
NK_API void
nk_textedit_redo(struct nk_text_edit *state)
{
    struct nk_text_undo_state *s = &state->undo;
    struct nk_text_undo_record *u, r;
    if (s->redo_point == NK_TEXTEDIT_UNDOSTATECOUNT)
        return;

    /* we need to do two things: apply the redo record, and create an undo record */
    u = &s->undo_rec[s->undo_point];
    r = s->undo_rec[s->redo_point];

    /* we KNOW there must be room for the undo record, because the redo record
    was derived from an undo record */
    u->delete_length = r.insert_length;
    u->insert_length = r.delete_length;
    u->where = r.where;
    u->char_storage = -1;

    if (r.delete_length) {
        /* the redo record requires us to delete characters, so the undo record
        needs to store the characters */
        if (s->undo_char_point + u->insert_length > s->redo_char_point) {
            u->insert_length = 0;
            u->delete_length = 0;
        } else {
            int i;
            u->char_storage = s->undo_char_point;
            s->undo_char_point = (short)(s->undo_char_point + u->insert_length);

            /* now save the characters */
            for (i=0; i < u->insert_length; ++i) {
                s->undo_char[u->char_storage + i] =
                    nk_str_rune_at(&state->string, u->where + i);
            }
        }
        nk_str_delete_runes(&state->string, r.where, r.delete_length);
    }

    if (r.insert_length) {
        /* easy case: need to insert n characters */
        nk_str_insert_text_runes(&state->string, r.where,
            &s->undo_char[r.char_storage], r.insert_length);
    }
    state->cursor = r.where + r.insert_length;

    s->undo_point++;
    s->redo_point++;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0xc0, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movswl 0x1442(%rax), %eax
cmpl $0x63, %eax
jne 0x701af
jmp 0x7039c
movq 0x18(%rsp), %rax
movq 0x18(%rsp), %rcx
movswq 0x1440(%rcx), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq 0x18(%rsp), %rcx
movswq 0x1442(%rcx), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, 0x4(%rsp)
movl 0x8(%rax), %eax
movl %eax, 0xc(%rsp)
movw 0x8(%rsp), %cx
movq 0x10(%rsp), %rax
movw %cx, 0x6(%rax)
movw 0xa(%rsp), %cx
movq 0x10(%rsp), %rax
movw %cx, 0x4(%rax)
movl 0x4(%rsp), %ecx
movq 0x10(%rsp), %rax
movl %ecx, (%rax)
movq 0x10(%rsp), %rax
movw $0xffff, 0x8(%rax)      # imm = 0xFFFF
cmpw $0x0, 0xa(%rsp)
je 0x70320
movq 0x18(%rsp), %rax
movswl 0x1444(%rax), %eax
movq 0x10(%rsp), %rcx
movswl 0x4(%rcx), %ecx
addl %ecx, %eax
movq 0x18(%rsp), %rcx
movswl 0x1446(%rcx), %ecx
cmpl %ecx, %eax
jle 0x70275
movq 0x10(%rsp), %rax
movw $0x0, 0x4(%rax)
movq 0x10(%rsp), %rax
movw $0x0, 0x6(%rax)
jmp 0x70309
movq 0x18(%rsp), %rax
movw 0x1444(%rax), %cx
movq 0x10(%rsp), %rax
movw %cx, 0x8(%rax)
movq 0x18(%rsp), %rax
movswl 0x1444(%rax), %eax
movq 0x10(%rsp), %rcx
movswl 0x4(%rcx), %ecx
addl %ecx, %eax
movw %ax, %cx
movq 0x18(%rsp), %rax
movw %cx, 0x1444(%rax)
movl $0x0, (%rsp)
movl (%rsp), %eax
movq 0x10(%rsp), %rcx
movswl 0x4(%rcx), %ecx
cmpl %ecx, %eax
jge 0x70307
movq 0x20(%rsp), %rdi
addq $0x18, %rdi
movq 0x10(%rsp), %rax
movl (%rax), %esi
addl (%rsp), %esi
callq 0x13a90
movl %eax, %edx
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
movswl 0x8(%rcx), %ecx
addl (%rsp), %ecx
movslq %ecx, %rcx
movl %edx, 0x4a4(%rax,%rcx,4)
movl (%rsp), %eax
addl $0x1, %eax
movl %eax, (%rsp)
jmp 0x702b7
jmp 0x70309
movq 0x20(%rsp), %rdi
addq $0x18, %rdi
movl 0x4(%rsp), %esi
movswl 0xa(%rsp), %edx
callq 0x13e40
cmpw $0x0, 0x8(%rsp)
je 0x70358
movq 0x20(%rsp), %rdi
addq $0x18, %rdi
movl 0x4(%rsp), %esi
movq 0x18(%rsp), %rdx
addq $0x4a4, %rdx            # imm = 0x4A4
movswq 0xc(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rdx
movswl 0x8(%rsp), %ecx
callq 0x14c60
movl 0x4(%rsp), %ecx
movswl 0x8(%rsp), %eax
addl %eax, %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0xa8(%rax)
movq 0x18(%rsp), %rax
movw 0x1440(%rax), %cx
addw $0x1, %cx
movw %cx, 0x1440(%rax)
movq 0x18(%rsp), %rax
movw 0x1442(%rax), %cx
addw $0x1, %cx
movw %cx, 0x1442(%rax)
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)