// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/gui/widgets/special/cursor.cpp
// Function: smooth::GUI::Cursor::ShowCursor(bool)
S::Void S::GUI::Cursor::ShowCursor(Bool visible)
{
	/* Cancel if cursor is displayed by the IME.
	 */
	if (imeCursor) return;

	/* Cancel if cursor is already in the desired state.
	 */
	if (promptVisible == visible) return;

	Surface	*surface = GetDrawSurface();
	Point	 point	 = GetRealPosition();

	Int	 line = 0;

	if (Binary::IsFlagSet(GetFlags(), CF_MULTILINE))
	{
		for (Int j = promptPos - 1; j >= 0; j--)
		{
			if (text[j] == '\n') line++;
		}
	}

	point.x += GetDisplayCursorPositionFromLogical(promptPos) + imeAdvance;
	point.y += (font.GetScaledTextSizeY() + 3) * (line - scrollPos);

	if (!(Binary::IsFlagSet(GetFlags(), CF_MULTILINE) && (line - scrollPos < 0 || (font.GetUnscaledTextSizeY() + 3) * (line - scrollPos + 1) > GetHeight())))
	{
		if (IsVisible()) surface->Box(Rect(point, Size(1, font.GetScaledTextSizeY() + 3)), 0, Rect::Inverted);

		promptVisible = visible;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
testb $0x1, 0x5e0(%rax)
je 0xcf6fa
jmp 0xcf902
movq -0x60(%rbp), %rax
movb 0x5c4(%rax), %al
andb $0x1, %al
movzbl %al, %eax
movb -0x9(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0xcf71b
jmp 0xcf902
movq -0x60(%rbp), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
movq -0x60(%rbp), %rdi
movq %rax, -0x18(%rbp)
movq (%rdi), %rax
callq *0x48(%rax)
movq -0x60(%rbp), %rdi
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
callq 0x5a120
movl %eax, %edi
movl $0x1, %esi
callq 0x5ce30
testb $0x1, %al
jne 0xcf759
jmp 0xcf79f
movq -0x60(%rbp), %rax
movl 0x5c0(%rax), %eax
subl $0x1, %eax
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
jl 0xcf79d
movq -0x60(%rbp), %rdi
addq $0xf0, %rdi
movl -0x28(%rbp), %esi
callq 0x5d4e0
cmpl $0xa, (%rax)
jne 0xcf790
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xcf792
movl -0x28(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xcf769
jmp 0xcf79f
movq -0x60(%rbp), %rdi
movl 0x5c0(%rdi), %esi
callq 0x5ca60
movq -0x60(%rbp), %rdi
addl 0x5dc(%rdi), %eax
addl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
addq $0x140, %rdi            # imm = 0x140
movq 0x1395dc(%rip), %rsi    # 0x208da8
callq 0x5bde0
movq -0x60(%rbp), %rdi
addl $0x3, %eax
movl -0x24(%rbp), %ecx
subl 0x5d4(%rdi), %ecx
imull %ecx, %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
callq 0x5a120
movl %eax, %edi
movl $0x1, %esi
callq 0x5ce30
testb $0x1, %al
jne 0xcf801
jmp 0xcf859
movq -0x60(%rbp), %rcx
movl -0x24(%rbp), %eax
subl 0x5d4(%rcx), %eax
cmpl $0x0, %eax
jl 0xcf902
movq -0x60(%rbp), %rdi
addq $0x140, %rdi            # imm = 0x140
movq 0x13957f(%rip), %rsi    # 0x208da8
callq 0x5d5e0
movq -0x60(%rbp), %rdi
addl $0x3, %eax
movl -0x24(%rbp), %ecx
subl 0x5d4(%rdi), %ecx
addl $0x1, %ecx
imull %ecx, %eax
movl %eax, -0x64(%rbp)
callq 0x5b860
movl %eax, %ecx
movl -0x64(%rbp), %eax
cmpl %ecx, %eax
jg 0xcf902
movq -0x60(%rbp), %rdi
movq (%rdi), %rax
callq *0x90(%rax)
testb $0x1, %al
jne 0xcf86f
jmp 0xcf8f2
movq -0x60(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0x70(%rbp)
addq $0x140, %rdi            # imm = 0x140
movq 0x13951f(%rip), %rsi    # 0x208da8
callq 0x5bde0
movl %eax, %edx
addl $0x3, %edx
leaq -0x40(%rbp), %rdi
movl $0x1, %esi
callq 0x59260
leaq -0x38(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x59ff0
leaq -0x50(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x59be0
movq 0x139440(%rip), %rax    # 0x208d08
movl (%rax), %eax
movl %eax, -0x68(%rbp)
leaq -0x58(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x59260
movq -0x70(%rbp), %rdi
movl -0x68(%rbp), %ecx
leaq -0x38(%rbp), %rsi
leaq -0x50(%rbp), %rdx
leaq -0x58(%rbp), %r8
callq 0x5c110
movq -0x60(%rbp), %rax
movb -0x9(%rbp), %cl
andb $0x1, %cl
movb %cl, 0x5c4(%rax)
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)