// File: /workspace/github_c_makefile_star2_O3/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 0x14091(%rip), %rdi     # 0x187f8
movq 0x140a2(%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 0x498b
movq 0x14053(%rip), %rdi     # 0x187f8
movq 0x14064(%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 0x498b
xorl %r14d, %r14d
leaq 0x38(%rsp), %r13
leaq 0x3a1e(%rip), %r15      # 0x8210
xorl %ebp, %ebp
xorl %ebx, %ebx
movq 0x13ffb(%rip), %rdi     # 0x187f8
movl $0x10804c, %esi         # imm = 0x10804C
movq %r13, %rdx
callq 0x23d0
movl 0x38(%rsp), %eax
cmpl $0x6, %eax
jne 0x4928
movq 0x70(%rsp), %rdx
movq %rdx, %rcx
subq %rbx, %rcx
movl $0x6, %eax
cmpq $0x11, %rcx
leaq 0x1432e(%rip), %r12     # 0x18b60
jb 0x4928
movq %rdx, 0x28(%rsp)
movl 0x78(%rsp), %r14d
movl 0x7c(%rsp), %ebp
subl 0x24(%rsp), %r14d
subl 0x20(%rsp), %ebp
xorl %ebx, %ebx
leaq 0x3af0(%rip), %r13      # 0x8348
movq 0x13f99(%rip), %rdi     # 0x187f8
movq (%rbx,%r12), %rsi
movl 0x142ef(%rip), %eax     # 0x18b58
addl %r14d, %eax
addl -0x4(%r13), %eax
movl 0x141b9(%rip), %r8d     # 0x18a30
imull %r8d, %eax
movl 0x141b2(%rip), %r9d     # 0x18a34
cltd
idivl %r9d
movl %eax, %ecx
movl 0x142ce(%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 0x4858
xorl %ebx, %ebx
leaq 0x145f1(%rip), %r12     # 0x18eb0
movq 0x13f32(%rip), %rdi     # 0x187f8
movq (%rbx,%r12), %rsi
movl 0x14288(%rip), %eax     # 0x18b58
addl %r14d, %eax
addl (%r15,%rbx,2), %eax
movl 0x14152(%rip), %r8d     # 0x18a30
imull %r8d, %eax
movl 0x1414b(%rip), %r9d     # 0x18a34
cltd
idivl %r9d
movl %eax, %ecx
movl 0x14267(%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 0x48bf
movl 0x38(%rsp), %eax
movq 0x28(%rsp), %rbx
leaq 0x38(%rsp), %r13
cmpl $0x5, %eax
jne 0x47f6
movq 0x13ec0(%rip), %rdi     # 0x187f8
xorl %esi, %esi
callq 0x21d0
addl %r14d, 0x1890a(%rip)    # 0x1d250
addl %ebp, 0x18908(%rip)     # 0x1d254
movl $0x8, %eax
leaq 0x39e8(%rip), %rcx      # 0x8340
addl %r14d, -0x4(%rax,%rcx)
addl %ebp, (%rax,%rcx)
addq $0x18, %rax
cmpq $0x9e0, %rax            # imm = 0x9E0
jne 0x4958
movl $0x4, %eax
addl %r14d, -0x4(%rax,%r15)
addl %ebp, (%rax,%r15)
addq $0x10, %rax
cmpq $0x134, %rax            # imm = 0x134
jne 0x4971
callq 0x3a5e
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq