// File: /workspace/github_c_makefile_star2_O2/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 $0xe8, %rsp
movq 0x13215(%rip), %rdi     # 0x177f8
movq 0x13226(%rip), %rsi     # 0x17810
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
pushq $0x4c
popq %rcx
pushq $0x1
popq %r8
xorl %edx, %edx
movl %r8d, %r9d
callq 0x2150
testl %eax, %eax
jne 0x47cd
leaq 0x1c(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x42c1
testl %eax, %eax
je 0x47cd
xorl %r14d, %r14d
leaq 0x28(%rsp), %r13
leaq 0x2bda(%rip), %r15      # 0x7210
leaq 0x13523(%rip), %r12     # 0x17b60
xorl %ebp, %ebp
xorl %ebx, %ebx
movq 0x131b0(%rip), %rdi     # 0x177f8
movl $0x10804c, %esi         # imm = 0x10804C
movq %r13, %rdx
callq 0x23d0
movl 0x28(%rsp), %eax
cmpl $0x6, %eax
jne 0x476a
movq 0x60(%rsp), %rcx
movq %rcx, 0x20(%rsp)
subq %rbx, %rcx
pushq $0x6
popq %rax
cmpq $0x11, %rcx
jb 0x476a
movl 0x68(%rsp), %r14d
movl 0x6c(%rsp), %ebp
subl 0x1c(%rsp), %r14d
subl 0x18(%rsp), %ebp
leaq 0x2cb3(%rip), %rbx      # 0x7348
xorl %r13d, %r13d
cmpq $0x348, %r13            # imm = 0x348
je 0x46f6
movq 0x13150(%rip), %rdi     # 0x177f8
movq (%r13,%r12), %rsi
movl 0x134a5(%rip), %eax     # 0x17b58
addl %r14d, %eax
addl -0x4(%rbx), %eax
movl 0x13370(%rip), %r8d     # 0x17a30
imull %r8d, %eax
movl 0x13369(%rip), %r9d     # 0x17a34
cltd
idivl %r9d
movl %eax, %ecx
movl 0x13485(%rip), %eax     # 0x17b5c
addl %ebp, %eax
addl (%rbx), %eax
imull %r8d, %eax
cltd
idivl %r9d
movl %ecx, %edx
movl %eax, %ecx
callq 0x20f0
addq $0x8, %r13
addq $0x18, %rbx
jmp 0x4698
xorl %ebx, %ebx
leaq 0x28(%rsp), %r13
cmpq $0x98, %rbx
je 0x4761
movq 0x130eb(%rip), %rdi     # 0x177f8
leaq 0x1379c(%rip), %rax     # 0x17eb0
movq (%rbx,%rax), %rsi
movl 0x1343a(%rip), %eax     # 0x17b58
addl %r14d, %eax
addl (%r15,%rbx,2), %eax
movl 0x13304(%rip), %r8d     # 0x17a30
imull %r8d, %eax
movl 0x132fd(%rip), %r9d     # 0x17a34
cltd
idivl %r9d
movl %eax, %ecx
movl 0x13419(%rip), %eax     # 0x17b5c
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
jmp 0x46fd
movl 0x28(%rsp), %eax
movq 0x20(%rsp), %rbx
cmpl $0x5, %eax
jne 0x4641
movq 0x1307e(%rip), %rdi     # 0x177f8
xorl %esi, %esi
callq 0x21d0
addl %r14d, 0x17ac8(%rip)    # 0x1c250
addl %ebp, 0x17ac6(%rip)     # 0x1c254
pushq $0x8
popq %rax
leaq 0x2ba8(%rip), %rcx      # 0x7340
cmpq $0x9e0, %rax            # imm = 0x9E0
je 0x47ae
addl %r14d, -0x4(%rax,%rcx)
addl %ebp, (%rax,%rcx)
addq $0x18, %rax
jmp 0x4798
pushq $0x4
popq %rax
cmpq $0x134, %rax            # imm = 0x134
je 0x47c8
addl %r14d, -0x4(%rax,%r15)
addl %ebp, (%rax,%r15)
addq $0x10, %rax
jmp 0x47b1
callq 0x39c3
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq