// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x80(%rbp)
xorl %esi, %esi
callq 0x5d4c0
movq -0x80(%rbp), %rdi
addq $0xf0, %rdi
callq 0x5b800
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5b800
movl %eax, -0x18(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x5da90
movl $0x0, -0x34(%rbp)
movq -0x80(%rbp), %rcx
movl -0x34(%rbp), %eax
cmpl 0x5c0(%rcx), %eax
jge 0xcdd06
movq -0x80(%rbp), %rdi
addq $0xf0, %rdi
movl -0x34(%rbp), %esi
callq 0x5d4e0
movq %rax, -0x88(%rbp)
jmp 0xcdcae
movq -0x88(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x94(%rbp)
movl -0x34(%rbp), %esi
leaq -0x30(%rbp), %rdi
callq 0x5d4e0
movq %rax, -0x90(%rbp)
jmp 0xcdcd2
movq -0x90(%rbp), %rax
movl -0x94(%rbp), %ecx
movl %ecx, (%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xcdc83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x5df00
jmp 0xcdf37
movq -0x80(%rbp), %rax
movl 0x5c0(%rax), %eax
movl %eax, -0x48(%rbp)
movq -0x80(%rbp), %rcx
movl -0x48(%rbp), %eax
movl 0x5c0(%rcx), %ecx
addl -0x18(%rbp), %ecx
cmpl %ecx, %eax
jge 0xcdd76
movq -0x80(%rbp), %rax
movq -0x10(%rbp), %rdi
movl -0x48(%rbp), %esi
movl 0x5c0(%rax), %eax
subl %eax, %esi
callq 0x5c900
movl %eax, -0x98(%rbp)
jmp 0xcdd47
movl -0x48(%rbp), %esi
leaq -0x30(%rbp), %rdi
callq 0x5d4e0
movq %rax, -0xa0(%rbp)
jmp 0xcdd5c
movq -0xa0(%rbp), %rax
movl -0x98(%rbp), %ecx
movl %ecx, (%rax)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0xcdd13
movq -0x80(%rbp), %rax
movl 0x5c0(%rax), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jg 0xcddea
movq -0x80(%rbp), %rdi
addq $0xf0, %rdi
movl -0x4c(%rbp), %esi
callq 0x5d4e0
movq %rax, -0xa8(%rbp)
jmp 0xcdda7
movq -0xa8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xb4(%rbp)
movl -0x4c(%rbp), %esi
movl -0x18(%rbp), %eax
addl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x5d4e0
movq %rax, -0xb0(%rbp)
jmp 0xcddd0
movq -0xb0(%rbp), %rax
movl -0xb4(%rbp), %ecx
movl %ecx, (%rax)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0xcdd83
movq -0x80(%rbp), %rdi
movq (%rdi), %rax
movq 0x90(%rax), %rax
callq *%rax
movb %al, -0xb5(%rbp)
jmp 0xcde02
movq -0x80(%rbp), %rdi
movb -0xb5(%rbp), %al
andb $0x1, %al
movb %al, -0x4d(%rbp)
movb $0x0, 0xcb(%rdi)
addq $0x5e8, %rdi            # imm = 0x5E8
callq 0xb5980
jmp 0xcde26
movq -0x80(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x5b380
jmp 0xcde35
movq -0x80(%rbp), %rdi
movb -0x4d(%rbp), %al
andb $0x1, %al
movb %al, 0xcb(%rdi)
movq (%rdi), %rax
movq 0x40(%rax), %rax
callq *%rax
movq %rax, -0xc0(%rbp)
jmp 0xcde56
movq -0x80(%rbp), %rax
movq -0xc0(%rbp), %rcx
movq %rcx, -0x58(%rbp)
movq -0x58(%rbp), %rcx
movq %rcx, -0xd0(%rbp)
movq 0x190(%rax), %rdi
movq (%rdi), %rax
movq 0x48(%rax), %rax
callq *%rax
movq %rax, -0xc8(%rbp)
jmp 0xcde89
movq -0x80(%rbp), %rax
movq -0xc8(%rbp), %rcx
movq %rcx, -0x70(%rbp)
movq 0x190(%rax), %rdi
movq (%rdi), %rax
movq 0x50(%rax), %rax
callq *%rax
movq %rax, -0xd8(%rbp)
jmp 0xcdeb1
movq -0xd8(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x59ff0
jmp 0xcdecf
movq -0xd0(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x591b0
jmp 0xcdee1
movq -0x80(%rbp), %rax
movq 0x190(%rax), %rdi
movq (%rdi), %rax
movq 0x78(%rax), %rax
xorl %esi, %esi
callq *%rax
jmp 0xcdef9
movq -0x58(%rbp), %rdi
callq 0x5d270
jmp 0xcdf04
movq -0x80(%rbp), %rdi
movl 0x5c0(%rdi), %esi
movl -0x18(%rbp), %eax
addl %eax, %esi
callq 0x5d5c0
jmp 0xcdf1a
movq -0x80(%rbp), %rdi
callq 0x5d2f0
jmp 0xcdf25
leaq -0x30(%rbp), %rdi
callq 0x5df00
addq $0xe0, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x5b6b0