// File: liskin[P]hybrid-screenclone/screenclone.cc
// Function: mouse_replayer::cursor_changed()
void cursor_changed() {
		std::lock_guard< std::recursive_mutex > guard( cursor_mutex );

		if ( !on )
			return;

		XFixesCursorImage *cur;
		XcursorImage image;
		Cursor cursor;

		cur = TC( XFixesGetCursorImage( src.dpy ) );
		if ( !cur )
			return;

		memset( &image, 0, sizeof( image ) );
		image.width  = cur->width;
		image.height = cur->height;
		image.size	 = std::max( image.width, image.height );
		image.xhot	 = cur->xhot;
		image.yhot	 = cur->yhot;

		if ( 0 && sizeof( * image.pixels ) == sizeof( * cur->pixels ) ) {
			// 32-bit machines where int is long
			image.pixels = (unsigned int *) cur->pixels;
		} else {
			image.pixels = (unsigned int *) alloca(
				image.width * image.height * sizeof( unsigned int ) );
			for ( unsigned i = 0; i < image.width * image.height; ++i )
				image.pixels[ i ] = cur->pixels[ i ];
		}

		cursor = TC( XcursorImageLoadCursor( dst.dpy, &image ) );
		XFree( cur );

		TC( XDefineCursor( dst.dpy, dst_window.win, cursor ) );
		XFreeCursor( dst.dpy, cursor );

		TC( XFlush( dst.dpy ) );

		DBG( std::cout << "cursor changed" << std::endl );
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x70(%rbp)
addq $0x70, %rsi
leaq -0x10(%rbp), %rdi
callq 0x62d0
movq -0x70(%rbp), %rax
movb 0x68(%rax), %al
testb $0x1, %al
jne 0x5f4b
movl $0x1, -0x14(%rbp)
jmp 0x60ba
movq -0x70(%rbp), %rax
movq (%rax), %rdi
callq 0x32f0
movq %rax, -0x78(%rbp)
jmp 0x5f5d
movq -0x78(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x5f92
movl $0x1, -0x14(%rbp)
jmp 0x60ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x6340
jmp 0x60c8
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x20(%rbp), %rax
movzwl 0x4(%rax), %eax
leaq -0x48(%rbp), %rdi
movl %eax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movzwl 0x6(%rax), %eax
leaq -0x44(%rbp), %rsi
movl %eax, -0x44(%rbp)
callq 0x6300
movq %rax, -0x80(%rbp)
jmp 0x5fce
movq -0x80(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4c(%rbp)
movq -0x20(%rbp), %rax
movzwl 0x8(%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movzwl 0xa(%rax), %eax
movl %eax, -0x3c(%rbp)
movl -0x48(%rbp), %eax
movl -0x44(%rbp), %ecx
imull %ecx, %eax
leaq 0xf(,%rax,4), %rcx
andq $-0x10, %rcx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x30(%rbp)
movl $0x0, -0x68(%rbp)
movl -0x68(%rbp), %eax
movl -0x48(%rbp), %ecx
imull -0x44(%rbp), %ecx
cmpl %ecx, %eax
jae 0x604a
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x68(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %edx
movq -0x30(%rbp), %rax
movl -0x68(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x6016
movq -0x70(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x50(%rbp), %rsi
callq 0x3060
movq %rax, -0x88(%rbp)
jmp 0x6064
movq -0x88(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rdi
callq 0x33a0
jmp 0x607a
movq -0x70(%rbp), %rax
movq 0x18(%rax), %rdi
movq 0x50(%rax), %rsi
movq -0x58(%rbp), %rdx
callq 0x34e0
jmp 0x6091
movq -0x70(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x58(%rbp), %rsi
callq 0x3300
jmp 0x60a4
movq -0x70(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x3460
jmp 0x60b3
movl $0x0, -0x14(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x6340
movq %rbp, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x3500
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)