// File: /workspace/github_c_makefile_star2_O1/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 %r13d, %r13d
xorl %esi, %esi
callq 0x58970
leaq 0xf0(%rbx), %r15
movq %r15, %rdi
callq 0x57180
movl %eax, 0x4(%rsp)
movq %r12, %r14
movq %r12, %rdi
callq 0x57180
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x58e20
movl 0x5c0(%rbx), %ebp
testl %ebp, %ebp
jle 0x934c5
leaq 0x10(%rsp), %r12
movq %r15, %rdi
movl %r13d, %esi
callq 0x58990
movl (%rax), %ebp
movq %r12, %rdi
movl %r13d, %esi
callq 0x58990
movl %ebp, (%rax)
incl %r13d
movl 0x5c0(%rbx), %ebp
cmpl %ebp, %r13d
jl 0x9347a
jmp 0x934c5
movl %ebp, %esi
subl %r13d, %esi
movq %r14, %rdi
callq 0x57fe0
movl %eax, %r12d
leaq 0x10(%rsp), %rdi
movl %ebp, %esi
callq 0x58990
movl %r12d, (%rax)
incl %ebp
movl 0x5c0(%rbx), %r13d
movq 0x8(%rsp), %rax
addl %r13d, %eax
cmpl %eax, %ebp
jl 0x934a4
cmpl 0x4(%rsp), %r13d
jg 0x93512
incl 0x4(%rsp)
leaq 0x10(%rsp), %r12
movq %r15, %rdi
movl %r13d, %esi
callq 0x58990
movl (%rax), %ebp
movq 0x8(%rsp), %rax
leal (%rax,%r13), %esi
movq %r12, %rdi
callq 0x58990
movl %ebp, (%rax)
incl %r13d
cmpl %r13d, 0x4(%rsp)
jne 0x934e8
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x90(%rax)
movl %eax, %ebp
movb $0x0, 0xcb(%rbx)
leaq 0x5e8(%rbx), %rdi
callq 0x86554
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, %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 0x8(%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 0x935f3
jmp 0x935f3
jmp 0x935f3
jmp 0x935f3
jmp 0x935f3
jmp 0x935f3
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x59200
movq %rbx, %rdi
callq 0x57090