// File: /workspace/github_c_makefile_star2_O1/mati75[P]evilwm/client_move.c
// Function: client_move_drag
void client_move_drag(struct client *c, unsigned button) {
	// Ensure we can grab pointer events.
	if (!grab_pointer(c->screen->root, display.move_curs))
		return;

	// Dragging always raises.
	client_raise(c);

	// Initial pointer and window positions; new coordinates calculated
	// relative to these.
	int x1, y1;
	int old_cx = c->x;
	int old_cy = c->y;
	get_pointer_root_xy(c->screen->root, &x1, &y1);

	struct monitor *monitor = client_monitor(c, NULL);

#ifdef INFOBANNER_MOVERESIZE
	create_info_window(c);
#endif
	if (option.no_solid_drag) {
		XGrabServer(display.dpy);
		draw_outline(c);  // draw
	}

	for (;;) {
		XEvent ev;
		XMaskEvent(display.dpy, ButtonPressMask|ButtonReleaseMask|PointerMotionMask, &ev);
		switch (ev.type) {
			case MotionNotify:
				if (ev.xmotion.root != c->screen->root)
					break;
				if (option.no_solid_drag) {
					draw_outline(c);  // erase
					XUngrabServer(display.dpy);
				}
				c->x = old_cx + (ev.xmotion.x - x1);
				c->y = old_cy + (ev.xmotion.y - y1);
				if (option.snap && !(ev.xmotion.state & altmask))
					snap_client(c, monitor);

#ifdef INFOBANNER_MOVERESIZE
				update_info_window(c);
#endif
				if (option.no_solid_drag) {
					XSync(display.dpy, False);
					XGrabServer(display.dpy);
					draw_outline(c);  // draw
				} else {
					XMoveWindow(display.dpy, c->parent,
							c->x - c->border,
							c->y - c->border);
					send_config(c);
				}
				break;

			case ButtonRelease:
				if (ev.xbutton.button != button)
					continue;
				if (option.no_solid_drag) {
					draw_outline(c);  // erase
					XUngrabServer(display.dpy);
				}
#ifdef INFOBANNER_MOVERESIZE
				remove_info_window();
#endif
				XUngrabPointer(display.dpy, CurrentTime);
				if (option.no_solid_drag) {
					// For solid drags, the client was
					// moved with the mouse.  For non-solid
					// drags, we need a final move/raise:
					client_moveresizeraise(c);
				}
				return;

			default:
				break;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movl %esi, %r12d
movq %rdi, %r14
leaq 0xa47b(%rip), %r13      # 0x10738
movq 0x10(%rdi), %rax
movq 0x10(%rax), %rsi
movq (%r13), %rdi
subq $0x8, %rsp
xorl %eax, %eax
xorl %edx, %edx
movl $0x4c, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
pushq %rax
pushq 0x168(%r13)
pushq %rax
callq 0x4220
addq $0x20, %rsp
testl %eax, %eax
jne 0x67d7
movq %r14, %rdi
callq 0x56e7
movl 0x28(%r14), %eax
movl %eax, 0x24(%rsp)
movl 0x2c(%r14), %eax
movl %eax, 0x20(%rsp)
movq 0x10(%r14), %rax
movq 0x10(%rax), %rdi
leaq 0x2c(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x98b3
movq %r14, %rdi
xorl %esi, %esi
callq 0x53e4
movq %rax, 0x10(%rsp)
leaq 0xa5bf(%rip), %r15      # 0x10900
cmpl $0x0, 0x38(%r15)
je 0x6359
movq (%r13), %rdi
callq 0x4110
movq %r14, %rdi
callq 0x6178
leaq 0x48(%rsp), %rbp
movl %r12d, 0x1c(%rsp)
movq (%r13), %rdi
movl $0x4c, %esi
movq %rbp, %rdx
callq 0x4510
movl 0x48(%rsp), %eax
cmpl $0x5, %eax
je 0x661b
movl $0x0, %ebx
cmpl $0x6, %eax
jne 0x67c6
movq 0x70(%rsp), %rax
movq 0x10(%r14), %rcx
cmpq 0x10(%rcx), %rax
jne 0x67c6
cmpl $0x0, 0x38(%r15)
je 0x63ba
movq %r14, %rdi
callq 0x6178
movq (%r13), %rdi
callq 0x43a0
movl 0x88(%rsp), %edi
subl 0x2c(%rsp), %edi
addl 0x24(%rsp), %edi
movl %edi, 0x28(%r14)
movl 0x8c(%rsp), %esi
subl 0x28(%rsp), %esi
addl 0x20(%rsp), %esi
movl %esi, 0x2c(%r14)
movl 0x30(%r15), %edx
testl %edx, %edx
je 0x677c
leaq 0x9ffd(%rip), %rax      # 0x103f0
movl 0x28(%rax), %eax
testl %eax, 0x98(%rsp)
jne 0x677c
movq 0x10(%rsp), %rax
movl 0x8(%rax), %ecx
movq %rcx, 0x30(%rsp)
movl 0xc(%rax), %eax
movq %rax, 0x38(%rsp)
leaq 0xa2f9(%rip), %rax      # 0x10718
movq (%rax), %r10
movl %edx, %ebp
movl %edx, 0x8(%rsp)
testq %r10, %r10
je 0x6676
movq 0x8(%r10), %rcx
cmpq %r14, %rcx
je 0x6444
movq 0x10(%r14), %r8
cmpq %r8, 0x10(%rcx)
je 0x6449
movq (%r10), %r10
jmp 0x6428
movl 0x20(%rcx), %r9d
cmpl $-0x1, %r9d
je 0x6459
cmpl 0x60(%r8), %r9d
jne 0x6444
cmpl $0x0, 0x94(%rcx)
je 0x6469
cmpl $0x0, 0x68(%r8)
je 0x6444
movl %ebp, 0xc(%rsp)
movl 0x2c(%rcx), %r11d
movl 0x3c(%r14), %ebx
addl 0x3c(%rcx), %ebx
movl 0x34(%r14), %r15d
addl %esi, %r15d
movl %r11d, %r8d
subl %r15d, %r8d
subl %ebx, %r8d
cmpl %edx, %r8d
jg 0x6559
leal (%r11,%rbx), %r9d
addl 0x34(%rcx), %r9d
movl %esi, %ebp
subl %r9d, %ebp
cmpl %edx, %ebp
jg 0x6559
movq %r11, 0x40(%rsp)
movl 0x28(%rcx), %r9d
movl 0x30(%rcx), %ebp
addl %r9d, %ebp
movl %ebx, %eax
subl %edi, %eax
addl %ebp, %eax
movl 0x8(%rsp), %r11d
movl %r11d, %r12d
negl %r12d
cmovsl %r11d, %r12d
movl %eax, %r13d
negl %r13d
cmovsl %eax, %r13d
cmpl %r13d, %r12d
jb 0x64dc
movl %eax, %r11d
movl 0x30(%r14), %r13d
addl %edi, %r13d
subl %r13d, %ebp
movl %r11d, %eax
negl %eax
cmovsl %r11d, %eax
movl %ebp, %r12d
negl %r12d
cmovsl %ebp, %r12d
cmpl %r12d, %eax
jb 0x6501
movl %ebp, %r11d
addl %ebx, %r13d
movl %r9d, %ebp
subl %r13d, %ebp
movl %r11d, %eax
negl %eax
cmovsl %r11d, %eax
movl %ebp, %r12d
negl %r12d
cmovsl %ebp, %r12d
cmpl %r12d, %eax
jb 0x6525
movl %ebp, %r11d
subl %edi, %r9d
movl %r11d, %eax
negl %eax
movl %r11d, 0x8(%rsp)
cmovsl %r11d, %eax
movl %r9d, %ebp
negl %ebp
cmovsl %r9d, %ebp
cmpl %ebp, %eax
movl 0x1c(%rsp), %r12d
leaq 0xa1eb(%rip), %r13      # 0x10738
jb 0x6554
movl %r9d, 0x8(%rsp)
movq 0x40(%rsp), %r11
leal (%rbx,%rdi), %eax
addl 0x30(%r14), %eax
movl 0x28(%rcx), %r9d
movl %r9d, %ebp
subl %eax, %ebp
cmpl %edx, %ebp
jle 0x657d
leaq 0xa38c(%rip), %r15      # 0x10900
movl 0xc(%rsp), %ebp
jmp 0x6444
addl %ebx, %r9d
addl 0x30(%rcx), %r9d
movl %edi, %eax
subl %r9d, %eax
cmpl %edx, %eax
movl 0xc(%rsp), %ebp
jle 0x659d
leaq 0xa368(%rip), %r15      # 0x10900
jmp 0x6444
movl 0x34(%rcx), %ecx
addl %r11d, %ecx
subl %esi, %ebx
addl %ecx, %ebx
movl %ebp, %eax
negl %eax
cmovsl %ebp, %eax
movl %ebx, %r9d
negl %r9d
cmovsl %ebx, %r9d
cmpl %r9d, %eax
jb 0x65bf
movl %ebx, %ebp
subl %r15d, %ecx
movl %ebp, %eax
negl %eax
cmovsl %ebp, %eax
movl %ecx, %r9d
negl %r9d
cmovsl %ecx, %r9d
cmpl %r9d, %eax
jb 0x65da
movl %ecx, %ebp
movl %ebp, %eax
negl %eax
cmovsl %ebp, %eax
movl %r8d, %ecx
negl %ecx
cmovsl %r8d, %ecx
cmpl %ecx, %eax
leaq 0xa30d(%rip), %r15      # 0x10900
jb 0x65f8
movl %r8d, %ebp
subl %esi, %r11d
movl %ebp, %eax
negl %eax
cmovsl %ebp, %eax
movl %r11d, %ecx
negl %ecx
cmovsl %r11d, %ecx
cmpl %ecx, %eax
jb 0x6444
movl %r11d, %ebp
jmp 0x6444
movl $0x3, %ebx
cmpl %r12d, 0x9c(%rsp)
jne 0x67c6
cmpl $0x0, 0x38(%r15)
je 0x6646
movq %r14, %rdi
callq 0x6178
movq (%r13), %rdi
callq 0x43a0
movq (%r13), %rdi
xorl %esi, %esi
callq 0x41b0
movl $0x1, %ebx
cmpl $0x0, 0x38(%r15)
je 0x67c6
movq %r14, %rdi
callq 0x56e7
movq %r14, %rdi
callq 0x6902
jmp 0x67c6
movl 0x8(%rsp), %eax
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
cmpl %edx, %ecx
jge 0x668b
addl %edi, %eax
movl %eax, 0x28(%r14)
movl %ebp, %eax
negl %eax
cmovsl %ebp, %eax
cmpl %edx, %eax
jge 0x669c
addl %esi, %ebp
movl %ebp, 0x2c(%r14)
movl 0x28(%r14), %ecx
movl 0x3c(%r14), %r8d
movq 0x10(%rsp), %rax
movl (%rax), %eax
leal (%rax,%r8), %esi
subl %esi, %ecx
movl %ecx, %edi
negl %edi
cmovsl %ecx, %edi
cmpl %edx, %edi
jge 0x66c0
movl %esi, 0x28(%r14)
movl 0x2c(%r14), %r9d
movq 0x10(%rsp), %rcx
movl 0x4(%rcx), %ecx
leal (%rcx,%r8), %edi
subl %edi, %r9d
movl %r9d, %r10d
negl %r10d
cmovsl %r9d, %r10d
cmpl %edx, %r10d
jge 0x66e6
movl %edi, 0x2c(%r14)
movl 0x28(%r14), %ebx
movl 0x30(%r14), %r9d
movq 0x30(%rsp), %r10
addl %eax, %r10d
leal (%r9,%r8), %r11d
subl %r10d, %ebx
addl %r11d, %ebx
movl %ebx, %ebp
negl %ebp
cmovsl %ebx, %ebp
cmpl %edx, %ebp
jge 0x6712
subl %r11d, %r10d
movl %r10d, 0x28(%r14)
movl 0x2c(%r14), %ebx
movl 0x34(%r14), %r10d
movq 0x38(%rsp), %r11
addl %ecx, %r11d
addl %r10d, %r8d
subl %r11d, %ebx
addl %r8d, %ebx
movl %ebx, %ebp
negl %ebp
cmovsl %ebx, %ebp
cmpl %edx, %ebp
jge 0x673d
subl %r8d, %r11d
movl %r11d, 0x2c(%r14)
movl 0x28(%r14), %edx
movl %edx, %r8d
negl %r8d
cmovsl %edx, %r8d
xorl %esi, %r8d
xorl 0x30(%rsp), %r9d
orl %r8d, %r9d
leaq 0x48(%rsp), %rbp
jne 0x6761
movl %eax, 0x28(%r14)
movl 0x2c(%r14), %eax
movl %eax, %edx
negl %edx
cmovsl %eax, %edx
xorl %edi, %edx
xorl 0x38(%rsp), %r10d
orl %edx, %r10d
jne 0x677c
movl %ecx, 0x2c(%r14)
cmpl $0x0, 0x38(%r15)
movq (%r13), %rdi
je 0x67a3
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x4500
movq (%r13), %rdi
callq 0x4110
movq %r14, %rdi
callq 0x6178
jmp 0x67c6
movq 0x8(%r14), %rsi
movl 0x28(%r14), %edx
movl 0x3c(%r14), %eax
subl %eax, %edx
movl 0x2c(%r14), %ecx
subl %eax, %ecx
callq 0x4070
movq %r14, %rdi
callq 0x5755
xorl %ebx, %ebx
testl %ebx, %ebx
je 0x6363
cmpl $0x3, %ebx
je 0x6363
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq