// File: /workspace/github_c_makefile_star2_O1/kyx0r[P]xkeyboard/xkeyboard.c
// Function: move_keys
void move_keys()
{
	int x, y, nx = 0, ny = 0, i; 
	XEvent ev;
	Time lasttime = 0;

	if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
		None, None, CurrentTime) != GrabSuccess)
		return;
	if (!getrootptr(&x, &y))
		return;
	do {
		XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev);
		switch(ev.type) {
		case ConfigureRequest:
		case Expose:
		case MapRequest:
			break;
		case MotionNotify:
			if ((ev.xmotion.time - lasttime) <= (1000 / 60))
				continue;
			lasttime = ev.xmotion.time;
			nx = (ev.xmotion.x - x);
			ny = (ev.xmotion.y - y);

			for (i = 0; i < MAX_KEYS; i++) {
				XMoveWindow(dpy, mykey[i], 
				(ox+(xk[i].x+nx))*sn/sd, (oy+(xk[i].y+ny))*sn/sd); 
			}
			for (i = 0; i < NUM_BORDERS; i++) {
				XMoveWindow(dpy, myborder[i],
				(ox+(mb[i].x+nx))*sn/sd, (oy+(mb[i].y+ny))*sn/sd); 
			}
			break;
		}
	} while (ev.type != ButtonRelease);
	XUngrabPointer(dpy, CurrentTime);
	xkeyoffs += nx;
	ykeyoffs += ny;
	for (i = 0; i < MAX_KEYS; i++) {
		xk[i].x += nx;
		xk[i].y += ny;
	}
	for (i = 0; i < NUM_BORDERS; i++) {
		mb[i].x	+= nx;
		mb[i].y += ny;	
	}
	do_control(); 
	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq 0x14013(%rip), %rdi     # 0x187f8
movq 0x14024(%rip), %rsi     # 0x18810
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
xorl %edx, %edx
movl $0x4c, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x2150
testl %eax, %eax
jne 0x4a00
movq 0x13fd5(%rip), %rdi     # 0x187f8
movq 0x13fe6(%rip), %rsi     # 0x18810
leaq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x34(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %rax, (%rsp)
leaq 0x38(%rsp), %rcx
leaq 0x24(%rsp), %r8
leaq 0x20(%rsp), %r9
movq %rcx, %rdx
callq 0x21b0
testl %eax, %eax
je 0x4a00
xorl %r14d, %r14d
leaq 0x38(%rsp), %r13
leaq 0x39a0(%rip), %r15      # 0x8210
xorl %ebp, %ebp
xorl %ebx, %ebx
movq 0x13f7d(%rip), %rdi     # 0x187f8
movl $0x10804c, %esi         # imm = 0x10804C
movq %r13, %rdx
callq 0x23d0
cmpl $0x6, 0x38(%rsp)
jne 0x499b
movq 0x70(%rsp), %rcx
movq %rcx, %rax
subq %rbx, %rax
cmpq $0x11, %rax
leaq 0x142b7(%rip), %r12     # 0x18b60
jb 0x499b
movq %rcx, 0x28(%rsp)
movl 0x78(%rsp), %r14d
movl 0x7c(%rsp), %ebp
subl 0x24(%rsp), %r14d
subl 0x20(%rsp), %ebp
xorl %ebx, %ebx
leaq 0x3a79(%rip), %r13      # 0x8348
movq 0x13f22(%rip), %rdi     # 0x187f8
movq (%rbx,%r12), %rsi
movl 0x14278(%rip), %eax     # 0x18b58
addl %r14d, %eax
addl -0x4(%r13), %eax
movl 0x14142(%rip), %r8d     # 0x18a30
imull %r8d, %eax
movl 0x1413b(%rip), %r9d     # 0x18a34
cltd
idivl %r9d
movl %eax, %ecx
movl 0x14257(%rip), %eax     # 0x18b5c
addl %ebp, %eax
addl (%r13), %eax
imull %r8d, %eax
cltd
idivl %r9d
movl %ecx, %edx
movl %eax, %ecx
callq 0x20f0
addq $0x18, %r13
addq $0x8, %rbx
cmpq $0x348, %rbx            # imm = 0x348
jne 0x48cf
xorl %ebx, %ebx
leaq 0x1457a(%rip), %r12     # 0x18eb0
movq 0x13ebb(%rip), %rdi     # 0x187f8
movq (%rbx,%r12), %rsi
movl 0x14211(%rip), %eax     # 0x18b58
addl %r14d, %eax
addl (%r15,%rbx,2), %eax
movl 0x140db(%rip), %r8d     # 0x18a30
imull %r8d, %eax
movl 0x140d4(%rip), %r9d     # 0x18a34
cltd
idivl %r9d
movl %eax, %ecx
movl 0x141f0(%rip), %eax     # 0x18b5c
addl %ebp, %eax
addl 0x4(%r15,%rbx,2), %eax
imull %r8d, %eax
cltd
idivl %r9d
movl %ecx, %edx
movl %eax, %ecx
callq 0x20f0
addq $0x8, %rbx
cmpq $0x98, %rbx
jne 0x4936
movq 0x28(%rsp), %rbx
leaq 0x38(%rsp), %r13
cmpl $0x5, 0x38(%rsp)
jne 0x4874
movq 0x13e4b(%rip), %rdi     # 0x187f8
xorl %esi, %esi
callq 0x21d0
addl %r14d, 0x18895(%rip)    # 0x1d250
addl %ebp, 0x18893(%rip)     # 0x1d254
movl $0x8, %eax
leaq 0x3973(%rip), %rcx      # 0x8340
addl %r14d, -0x4(%rax,%rcx)
addl %ebp, (%rax,%rcx)
addq $0x18, %rax
cmpq $0x9e0, %rax            # imm = 0x9E0
jne 0x49cd
movl $0x4, %eax
addl %r14d, -0x4(%rax,%r15)
addl %ebp, (%rax,%r15)
addq $0x10, %rax
cmpq $0x134, %rax            # imm = 0x134
jne 0x49e6
callq 0x3ace
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq