// File: donfreiday[P]gb/./imgui/stb_textedit.h
// Function: ImGuiStb::stb_textedit_discard_redo(ImGuiStb::StbUndoState*)
static void stb_textedit_discard_redo(StbUndoState *state)
{
   int k = STB_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 = state->redo_char_point + (short) n; // vsnet05
         memmove(state->undo_char + state->redo_char_point, state->undo_char + state->redo_char_point-n, (size_t) ((size_t)(STB_TEXTEDIT_UNDOSTATECOUNT - state->redo_char_point)*sizeof(STB_TEXTEDIT_CHARTYPE)));
         for (i=state->redo_point; i < k; ++i)
            if (state->undo_rec[i].char_storage >= 0)
               state->undo_rec[i].char_storage = state->undo_rec[i].char_storage + (short) n; // vsnet05
      }
      ++state->redo_point;
      memmove(state->undo_rec + state->redo_point-1, state->undo_rec + state->redo_point, (size_t) ((size_t)(STB_TEXTEDIT_UNDOSTATECOUNT - state->redo_point)*sizeof(state->undo_rec[0])));
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x62, -0xc(%rbp)
movq -0x8(%rbp), %rax
movswl 0xc74(%rax), %eax
cmpl -0xc(%rbp), %eax
jg 0x2c437
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movswl 0x8(%rax), %eax
cmpl $0x0, %eax
jl 0x2c3d0
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movswl 0x4(%rax), %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movswl 0xc78(%rax), %eax
movl -0x10(%rbp), %ecx
movswl %cx, %ecx
addl %ecx, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0xc78(%rax)
movq -0x8(%rbp), %rdi
addq $0x4a4, %rdi            # imm = 0x4A4
movq -0x8(%rbp), %rax
movswl 0xc78(%rax), %eax
cltq
shlq %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
addq $0x4a4, %rsi            # imm = 0x4A4
movq -0x8(%rbp), %rax
movswl 0xc78(%rax), %eax
cltq
shlq %rax
addq %rax, %rsi
movslq -0x10(%rbp), %rcx
xorl %eax, %eax
subq %rcx, %rax
shlq %rax
addq %rax, %rsi
movq -0x8(%rbp), %rax
movswl 0xc78(%rax), %ecx
movl $0x63, %eax
subl %ecx, %eax
movslq %eax, %rdx
shlq %rdx
callq 0x7150
movq -0x8(%rbp), %rax
movswl 0xc74(%rax), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x2c3ce
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movswl 0x8(%rax), %eax
cmpl $0x0, %eax
jl 0x2c3c1
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movswl 0x8(%rax), %eax
movl -0x10(%rbp), %ecx
movswl %cx, %ecx
addl %ecx, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movw %cx, 0x8(%rax)
jmp 0x2c3c3
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2c370
jmp 0x2c3d0
movq -0x8(%rbp), %rax
movw 0xc74(%rax), %cx
addw $0x1, %cx
movw %cx, 0xc74(%rax)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movswl 0xc74(%rax), %eax
cltq
imulq $0xc, %rax, %rax
addq %rax, %rdi
addq $-0xc, %rdi
movq -0x8(%rbp), %rsi
movq -0x8(%rbp), %rax
movswl 0xc74(%rax), %eax
cltq
imulq $0xc, %rax, %rax
addq %rax, %rsi
movq -0x8(%rbp), %rax
movswl 0xc74(%rax), %ecx
movl $0x63, %eax
subl %ecx, %eax
cltq
imulq $0xc, %rax, %rdx
callq 0x7150
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)