// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_textedit_discard_redo
NK_INTERN void
nk_textedit_discard_redo(struct nk_text_undo_state *state)
{
/*  discard the oldest entry in the redo list--it's bad if this
    ever happens, but because undo & redo have to store the actual
    characters in different cases, the redo character buffer can
    fill up even though the undo buffer didn't */
    nk_size num;
    int k = NK_TEXTEDIT_UNDOSTATECOUNT-1;
    if (state->redo_point <= k) {
        /* if the k'th undo state has characters, clean those up */
        if (state->undo_rec[k].char_storage >= 0) {
            int n = state->undo_rec[k].insert_length, i;
            /* delete n characters from all other records */
            state->redo_char_point = (short)(state->redo_char_point + n);
            num = (nk_size)(NK_TEXTEDIT_UNDOCHARCOUNT - state->redo_char_point);
            NK_MEMCPY(state->undo_char + state->redo_char_point,
                state->undo_char + state->redo_char_point-n, num * sizeof(char));
            for (i = state->redo_point; i < k; ++i) {
                if (state->undo_rec[i].char_storage >= 0) {
                    state->undo_rec[i].char_storage = (short)
                        (state->undo_rec[i].char_storage + n);
                }
            }
        }
        ++state->redo_point;
        num = (nk_size)(NK_TEXTEDIT_UNDOSTATECOUNT - state->redo_point);
        if (num) NK_MEMCPY(state->undo_rec + state->redo_point-1,
            state->undo_rec + state->redo_point, num * sizeof(state->undo_rec[0]));
    }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl $0x62, 0x14(%rsp)
movq 0x20(%rsp), %rax
movswl 0x1442(%rax), %eax
cmpl 0x14(%rsp), %eax
jg 0x7016c
movq 0x20(%rsp), %rax
movslq 0x14(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movswl 0x8(%rax), %eax
cmpl $0x0, %eax
jl 0x700ee
movq 0x20(%rsp), %rax
movslq 0x14(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movswl 0x4(%rax), %eax
movl %eax, 0x10(%rsp)
movq 0x20(%rsp), %rax
movswl 0x1446(%rax), %eax
addl 0x10(%rsp), %eax
movw %ax, %cx
movq 0x20(%rsp), %rax
movw %cx, 0x1446(%rax)
movq 0x20(%rsp), %rax
movswl 0x1446(%rax), %ecx
movl $0x3e7, %eax            # imm = 0x3E7
subl %ecx, %eax
cltq
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rdi
addq $0x4a4, %rdi            # imm = 0x4A4
movq 0x20(%rsp), %rax
movswl 0x1446(%rax), %eax
cltq
shlq $0x2, %rax
addq %rax, %rdi
movq 0x20(%rsp), %rsi
addq $0x4a4, %rsi            # imm = 0x4A4
movq 0x20(%rsp), %rax
movswl 0x1446(%rax), %eax
cltq
shlq $0x2, %rax
addq %rax, %rsi
movslq 0x10(%rsp), %rcx
xorl %eax, %eax
subq %rcx, %rax
shlq $0x2, %rax
addq %rax, %rsi
movq 0x18(%rsp), %rdx
shlq $0x0, %rdx
callq 0x2f750
movq 0x20(%rsp), %rax
movswl 0x1442(%rax), %eax
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %eax
cmpl 0x14(%rsp), %eax
jge 0x700ec
movq 0x20(%rsp), %rax
movslq 0xc(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movswl 0x8(%rax), %eax
cmpl $0x0, %eax
jl 0x700dd
movq 0x20(%rsp), %rax
movslq 0xc(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movswl 0x8(%rax), %eax
addl 0x10(%rsp), %eax
movw %ax, %cx
movq 0x20(%rsp), %rax
movslq 0xc(%rsp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x8(%rax)
jmp 0x700df
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x70088
jmp 0x700ee
movq 0x20(%rsp), %rax
movw 0x1442(%rax), %cx
addw $0x1, %cx
movw %cx, 0x1442(%rax)
movq 0x20(%rsp), %rax
movswl 0x1442(%rax), %ecx
movl $0x63, %eax
subl %ecx, %eax
cltq
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0x7016a
movq 0x20(%rsp), %rdi
movq 0x20(%rsp), %rax
movswl 0x1442(%rax), %eax
cltq
imulq $0xc, %rax, %rax
addq %rax, %rdi
addq $-0xc, %rdi
movq 0x20(%rsp), %rsi
movq 0x20(%rsp), %rax
movswl 0x1442(%rax), %eax
cltq
imulq $0xc, %rax, %rax
addq %rax, %rsi
imulq $0xc, 0x18(%rsp), %rdx
callq 0x2f750
jmp 0x7016c
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)