// File: /workspace/github_c_makefile_star2_O1/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 0xc3910
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movb 0xb46aa(%rip), %al      # 0x177f58
testb %al, %al
je 0xc3987
movb 0xb46ac(%rip), %al      # 0x177f68
testb %al, %al
je 0xc39c4
movb 0xb46ae(%rip), %al      # 0x177f78
testb %al, %al
je 0xc3a01
movb 0xb46b0(%rip), %al      # 0x177f88
testb %al, %al
je 0xc3a3e
cmpl $0x4, %ebp
ja 0xc3910
movl %ebp, %eax
leaq 0x50a9a(%rip), %rcx     # 0x114388
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 0xc3971
xorl %eax, %eax
jmp 0xc397c
movq 0x10(%rbx), %r15
movq %r14, %rdi
callq 0x55280
movq 0xb4659(%rip), %rdx     # 0x177f80
jmp 0xc3966
movq 0x10(%rbx), %r15
movq %r14, %rdi
callq 0x55280
movq 0xb4624(%rip), %rdx     # 0x177f60
jmp 0xc3966
movq 0x10(%rbx), %r15
movq %r14, %rdi
callq 0x55280
movq 0xb461f(%rip), %rdx     # 0x177f70
jmp 0xc3966
movq 0x10(%rbx), %r15
movq %r14, %rdi
callq 0x55280
movq 0xb45ea(%rip), %rdx     # 0x177f50
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 0xb45ca(%rip), %r15     # 0x177f58
movq %r15, %rdi
callq 0x56120
testl %eax, %eax
je 0xc38b6
movq 0x10(%rbx), %rdi
movl $0x98, %esi
callq 0x57750
movq %rax, 0xb459d(%rip)     # 0x177f50
leaq 0xb459e(%rip), %rdi     # 0x177f58
callq 0x56b80
jmp 0xc38b6
leaq 0xb459d(%rip), %r15     # 0x177f68
movq %r15, %rdi
callq 0x56120
testl %eax, %eax
je 0xc38c4
movq 0x10(%rbx), %rdi
movl $0x3c, %esi
callq 0x57750
movq %rax, 0xb4570(%rip)     # 0x177f60
leaq 0xb4571(%rip), %rdi     # 0x177f68
callq 0x56b80
jmp 0xc38c4
leaq 0xb4570(%rip), %r15     # 0x177f78
movq %r15, %rdi
callq 0x56120
testl %eax, %eax
je 0xc38d2
movq 0x10(%rbx), %rdi
movl $0x6c, %esi
callq 0x57750
movq %rax, 0xb4543(%rip)     # 0x177f70
leaq 0xb4544(%rip), %rdi     # 0x177f78
callq 0x56b80
jmp 0xc38d2
leaq 0xb4543(%rip), %r15     # 0x177f88
movq %r15, %rdi
callq 0x56120
testl %eax, %eax
je 0xc38e0
movq 0x10(%rbx), %rdi
movl $0x74, %esi
callq 0x57750
movq %rax, 0xb4516(%rip)     # 0x177f80
leaq 0xb4517(%rip), %rdi     # 0x177f88
callq 0x56b80
jmp 0xc38e0
jmp 0xc3a81
jmp 0xc3a81
jmp 0xc3a81
movq %rax, %rbx
movq %r15, %rdi
callq 0x56420
movq %rbx, %rdi
callq 0x57090