// File: /workspace/github_c_makefile_star2_O3/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 0x58970
leaq 0xf0(%rbx), %r15
movq %r15, %rdi
callq 0x57180
movl %eax, 0xc(%rsp)
movq %r12, %rdi
callq 0x57180
movq %rax, (%rsp)
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x58e20
movl 0x5c0(%rbx), %r13d
testl %r13d, %r13d
jle 0x92ec3
leaq 0x10(%rsp), %r14
movq %r15, %rdi
movl %ebp, %esi
callq 0x58990
movl (%rax), %r13d
movq %r14, %rdi
movl %ebp, %esi
callq 0x58990
movl %r13d, (%rax)
incl %ebp
movl 0x5c0(%rbx), %r13d
cmpl %r13d, %ebp
jl 0x92e9b
cmpl $0x0, (%rsp)
jle 0x92f06
leaq 0x10(%rsp), %rbp
movl %r13d, %r14d
movl %r14d, %esi
subl %r13d, %esi
movq %r12, %rdi
callq 0x57fe0
movl %eax, %r13d
movq %rbp, %rdi
movl %r14d, %esi
callq 0x58990
movl %r13d, (%rax)
incl %r14d
movl 0x5c0(%rbx), %r13d
movq (%rsp), %rax
addl %r13d, %eax
cmpl %eax, %r14d
jl 0x92ed1
movl 0xc(%rsp), %r12d
cmpl %r12d, %r13d
jg 0x92f3f
incl %r12d
leaq 0x10(%rsp), %r14
movq %r15, %rdi
movl %r13d, %esi
callq 0x58990
movl (%rax), %ebp
movq (%rsp), %rax
leal (%rax,%r13), %esi
movq %r14, %rdi
callq 0x58990
movl %ebp, (%rax)
incl %r13d
cmpl %r13d, %r12d
jne 0x92f18
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x90(%rax)
movl %eax, %ebp
movb $0x0, 0xcb(%rbx)
leaq 0x5e8(%rbx), %rdi
callq 0x8603c
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x56dd0
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 0x55160
movq 0x190(%rbx), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x78(%rax)
movq %r15, %rdi
callq 0x58780
movq (%rsp), %rsi
addl 0x5c0(%rbx), %esi
movq %rbx, %rdi
callq 0x58a30
movq %rbx, %rdi
callq 0x587f0
leaq 0x10(%rsp), %rdi
callq 0x59200
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9301f
jmp 0x9301f
jmp 0x9301f
jmp 0x9301f
jmp 0x9301f
jmp 0x9301f
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x59200
movq %rbx, %rdi
callq 0x57090