// File: /workspace/github_c_makefile_star2_O2/enzo1982[P]smooth/classes/gui/widgets/special/cursor.cpp
// Function: smooth::GUI::Cursor::InsertText(smooth::String const&)
S::Void S::GUI::Cursor::InsertText(const String &insertText)
{
	ShowCursor(False);

	Int	 textLength   = text.Length();
	Int	 insertLength = insertText.Length();

	/* Build resulting text value.
	 */
	String	 newText;

	for (Int i = 0;		i <  promptPos;		       i++) newText[i] = text[i];
	for (Int i = promptPos; i <  promptPos + insertLength; i++) newText[i] = insertText[i - promptPos];
	for (Int i = promptPos; i <=		 textLength;   i++) newText[i + insertLength] = text[i];

	/* Draw widget with new content.
	 */
	Bool	 prevVisible = IsVisible();

	visible = False;

	lineIndices.RemoveAll();

	Widget::SetText(newText);

	visible = prevVisible;

	/* Update screen.
	 */
	Surface	*surface = GetDrawSurface();

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

	container->Paint(SP_PAINT);

	surface->EndPaint();

	/* Update cursor position.
	 */
	SetCursorPos(promptPos + insertLength);

	AddHistoryEntry();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r12
movq %rdi, %rbx
xorl %ebp, %ebp
xorl %esi, %esi
callq 0x59ca0
leaq 0xf0(%rbx), %r15
movq %r15, %rdi
callq 0x58370
movl %eax, 0xc(%rsp)
movq %r12, %rdi
callq 0x58370
movq %rax, (%rsp)
leaq 0x10(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x5a180
movl 0x5c0(%rbx), %r13d
cmpl %r13d, %ebp
jge 0x8f71d
movq %r15, %rdi
movl %ebp, %esi
callq 0x59cc0
movl (%rax), %r13d
movq %r14, %rdi
movl %ebp, %esi
callq 0x59cc0
movl %r13d, (%rax)
incl %ebp
jmp 0x8f6f3
movl %r13d, %ebp
movq (%rsp), %rax
addl %r13d, %eax
cmpl %eax, %ebp
jge 0x8f755
movl %ebp, %esi
subl %r13d, %esi
movq %r12, %rdi
callq 0x59270
movl %eax, %r14d
leaq 0x10(%rsp), %rdi
movl %ebp, %esi
callq 0x59cc0
movl %r14d, (%rax)
incl %ebp
movl 0x5c0(%rbx), %r13d
jmp 0x8f720
leaq 0x10(%rsp), %r14
movl 0xc(%rsp), %r12d
cmpl %r12d, %r13d
jg 0x8f788
movq %r15, %rdi
movl %r13d, %esi
callq 0x59cc0
movl (%rax), %ebp
movq (%rsp), %rax
leal (%rax,%r13), %esi
movq %r14, %rdi
callq 0x59cc0
movl %ebp, (%rax)
incl %r13d
jmp 0x8f75f
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x90(%rax)
movl %eax, %ebp
movb $0x0, 0xcb(%rbx)
leaq 0x5e8(%rbx), %rdi
callq 0x83b5a
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x57f80
movb %bpl, 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, %r14
movq 0x190(%rbx), %rdi
movq (%rdi), %rax
callq *0x50(%rax)
movq %r14, %rcx
shrq $0x20, %rcx
movq %rax, %rdx
shrq $0x20, %rdx
leaq 0x28(%rsp), %rsi
movl %r14d, (%rsi)
movl %ecx, 0x4(%rsi)
addl %r14d, %eax
movl %eax, 0x8(%rsi)
addl %ecx, %edx
movl %edx, 0xc(%rsi)
movq %r15, %rdi
callq 0x56160
movq 0x190(%rbx), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x78(%rax)
movq %r15, %rdi
callq 0x59a80
movl 0x5c0(%rbx), %esi
addl (%rsp), %esi
movq %rbx, %rdi
callq 0x59d70
movq %rbx, %rdi
callq 0x59b00
leaq 0x10(%rsp), %rdi
callq 0x5a588
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8f867
jmp 0x8f867
jmp 0x8f867
jmp 0x8f867
jmp 0x8f867
jmp 0x8f867
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x5a588
movq %rbx, %rdi
callq 0x58260