// File: /workspace/github_cpp_makefile_star2_O1/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 %rdi, %rbx
movq %rsi, 0xc8(%rsp)
leaq 0xd8(%rsp), %rdi
movq %rbx, %rsi
callq 0x2dd2
callq 0x2430
movq %rax, 0xd0(%rsp)
testq %rax, %rax
je 0x4bb6
movw $0x606, 0x12(%rax)      # imm = 0x606
leaq 0xf0(%rsp), %rdx
movq $0x3, (%rdx)
movq (%rbx), %rdi
leaq 0xd0(%rsp), %r8
xorl %esi, %esi
movl $0x1, %ecx
movl $0x1, %r9d
callq 0x2390
testq %rax, %rax
je 0x4c19
movq %rax, %r14
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x2410
movq 0xd8(%rsp), %rdi
xorl %esi, %esi
callq 0x2410
movq 0xd8(%rsp), %rdi
movq 0xc8(%rsp), %rcx
leaq 0xc0f(%rip), %rdx       # 0x5763
movq %r14, %rsi
callq 0x23a0
testl %eax, %eax
je 0x4c7c
leaq 0xbfd(%rip), %rax       # 0x5768
leaq 0x28(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x8(%rsp), %rbx
leaq 0xd8(%rsp), %rdx
leaq 0xc8(%rsp), %rcx
movq %rbx, %rdi
callq 0x57f8
movq %rbx, %rdi
callq 0x23d0
cmpq $0x0, 0x8(%rsp)
jne 0x537b
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 0x1422(%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 0x4cdf
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x4cec
movl $0x10, %edi
callq 0x20c0
movq %rax, %r14
leaq 0xb8(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
leaq 0x13bf(%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 0x4d40
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x4d4d
movl $0x10, %edi
callq 0x20c0
movq %rax, %r14
leaq 0xb8(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
leaq 0x135c(%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 0x4da1
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x4dae
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 0x1378(%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 0x4e02
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0x4e15
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 0x1317(%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 0x4e6c
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0x4e7f
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 0x12b6(%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 0x4ed6
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0x4ee9
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 0x1316(%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 0x4f40
movups (%rcx), %xmm0
leaq 0x58(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x4f4d
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 0x12c6(%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 0x4fa1
movups (%rcx), %xmm0
leaq 0x58(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x4fae
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 0x1260(%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 0x5002
movups (%rcx), %xmm0
leaq 0x58(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x500f
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 0x1103(%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 0x5063
movups (%rcx), %xmm0
leaq 0x38(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x5070
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 0x10a2(%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 0x50c4
movups (%rcx), %xmm0
leaq 0x38(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x50d1
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 0x1041(%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 0x5125
movups (%rcx), %xmm0
leaq 0x38(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x5132
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 0x10c2(%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 0x5186
movups (%rcx), %xmm0
leaq 0x18(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x5193
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 0x1061(%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 0x51d7
movups (%rcx), %xmm0
leaq 0x18(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x51e4
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 0x1000(%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 0x5225
movups (%rcx), %xmm0
leaq 0x18(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x5232
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 0x3e2d(%rip), %rsi      # 0x8ff0
movq 0x3dfe(%rip), %rdx      # 0x8fc8
movq %r14, %rdi
callq 0x23b0
jmp 0x5271
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 0x3ddc(%rip), %rsi      # 0x8ff0
movq 0x3dad(%rip), %rdx      # 0x8fc8
movq %r14, %rdi
callq 0x23b0
jmp 0x5271
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 0x3d8e(%rip), %rsi      # 0x8ff0
movq 0x3d5f(%rip), %rdx      # 0x8fc8
movq %r14, %rdi
callq 0x23b0
jmp 0x5279
jmp 0x529a
jmp 0x5279
jmp 0x529a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x52a0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x52a0
movq %rax, %rbx
movb $0x1, %bpl
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x52c8
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x52c8
jmp 0x52c2
jmp 0x52c2
movq %rax, %rbx
movb $0x1, %bpl
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x52f0
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x52f0
jmp 0x52ea
jmp 0x52ea
movq %rax, %rbx
movb $0x1, %bpl
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x5319
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x5319
jmp 0x5313
jmp 0x5313
movq %rax, %rbx
movb $0x1, %bpl
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x533c
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x533c
jmp 0x5336
jmp 0x5336
movq %rax, %rbx
movb $0x1, %bpl
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x5359
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x2220
testb %bpl, %bpl
je 0x5373
movq %r14, %rdi
callq 0x2120
jmp 0x5373
cmpq $0x0, 0x8(%rsp)
jne 0x537b
movq %rax, %rbx
movq %rbx, %rdi
callq 0x23e0
callq 0x2060