// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/gui/window/backends/xlib/windowxlib.cpp
// Function: smooth::GUI::WindowXLib::RemoveCursor(smooth::GUI::Cursor*)
S::Void S::GUI::WindowXLib::RemoveCursor(Cursor *cursor)
{
	if (activeCursor != cursor) return;

	WindowXLib	*window = GetWindowBackend((X11::Window) cursor->GetContainerWindow()->GetSystemWindow());

	if (window != NIL && window->ic != NIL)
	{
		/* Destroy input context.
		 */
		window->DestroyInputContext();

		/* Clear preediting area.
		 */
		if (activeCursor->IsVisible())
		{
			Rect	 rect = Rect::OverlapRect(Rect(activeCursorPos - Point(1, 1), activeCursor->GetRealSize()), Rect(activeCursor->GetRealPosition(), activeCursor->GetRealSize()));

			activeCursor->SetIMECursor(True);

			window->drawSurface->StartPaint(rect);
			window->drawSurface->Box(rect, activeCursor->GetBackgroundColor(), Rect::Filled);

			activeCursor->Paint(SP_PAINT);

			window->drawSurface->EndPaint();

			activeCursor->SetIMECursor(False);
		}
	}

	activeCursor	= NIL;
	activeCursorPos = Point();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq 0xf31e2(%rip), %rax     # 0x214858
cmpq -0x8(%rbp), %rax
je 0x121681
jmp 0x121835
movq -0x8(%rbp), %rdi
callq 0x59bc0
movq %rax, %rdi
callq 0x59340
movq %rax, %rdi
callq 0x121de0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x121816
movq -0x10(%rbp), %rax
cmpq $0x0, 0x148(%rax)
je 0x121816
movq -0x10(%rbp), %rdi
callq 0x125fc0
movq 0xf318d(%rip), %rdi     # 0x214858
movq (%rdi), %rax
callq *0x90(%rax)
testb $0x1, %al
jne 0x1216dd
jmp 0x121814
leaq -0x40(%rbp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0x5c2c0
leaq 0xf316c(%rip), %rdi     # 0x214860
leaq -0x40(%rbp), %rsi
callq 0x5cbd0
movq %rax, -0x38(%rbp)
movq 0xf3150(%rip), %rdi     # 0x214858
movq (%rdi), %rax
callq *0x50(%rax)
movq %rax, -0x48(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x59ff0
movq 0xf312e(%rip), %rdi     # 0x214858
movq (%rdi), %rax
callq *0x48(%rax)
movq %rax, -0x60(%rbp)
movq 0xf311d(%rip), %rdi     # 0x214858
movq (%rdi), %rax
callq *0x50(%rax)
movq %rax, -0x68(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
leaq -0x68(%rbp), %rdx
callq 0x59ff0
leaq -0x30(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x5d6a0
movq %rax, -0x20(%rbp)
movq %rdx, -0x18(%rbp)
movq 0xf30e6(%rip), %rdi     # 0x214858
movl $0x1, %esi
callq 0x5c500
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x591b0
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x90(%rbp)
movq 0xf30b5(%rip), %rdi     # 0x214858
movq (%rdi), %rax
callq *0x140(%rax)
movq %rax, -0x88(%rbp)
movq 0xe77e6(%rip), %rax     # 0x208fa0
movl (%rax), %eax
movl %eax, -0x7c(%rbp)
leaq -0x70(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x59260
movq -0x90(%rbp), %rdi
movq -0x88(%rbp), %rdx
movl -0x7c(%rbp), %ecx
leaq -0x20(%rbp), %rsi
leaq -0x70(%rbp), %r8
callq 0x5c110
movq 0xf3067(%rip), %rdi     # 0x214858
movq (%rdi), %rax
xorl %esi, %esi
callq *0x78(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x5d270
movq 0xf304b(%rip), %rdi     # 0x214858
xorl %esi, %esi
callq 0x5c500
jmp 0x121816
movq $0x0, 0xf3037(%rip) # 0x214858
leaq -0x78(%rbp), %rdi
callq 0x5b530
movq -0x78(%rbp), %rax
movq %rax, 0xf302b(%rip)     # 0x214860
addq $0x90, %rsp
popq %rbp
retq
nop