// File: /workspace/github_c_makefile_star2_O2/enzo1982[P]smooth/classes/gui/widgets/special/cursor.cpp
// Function: smooth::GUI::Cursor::DeleteSelectedText()
S::Void S::GUI::Cursor::DeleteSelectedText()
{
	if (markStart == markEnd || markStart < 0 || markEnd < 0) return;

	ShowCursor(False);

	Int	 bMarkStart	= Math::Min(markStart, markEnd);
	Int	 bMarkEnd	= Math::Max(markStart, markEnd);

	Bool	 prevVisible = IsVisible();

	visible = False;

	MarkText(-1, -1);

	String	 newText;

	for (Int i = 0; i < bMarkStart; i++)		newText[i] = text[i];
	for (Int j = bMarkEnd; j <= text.Length(); j++)	newText[j - (bMarkEnd - bMarkStart)] = text[j];

	lineIndices.RemoveAll();

	Widget::SetText(newText);

	visible = prevVisible;

	Surface	*surface = GetDrawSurface();

	surface->StartPaint(Rect(container->GetRealPosition(), container->GetRealSize()));

	container->Paint(SP_PAINT);

	surface->EndPaint();

	SetCursorPos(bMarkStart);

	AddHistoryEntry();

	if(!Binary::IsFlagSet(GetFlags(), CF_NOINPUT)) onInput.Emit(newText);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl 0x5c8(%rdi), %eax
movl 0x5cc(%rdi), %ecx
cmpl %ecx, %eax
sete %dl
orl %eax, %ecx
sets %al
orb %dl, %al
jne 0x8f646
movq %rdi, %rbx
xorl %r13d, %r13d
xorl %esi, %esi
callq 0x59ca0
movl 0x5c8(%rbx), %eax
movl 0x5cc(%rbx), %r15d
cmpl %r15d, %eax
movl %r15d, %r14d
cmovll %eax, %r14d
cmovgl %eax, %r15d
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x90(%rax)
movb %al, 0x3(%rsp)
movb $0x0, 0xcb(%rbx)
pushq $-0x1
popq %rdx
movq %rbx, %rdi
movl %edx, %esi
callq 0x57c50
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
xorl %esi, %esi
callq 0x5a180
movq %rbx, 0x8(%rsp)
leaq 0xf0(%rbx), %r12
movl %r14d, %eax
testl %r14d, %r14d
movl $0x0, %r14d
movl %eax, 0x4(%rsp)
cmovgl %eax, %r14d
cmpl %r13d, %r14d
je 0x8f539
movq %r12, %rdi
movl %r13d, %esi
callq 0x59cc0
movl (%rax), %ebx
movq %rbp, %rdi
movl %r13d, %esi
callq 0x59cc0
movl %ebx, (%rax)
incl %r13d
jmp 0x8f515
leaq 0x10(%rsp), %r13
movl 0x4(%rsp), %ebp
movq %r12, %rdi
callq 0x58370
cmpl %eax, %r15d
jg 0x8f56f
movq %r12, %rdi
movl %r15d, %esi
callq 0x59cc0
movl (%rax), %ebx
movq %r13, %rdi
movl %ebp, %esi
callq 0x59cc0
movl %ebx, (%rax)
incl %r15d
incl %ebp
jmp 0x8f542
movq 0x8(%rsp), %rbx
leaq 0x5e8(%rbx), %rdi
callq 0x83b5a
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x57f80
movb 0x3(%rsp), %al
movb %al, 0xcb(%rbx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x40(%rax)
movq %rax, %r14
movq 0x190(%rbx), %rdi
movq (%rdi), %rax
callq *0x48(%rax)
movq %rax, %r15
movq 0x190(%rbx), %rdi
movq (%rdi), %rax
callq *0x50(%rax)
movq %r15, %rcx
shrq $0x20, %rcx
movq %rax, %rdx
shrq $0x20, %rdx
leaq 0x28(%rsp), %rsi
movl %r15d, (%rsi)
movl %ecx, 0x4(%rsi)
addl %r15d, %eax
movl %eax, 0x8(%rsi)
addl %ecx, %edx
movl %edx, 0xc(%rsi)
movq %r14, %rdi
callq 0x56160
movq 0x190(%rbx), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x78(%rax)
movq %r14, %rdi
callq 0x59a80
movq %rbx, %rdi
movl 0x4(%rsp), %esi
callq 0x59d70
movq %rbx, %rdi
callq 0x59b00
movl 0x30(%rbx), %edi
movl $0x40000000, %esi       # imm = 0x40000000
callq 0x596b0
testb %al, %al
jne 0x8f63c
addq $0x708, %rbx            # imm = 0x708
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x75b8e
leaq 0x10(%rsp), %rdi
callq 0x5a588
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8f65f
jmp 0x8f65f
jmp 0x8f65f
jmp 0x8f65f
jmp 0x8f65f
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x5a588
movq %rbx, %rdi
callq 0x58260