// File: /workspace/github_cpp_makefile_star2_O3/liskin[P]hybrid-screenclone/screenclone.cc
// Function: void display::record_pointer_events<mouse_replayer>(mouse_replayer*)
void display::record_pointer_events( Fun *callback ) {
	display data = clone();

	XRecordRange *rr = XRecordAllocRange();
	if ( !rr ) ERR;
	rr->device_events.first = rr->device_events.last = MotionNotify;

	XRecordClientSpec rcs = XRecordAllClients;

	XRecordContext rc = XRecordCreateContext( dpy, 0, &rcs, 1, &rr, 1 );
	if ( !rc ) ERR;

	// sync, otherwise XRecordEnableContextAsync fails
	XSync( dpy, false );
	XSync( data.dpy, false );

	if ( !XRecordEnableContextAsync( data.dpy, rc, &record_callback< Fun >, (XPointer) callback ) )
		ERR;

	std::thread( &record_thread< Fun >, data, callback ).detach();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, 0xd0(%rsp)
leaq 0xd8(%rsp), %rdi
movq %r14, %rsi
callq 0x2dd2
callq 0x2430
movq %rax, 0xc8(%rsp)
testq %rax, %rax
je 0x4bb2
movw $0x606, 0x12(%rax)      # imm = 0x606
leaq 0xf0(%rsp), %rdx
movq $0x3, (%rdx)
movq (%r14), %rdi
leaq 0xc8(%rsp), %r8
xorl %esi, %esi
movl $0x1, %ecx
movl $0x1, %r9d
callq 0x2390
testq %rax, %rax
je 0x4c15
movq %rax, %r15
movq (%r14), %rdi
xorl %esi, %esi
callq 0x2410
movq 0xd8(%rsp), %rdi
xorl %esi, %esi
callq 0x2410
movq 0xd8(%rsp), %rdi
leaq 0xc08(%rip), %rdx       # 0x5755
movq %r15, %rsi
movq %rbx, %rcx
callq 0x23a0
testl %eax, %eax
je 0x4c78
leaq 0xbf3(%rip), %rax       # 0x575a
leaq 0x28(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x8(%rsp), %rbx
leaq 0xd8(%rsp), %rdx
leaq 0xd0(%rsp), %rcx
movq %rbx, %rdi
callq 0x57ea
movq %rbx, %rdi
callq 0x23d0
cmpq $0x0, 0x8(%rsp)
jne 0x5377
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x20c0
movq %rax, %r14
leaq 0xb8(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
leaq 0x1426(%rip), %rsi      # 0x6004
leaq 0xa8(%rsp), %rdi
callq 0x2420
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x4cdb
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x4ce8
movl $0x10, %edi
callq 0x20c0
movq %rax, %r14
leaq 0xb8(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
leaq 0x13c3(%rip), %rsi      # 0x6004
leaq 0xa8(%rsp), %rdi
callq 0x2420
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x4d3c
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x4d49
movl $0x10, %edi
callq 0x20c0
movq %rax, %r14
leaq 0xb8(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
leaq 0x1360(%rip), %rsi      # 0x6004
leaq 0xa8(%rsp), %rdi
callq 0x2420
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x4d9d
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x4daa
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
movq 0x8(%rax), %rdx
leaq 0x68(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x137c(%rip), %rsi      # 0x6087
callq 0x2420
leaq 0x98(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x4dfe
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0x4e11
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
movq 0x8(%rax), %rdx
leaq 0x68(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x131b(%rip), %rsi      # 0x6087
callq 0x2420
leaq 0x98(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x4e68
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0x4e7b
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
movq 0x8(%rax), %rdx
leaq 0x68(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x12ba(%rip), %rsi      # 0x6087
callq 0x2420
leaq 0x98(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x4ed2
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0x4ee5
movq %rdx, 0x88(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x98(%rsp)
movq 0x8(%rax), %rdx
leaq 0x88(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x131a(%rip), %rsi      # 0x6151
callq 0x2420
leaq 0x58(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x4f3c
movups (%rcx), %xmm0
leaq 0x58(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x4f49
movq %rdx, 0x88(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x98(%rsp)
movq 0x8(%rax), %rdx
leaq 0x88(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x12ca(%rip), %rsi      # 0x616b
callq 0x2420
leaq 0x58(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x4f9d
movups (%rcx), %xmm0
leaq 0x58(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x4faa
movq %rdx, 0x88(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x98(%rsp)
movq 0x8(%rax), %rdx
leaq 0x88(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1264(%rip), %rsi      # 0x616f
callq 0x2420
leaq 0x58(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x4ffe
movups (%rcx), %xmm0
leaq 0x58(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x500b
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1107(%rip), %rsi      # 0x6073
callq 0x2420
leaq 0x38(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x505f
movups (%rcx), %xmm0
leaq 0x38(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x506c
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x10a6(%rip), %rsi      # 0x6073
callq 0x2420
leaq 0x38(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x50c0
movups (%rcx), %xmm0
leaq 0x38(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x50cd
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1045(%rip), %rsi      # 0x6073
callq 0x2420
leaq 0x38(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x5121
movups (%rcx), %xmm0
leaq 0x38(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x512e
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x10c6(%rip), %rsi      # 0x6155
callq 0x2420
leaq 0x18(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x5182
movups (%rcx), %xmm0
leaq 0x18(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x518f
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1065(%rip), %rsi      # 0x6155
callq 0x2420
leaq 0x18(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x51d3
movups (%rcx), %xmm0
leaq 0x18(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x51e0
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1004(%rip), %rsi      # 0x6155
callq 0x2420
leaq 0x18(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x5221
movups (%rcx), %xmm0
leaq 0x18(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x522e
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %r14, %rdi
callq 0x2380
xorl %ebp, %ebp
movq 0x3e31(%rip), %rsi      # 0x8ff0
movq 0x3e02(%rip), %rdx      # 0x8fc8
movq %r14, %rdi
callq 0x23b0
jmp 0x526d
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %r14, %rdi
callq 0x2380
xorl %ebp, %ebp
movq 0x3de0(%rip), %rsi      # 0x8ff0
movq 0x3db1(%rip), %rdx      # 0x8fc8
movq %r14, %rdi
callq 0x23b0
jmp 0x526d
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %r14, %rdi
callq 0x2380
xorl %ebp, %ebp
movq 0x3d92(%rip), %rsi      # 0x8ff0
movq 0x3d63(%rip), %rdx      # 0x8fc8
movq %r14, %rdi
callq 0x23b0
jmp 0x5275
jmp 0x5296
jmp 0x5275
jmp 0x5296
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x529c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x529c
movq %rax, %rbx
movb $0x1, %bpl
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x52c4
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x52c4
jmp 0x52be
jmp 0x52be
movq %rax, %rbx
movb $0x1, %bpl
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x52ec
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x52ec
jmp 0x52e6
jmp 0x52e6
movq %rax, %rbx
movb $0x1, %bpl
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x5315
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x5315
jmp 0x530f
jmp 0x530f
movq %rax, %rbx
movb $0x1, %bpl
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x5338
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x5338
jmp 0x5332
jmp 0x5332
movq %rax, %rbx
movb $0x1, %bpl
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x5355
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x2220
testb %bpl, %bpl
je 0x536f
movq %r14, %rdi
callq 0x2120
jmp 0x536f
cmpq $0x0, 0x8(%rsp)
jne 0x5377
movq %rax, %rbx
movq %rbx, %rdi
callq 0x23e0
callq 0x2060