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

	XSetWindowBackgroundPixmap(dpy,
			movewin,
			cpgm[NUM_CONSTPGM - 10]);
	XClearWindow(dpy, movewin);

	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;
			ny = ev.xmotion.y;
			XMoveWindow(dpy, mywindow, nx-xpos, ny-ypos);
			break;
		}
	} while (ev.type != ButtonRelease);
	myhint.x = nx-xpos;
	myhint.y = ny-ypos;
	XSetWindowBackgroundPixmap(dpy,
			movewin,
			cpgm[NUM_CONSTPGM - 9]);
	XClearWindow(dpy, movewin);
	do_control(); //redraw the fonts
	XUngrabPointer(dpy, CurrentTime);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movq $0x0, -0xe0(%rbp)
movq 0x14667(%rip), %rdi     # 0x197f8
movq 0x149a0(%rip), %rsi     # 0x19b38
movq 0x14939(%rip), %rdx     # 0x19ad8
callq 0x2330
movq 0x1464d(%rip), %rdi     # 0x197f8
movq 0x14986(%rip), %rsi     # 0x19b38
callq 0x2060
movq 0x1463a(%rip), %rdi     # 0x197f8
movq 0x1464b(%rip), %rsi     # 0x19810
xorl %edx, %edx
movl $0x4c, %ecx
movl $0x1, %r9d
xorl %eax, %eax
movl %r9d, %r8d
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
callq 0x2160
cmpl $0x0, %eax
je 0x5200
jmp 0x531f
leaq -0xc(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x5110
cmpl $0x0, %eax
jne 0x5217
jmp 0x531f
jmp 0x5219
movq 0x145d8(%rip), %rdi     # 0x197f8
movl $0x10804c, %esi         # imm = 0x10804C
leaq -0xd8(%rbp), %rdx
callq 0x23d0
movl -0xd8(%rbp), %eax
addl $-0x6, %eax
movl %eax, %ecx
movq %rcx, -0xe8(%rbp)
subl $0x11, %eax
ja 0x52b6
movq -0xe8(%rbp), %rax
leaq 0x1dae(%rip), %rcx      # 0x7004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x52b6
movq -0xa0(%rbp), %rax
subq -0xe0(%rbp), %rax
cmpq $0x10, %rax
ja 0x5277
jmp 0x52b8
movq -0xa0(%rbp), %rax
movq %rax, -0xe0(%rbp)
movl -0x98(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x94(%rbp), %eax
movl %eax, -0x18(%rbp)
movq 0x1455a(%rip), %rdi     # 0x197f8
movq 0x146cb(%rip), %rsi     # 0x19970
movl -0x14(%rbp), %edx
subl -0x4(%rbp), %edx
movl -0x18(%rbp), %ecx
subl -0x8(%rbp), %ecx
callq 0x2100
jmp 0x52b8
cmpl $0x5, -0xd8(%rbp)
jne 0x5219
movl -0x14(%rbp), %eax
subl -0x4(%rbp), %eax
movl %eax, 0x1455f(%rip)     # 0x19830
movl -0x18(%rbp), %eax
subl -0x8(%rbp), %eax
movl %eax, 0x14557(%rip)     # 0x19834
movq 0x14514(%rip), %rdi     # 0x197f8
movq 0x1484d(%rip), %rsi     # 0x19b38
movq 0x147ee(%rip), %rdx     # 0x19ae0
callq 0x2330
movq 0x144fa(%rip), %rdi     # 0x197f8
movq 0x14833(%rip), %rsi     # 0x19b38
callq 0x2060
callq 0x41b0
movq 0x144e2(%rip), %rdi     # 0x197f8
xorl %eax, %eax
movl %eax, %esi
callq 0x21e0
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopl (%rax,%rax)