// File: /workspace/github_c_makefile_star2_O1/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 0x933bb
movq %rdi, %rbx
xorl %r12d, %r12d
xorl %esi, %esi
callq 0x58970
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, 0x7(%rsp)
movb $0x0, 0xcb(%rbx)
movq %rbx, 0x8(%rsp)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x56ae0
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x58e20
testl %r14d, %r14d
jle 0x932a4
movq 0x8(%rsp), %rax
leaq 0xf0(%rax), %r13
leaq 0x10(%rsp), %rbp
movq %r13, %rdi
movl %r12d, %esi
callq 0x58990
movl (%rax), %ebx
movq %rbp, %rdi
movl %r12d, %esi
callq 0x58990
movl %ebx, (%rax)
incl %r12d
cmpl %r12d, %r14d
jne 0x93282
movq 0x8(%rsp), %rax
leaq 0xf0(%rax), %r12
leaq 0x10(%rsp), %r13
movl %r14d, %ebp
movq %r12, %rdi
callq 0x57180
cmpl %eax, %r15d
jg 0x932e5
movq %r12, %rdi
movl %r15d, %esi
callq 0x58990
movl (%rax), %ebx
movq %r13, %rdi
movl %ebp, %esi
callq 0x58990
movl %ebx, (%rax)
incl %r15d
incl %ebp
jmp 0x932b8
movq 0x8(%rsp), %rbx
leaq 0x5e8(%rbx), %rdi
callq 0x86554
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x56dd0
movb 0x7(%rsp), %al
movb %al, 0xcb(%rbx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x40(%rax)
movq %rax, %r15
movq 0x190(%rbx), %rdi
movq (%rdi), %rax
callq *0x48(%rax)
movq %rax, %r12
movq 0x190(%rbx), %rdi
movq (%rdi), %rax
callq *0x50(%rax)
movq %r12, %rcx
shrq $0x20, %rcx
movq %rax, %rdx
shrq $0x20, %rdx
leaq 0x28(%rsp), %rsi
movl %r12d, (%rsi)
movl %ecx, 0x4(%rsi)
addl %r12d, %eax
movl %eax, 0x8(%rsi)
addl %ecx, %edx
movl %edx, 0xc(%rsi)
movq %r15, %rdi
callq 0x55160
movq 0x190(%rbx), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x78(%rax)
movq %r15, %rdi
callq 0x58780
movq %rbx, %rdi
movl %r14d, %esi
callq 0x58a30
movq %rbx, %rdi
callq 0x587f0
movl 0x30(%rbx), %edi
movl $0x40000000, %esi       # imm = 0x40000000
callq 0x583f0
testb %al, %al
jne 0x933b1
addq $0x708, %rbx            # imm = 0x708
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x76a7e
leaq 0x10(%rsp), %rdi
callq 0x59200
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x933d4
jmp 0x933d4
jmp 0x933d4
jmp 0x933d4
jmp 0x933d4
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x59200
movq %rbx, %rdi
callq 0x57090
nop