// File: /workspace/github_c_makefile_star2_O2/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 0xbc6b6
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movb 0xb0ac4(%rip), %al      # 0x16d118
testb %al, %al
je 0xbc72d
movb 0xb0ac6(%rip), %al      # 0x16d128
testb %al, %al
je 0xbc76a
movb 0xb0ac8(%rip), %al      # 0x16d138
testb %al, %al
je 0xbc7a5
movb 0xb0aca(%rip), %al      # 0x16d148
testb %al, %al
je 0xbc7e0
cmpl $0x4, %ebp
ja 0xbc6b6
movl %ebp, %eax
leaq 0x46de0(%rip), %rcx     # 0x103474
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x10(%rbx), %r15
movq %r14, %rdi
callq 0x562a0
movq %r15, %rdi
movq %rax, %rsi
callq 0x58530
jmp 0xbc717
xorl %eax, %eax
jmp 0xbc722
movq 0x10(%rbx), %r15
movq %r14, %rdi
callq 0x562a0
movq 0xb0a73(%rip), %rdx     # 0x16d140
jmp 0xbc70c
movq 0x10(%rbx), %r15
movq %r14, %rdi
callq 0x562a0
movq 0xb0a3e(%rip), %rdx     # 0x16d120
jmp 0xbc70c
movq 0x10(%rbx), %r15
movq %r14, %rdi
callq 0x562a0
movq 0xb0a39(%rip), %rdx     # 0x16d130
jmp 0xbc70c
movq 0x10(%rbx), %r15
movq %r14, %rdi
callq 0x562a0
movq 0xb0a04(%rip), %rdx     # 0x16d110
movq %r15, %rdi
movq %rax, %rsi
callq 0x58080
movq 0x10(%rbx), %rdi
callq 0x56ed0
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb09e4(%rip), %r15     # 0x16d118
movq %r15, %rdi
callq 0x57210
testl %eax, %eax
je 0xbc65c
movq 0x10(%rbx), %rdi
movl $0x98, %esi
callq 0x58990
movq %rax, 0xb09b7(%rip)     # 0x16d110
leaq 0xb09b8(%rip), %rdi     # 0x16d118
callq 0x57cf0
jmp 0xbc65c
leaq 0xb09b7(%rip), %r15     # 0x16d128
movq %r15, %rdi
callq 0x57210
testl %eax, %eax
je 0xbc66a
movq 0x10(%rbx), %rdi
pushq $0x3c
popq %rsi
callq 0x58990
movq %rax, 0xb098c(%rip)     # 0x16d120
leaq 0xb098d(%rip), %rdi     # 0x16d128
callq 0x57cf0
jmp 0xbc66a
leaq 0xb098c(%rip), %r15     # 0x16d138
movq %r15, %rdi
callq 0x57210
testl %eax, %eax
je 0xbc678
movq 0x10(%rbx), %rdi
pushq $0x6c
popq %rsi
callq 0x58990
movq %rax, 0xb0961(%rip)     # 0x16d130
leaq 0xb0962(%rip), %rdi     # 0x16d138
callq 0x57cf0
jmp 0xbc678
leaq 0xb0961(%rip), %r15     # 0x16d148
movq %r15, %rdi
callq 0x57210
testl %eax, %eax
je 0xbc686
movq 0x10(%rbx), %rdi
pushq $0x74
popq %rsi
callq 0x58990
movq %rax, 0xb0936(%rip)     # 0x16d140
leaq 0xb0937(%rip), %rdi     # 0x16d148
callq 0x57cf0
jmp 0xbc686
jmp 0xbc821
jmp 0xbc821
jmp 0xbc821
movq %rax, %rbx
movq %r15, %rdi
callq 0x57520
movq %rbx, %rdi
callq 0x58260