// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x78(%rbp)
movl 0x5c8(%rcx), %eax
cmpl 0x5cc(%rcx), %eax
je 0xcd89f
movq -0x78(%rbp), %rax
cmpl $0x0, 0x5c8(%rax)
jl 0xcd89f
movq -0x78(%rbp), %rax
cmpl $0x0, 0x5cc(%rax)
jge 0xcd8a4
jmp 0xcdb8f
movq -0x78(%rbp), %rdi
xorl %esi, %esi
callq 0x5d4c0
movq -0x78(%rbp), %rax
movl 0x5c8(%rax), %edi
movl 0x5cc(%rax), %esi
callq 0x5ce90
movl %eax, %ecx
movq -0x78(%rbp), %rax
movl %ecx, -0xc(%rbp)
movl 0x5c8(%rax), %edi
movl 0x5cc(%rax), %esi
callq 0x5aae0
movq -0x78(%rbp), %rdi
movl %eax, -0x10(%rbp)
movq (%rdi), %rax
callq *0x90(%rax)
movq -0x78(%rbp), %rdi
andb $0x1, %al
movb %al, -0x11(%rbp)
movb $0x0, 0xcb(%rdi)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %edx, %esi
callq 0x5b020
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x5da90
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0xcd992
movq -0x78(%rbp), %rdi
addq $0xf0, %rdi
movl -0x34(%rbp), %esi
callq 0x5d4e0
movq %rax, -0x80(%rbp)
jmp 0xcd93d
movq -0x80(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x8c(%rbp)
movl -0x34(%rbp), %esi
leaq -0x30(%rbp), %rdi
callq 0x5d4e0
movq %rax, -0x88(%rbp)
jmp 0xcd95e
movq -0x88(%rbp), %rax
movl -0x8c(%rbp), %ecx
movl %ecx, (%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xcd91c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x5df00
jmp 0xcdb98
movl -0x10(%rbp), %eax
movl %eax, -0x48(%rbp)
movq -0x78(%rbp), %rdi
movl -0x48(%rbp), %eax
movl %eax, -0x94(%rbp)
addq $0xf0, %rdi
callq 0x5b800
movl %eax, -0x90(%rbp)
jmp 0xcd9b9
movl -0x94(%rbp), %eax
movl -0x90(%rbp), %ecx
cmpl %ecx, %eax
jg 0xcda30
movq -0x78(%rbp), %rdi
addq $0xf0, %rdi
movl -0x48(%rbp), %esi
callq 0x5d4e0
movq %rax, -0xa0(%rbp)
jmp 0xcd9e5
movq -0xa0(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xac(%rbp)
movl -0x48(%rbp), %esi
movl -0x10(%rbp), %ecx
movl -0xc(%rbp), %eax
subl %ecx, %eax
addl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x5d4e0
movq %rax, -0xa8(%rbp)
jmp 0xcda13
movq -0xa8(%rbp), %rax
movl -0xac(%rbp), %ecx
movl %ecx, (%rax)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0xcd998
movq -0x78(%rbp), %rdi
addq $0x5e8, %rdi            # imm = 0x5E8
callq 0xb5980
jmp 0xcda42
movq -0x78(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x5b380
jmp 0xcda51
movq -0x78(%rbp), %rdi
movb -0x11(%rbp), %al
andb $0x1, %al
movb %al, 0xcb(%rdi)
movq (%rdi), %rax
movq 0x40(%rax), %rax
callq *%rax
movq %rax, -0xb8(%rbp)
jmp 0xcda72
movq -0x78(%rbp), %rax
movq -0xb8(%rbp), %rcx
movq %rcx, -0x50(%rbp)
movq -0x50(%rbp), %rcx
movq %rcx, -0xc8(%rbp)
movq 0x190(%rax), %rdi
movq (%rdi), %rax
movq 0x48(%rax), %rax
callq *%rax
movq %rax, -0xc0(%rbp)
jmp 0xcdaa5
movq -0x78(%rbp), %rax
movq -0xc0(%rbp), %rcx
movq %rcx, -0x68(%rbp)
movq 0x190(%rax), %rdi
movq (%rdi), %rax
movq 0x50(%rax), %rax
callq *%rax
movq %rax, -0xd0(%rbp)
jmp 0xcdacd
movq -0xd0(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x59ff0
jmp 0xcdaeb
movq -0xc8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x591b0
jmp 0xcdafd
movq -0x78(%rbp), %rax
movq 0x190(%rax), %rdi
movq (%rdi), %rax
movq 0x78(%rax), %rax
xorl %esi, %esi
callq *%rax
jmp 0xcdb15
movq -0x50(%rbp), %rdi
callq 0x5d270
jmp 0xcdb20
movq -0x78(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x5d5c0
jmp 0xcdb2e
movq -0x78(%rbp), %rdi
callq 0x5d2f0
jmp 0xcdb39
movq -0x78(%rbp), %rdi
callq 0x5a120
movl %eax, -0xd4(%rbp)
jmp 0xcdb4a
movl -0xd4(%rbp), %edi
movl $0x40000000, %esi       # imm = 0x40000000
callq 0x5ce30
movb %al, -0xd5(%rbp)
jmp 0xcdb62
movb -0xd5(%rbp), %al
testb $0x1, %al
jne 0xcdb86
jmp 0xcdb6e
movq -0x78(%rbp), %rdi
addq $0x708, %rdi            # imm = 0x708
leaq -0x30(%rbp), %rsi
callq 0x97960
jmp 0xcdb84
jmp 0xcdb86
leaq -0x30(%rbp), %rdi
callq 0x5df00
addq $0xe0, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x5b6b0
nopw %cs:(%rax,%rax)