// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, 0x10(%rax)
jne 0x128bee
movb $0x0, -0x1(%rbp)
jmp 0x128e98
cmpb $0x0, 0xebfb3(%rip)     # 0x214ba8
jne 0x128c37
leaq 0xebfaa(%rip), %rdi     # 0x214ba8
callq 0x5a4e0
cmpl $0x0, %eax
je 0x128c37
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movl $0x98, %esi
callq 0x5bee0
movq %rax, -0x40(%rbp)
jmp 0x128c20
movq -0x40(%rbp), %rax
movq %rax, 0xebf75(%rip)     # 0x214ba0
leaq 0xebf76(%rip), %rdi     # 0x214ba8
callq 0x5b0c0
cmpb $0x0, 0xebf7a(%rip)     # 0x214bb8
jne 0x128c80
leaq 0xebf71(%rip), %rdi     # 0x214bb8
callq 0x5a4e0
cmpl $0x0, %eax
je 0x128c80
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movl $0x3c, %esi
callq 0x5bee0
movq %rax, -0x48(%rbp)
jmp 0x128c69
movq -0x48(%rbp), %rax
movq %rax, 0xebf3c(%rip)     # 0x214bb0
leaq 0xebf3d(%rip), %rdi     # 0x214bb8
callq 0x5b0c0
cmpb $0x0, 0xebf41(%rip)     # 0x214bc8
jne 0x128cc9
leaq 0xebf38(%rip), %rdi     # 0x214bc8
callq 0x5a4e0
cmpl $0x0, %eax
je 0x128cc9
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movl $0x6c, %esi
callq 0x5bee0
movq %rax, -0x50(%rbp)
jmp 0x128cb2
movq -0x50(%rbp), %rax
movq %rax, 0xebf03(%rip)     # 0x214bc0
leaq 0xebf04(%rip), %rdi     # 0x214bc8
callq 0x5b0c0
cmpb $0x0, 0xebf08(%rip)     # 0x214bd8
jne 0x128d12
leaq 0xebeff(%rip), %rdi     # 0x214bd8
callq 0x5a4e0
cmpl $0x0, %eax
je 0x128d12
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movl $0x74, %esi
callq 0x5bee0
movq %rax, -0x58(%rbp)
jmp 0x128cfb
movq -0x58(%rbp), %rax
movq %rax, 0xebeca(%rip)     # 0x214bd0
leaq 0xebecb(%rip), %rdi     # 0x214bd8
callq 0x5b0c0
cmpl $0x0, -0x1c(%rbp)
jne 0x128db6
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rdi
callq 0x59340
movq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0x5b9d0
jmp 0x128e87
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq 0xebe53(%rip), %rdi     # 0x214ba8
callq 0x5a860
jmp 0x128ea6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq 0xebe46(%rip), %rdi     # 0x214bb8
callq 0x5a860
jmp 0x128ea6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq 0xebe39(%rip), %rdi     # 0x214bc8
callq 0x5a860
jmp 0x128ea6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq 0xebe2c(%rip), %rdi     # 0x214bd8
callq 0x5a860
jmp 0x128ea6
cmpl $0x1, -0x1c(%rbp)
jne 0x128de9
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rdi
callq 0x59340
movq -0x68(%rbp), %rdi
movq %rax, %rsi
movq 0xebdc1(%rip), %rdx     # 0x214ba0
callq 0x5b490
jmp 0x128e85
cmpl $0x2, -0x1c(%rbp)
jne 0x128e19
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x18(%rbp), %rdi
callq 0x59340
movq -0x70(%rbp), %rdi
movq %rax, %rsi
movq 0xebd9e(%rip), %rdx     # 0x214bb0
callq 0x5b490
jmp 0x128e83
cmpl $0x3, -0x1c(%rbp)
jne 0x128e49
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x18(%rbp), %rdi
callq 0x59340
movq -0x78(%rbp), %rdi
movq %rax, %rsi
movq 0xebd7e(%rip), %rdx     # 0x214bc0
callq 0x5b490
jmp 0x128e81
cmpl $0x4, -0x1c(%rbp)
jne 0x128e79
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x18(%rbp), %rdi
callq 0x59340
movq -0x80(%rbp), %rdi
movq %rax, %rsi
movq 0xebd5e(%rip), %rdx     # 0x214bd0
callq 0x5b490
jmp 0x128e7f
movb $0x0, -0x1(%rbp)
jmp 0x128e98
jmp 0x128e81
jmp 0x128e83
jmp 0x128e85
jmp 0x128e87
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x5a0d0
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x80, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x5b6b0
nop