// File: /workspace/github_c_makefile_star2_O3/enzo1982[P]smooth/classes/input/backends/xlib/pointerxlib.cpp
// Function: smooth::Input::PointerXLib::SetCursor(smooth::GUI::Window const*, smooth::Input::Pointer::CursorType)
S::Bool S::Input::PointerXLib::SetCursor(const GUI::Window *window, Pointer::CursorType mouseCursor)
{
	if (display == NIL) return False;

	static Cursor	 hCursorTextEdit = XCreateFontCursor(display, XC_xterm);
	static Cursor	 hCursorHand	 = XCreateFontCursor(display, XC_hand2);
	static Cursor	 hCursorHSize	 = XCreateFontCursor(display, XC_sb_h_double_arrow);
	static Cursor	 hCursorVSize	 = XCreateFontCursor(display, XC_sb_v_double_arrow);

	if	(mouseCursor == Pointer::CursorArrow)	 XUndefineCursor(display, (Window) window->GetSystemWindow());
	else if (mouseCursor == Pointer::CursorTextEdit) XDefineCursor(display, (Window) window->GetSystemWindow(), hCursorTextEdit);
	else if (mouseCursor == Pointer::CursorHand)	 XDefineCursor(display, (Window) window->GetSystemWindow(), hCursorHand);
	else if (mouseCursor == Pointer::CursorHSize)	 XDefineCursor(display, (Window) window->GetSystemWindow(), hCursorHSize);
	else if (mouseCursor == Pointer::CursorVSize)	 XDefineCursor(display, (Window) window->GetSystemWindow(), hCursorVSize);
	else						 return False;

	XFlush(display);

	return True;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpq $0x0, 0x10(%rdi)
je 0xc2780
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movb 0xb483a(%rip), %al      # 0x176f58
testb %al, %al
je 0xc27f7
movb 0xb483c(%rip), %al      # 0x176f68
testb %al, %al
je 0xc2834
movb 0xb483e(%rip), %al      # 0x176f78
testb %al, %al
je 0xc2871
movb 0xb4840(%rip), %al      # 0x176f88
testb %al, %al
je 0xc28ae
cmpl $0x4, %ebp
ja 0xc2780
movl %ebp, %eax
leaq 0x50e36(%rip), %rcx     # 0x113594
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x10(%rbx), %r15
movq %r14, %rdi
callq 0x55280
movq %r15, %rdi
movq %rax, %rsi
callq 0x57340
jmp 0xc27e1
xorl %eax, %eax
jmp 0xc27ec
movq 0x10(%rbx), %r15
movq %r14, %rdi
callq 0x55280
movq 0xb47e9(%rip), %rdx     # 0x176f80
jmp 0xc27d6
movq 0x10(%rbx), %r15
movq %r14, %rdi
callq 0x55280
movq 0xb47b4(%rip), %rdx     # 0x176f60
jmp 0xc27d6
movq 0x10(%rbx), %r15
movq %r14, %rdi
callq 0x55280
movq 0xb47af(%rip), %rdx     # 0x176f70
jmp 0xc27d6
movq 0x10(%rbx), %r15
movq %r14, %rdi
callq 0x55280
movq 0xb477a(%rip), %rdx     # 0x176f50
movq %r15, %rdi
movq %rax, %rsi
callq 0x56ed0
movq 0x10(%rbx), %rdi
callq 0x55e10
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb475a(%rip), %r15     # 0x176f58
movq %r15, %rdi
callq 0x56120
testl %eax, %eax
je 0xc2726
movq 0x10(%rbx), %rdi
movl $0x98, %esi
callq 0x57750
movq %rax, 0xb472d(%rip)     # 0x176f50
leaq 0xb472e(%rip), %rdi     # 0x176f58
callq 0x56b80
jmp 0xc2726
leaq 0xb472d(%rip), %r15     # 0x176f68
movq %r15, %rdi
callq 0x56120
testl %eax, %eax
je 0xc2734
movq 0x10(%rbx), %rdi
movl $0x3c, %esi
callq 0x57750
movq %rax, 0xb4700(%rip)     # 0x176f60
leaq 0xb4701(%rip), %rdi     # 0x176f68
callq 0x56b80
jmp 0xc2734
leaq 0xb4700(%rip), %r15     # 0x176f78
movq %r15, %rdi
callq 0x56120
testl %eax, %eax
je 0xc2742
movq 0x10(%rbx), %rdi
movl $0x6c, %esi
callq 0x57750
movq %rax, 0xb46d3(%rip)     # 0x176f70
leaq 0xb46d4(%rip), %rdi     # 0x176f78
callq 0x56b80
jmp 0xc2742
leaq 0xb46d3(%rip), %r15     # 0x176f88
movq %r15, %rdi
callq 0x56120
testl %eax, %eax
je 0xc2750
movq 0x10(%rbx), %rdi
movl $0x74, %esi
callq 0x57750
movq %rax, 0xb46a6(%rip)     # 0x176f80
leaq 0xb46a7(%rip), %rdi     # 0x176f88
callq 0x56b80
jmp 0xc2750
jmp 0xc28f1
jmp 0xc28f1
jmp 0xc28f1
movq %rax, %rbx
movq %r15, %rdi
callq 0x56420
movq %rbx, %rdi
callq 0x57090