// File: /workspace/github_c_makefile_star2_O3/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, %r15d
movq %rdi, %rbx
leaq 0x959b(%rip), %r14      # 0xf728
movq 0x10(%rdi), %rax
movq 0x10(%rax), %rsi
movq (%r14), %rdi
subq $0x8, %rsp
xorl %eax, %eax
xorl %edx, %edx
movl $0x4c, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
pushq %rax
pushq 0x168(%r14)
pushq %rax
callq 0x4220
addq $0x20, %rsp
testl %eax, %eax
jne 0x6680
movq %rbx, %rdi
callq 0x5611
movl 0x28(%rbx), %eax
movl %eax, 0x24(%rsp)
movl 0x2c(%rbx), %eax
movl %eax, 0x20(%rsp)
movq 0x10(%rbx), %rax
movq 0x10(%rax), %rdi
leaq 0x2c(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x9700
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5371
movq %rax, 0x8(%rsp)
leaq 0x96e2(%rip), %r12      # 0xf8f0
cmpl $0x0, 0x38(%r12)
je 0x6226
movq (%r14), %rdi
callq 0x4110
movq %rbx, %rdi
callq 0x6048
leaq 0x48(%rsp), %r13
movl %r15d, 0x1c(%rsp)
movq (%r14), %rdi
movl $0x4c, %esi
movq %r13, %rdx
callq 0x4510
movl 0x48(%rsp), %eax
cmpl $0x5, %eax
je 0x64cc
cmpl $0x6, %eax
jne 0x6230
movq 0x70(%rsp), %rax
movq 0x10(%rbx), %rcx
cmpq 0x10(%rcx), %rax
jne 0x6230
cmpl $0x0, 0x38(%r12)
je 0x6279
movq %rbx, %rdi
callq 0x6048
movq (%r14), %rdi
callq 0x43a0
movl 0x88(%rsp), %edx
subl 0x2c(%rsp), %edx
addl 0x24(%rsp), %edx
movl %edx, 0x28(%rbx)
movl 0x8c(%rsp), %eax
subl 0x28(%rsp), %eax
addl 0x20(%rsp), %eax
movl %eax, 0x2c(%rbx)
movl 0x30(%r12), %r8d
testl %r8d, %r8d
je 0x6600
leaq 0x912e(%rip), %rcx      # 0xf3e0
movl 0x28(%rcx), %ecx
testl %ecx, 0x98(%rsp)
jne 0x6600
movq 0x8(%rsp), %rcx
movl 0x8(%rcx), %esi
movq %rsi, 0x30(%rsp)
movl 0xc(%rcx), %ecx
movq %rcx, 0x38(%rsp)
leaq 0x942a(%rip), %rcx      # 0xf708
movq (%rcx), %r10
movl %r8d, %r11d
movl %r8d, %r12d
testq %r10, %r10
je 0x64df
movq 0x8(%r10), %rdi
cmpq %rbx, %rdi
je 0x6303
movq 0x10(%rbx), %rcx
cmpq %rcx, 0x10(%rdi)
je 0x6308
movq (%r10), %r10
jmp 0x62e7
movl 0x20(%rdi), %esi
cmpl $-0x1, %esi
je 0x6315
cmpl 0x60(%rcx), %esi
jne 0x6303
cmpl $0x0, 0x94(%rdi)
je 0x6324
cmpl $0x0, 0x68(%rcx)
je 0x6303
movl 0x2c(%rdi), %r15d
movl 0x3c(%rbx), %r13d
addl 0x3c(%rdi), %r13d
movl 0x34(%rbx), %r14d
addl %eax, %r14d
movl %r15d, %ecx
subl %r14d, %ecx
subl %r13d, %ecx
cmpl %r8d, %ecx
jle 0x634d
movl 0x30(%rbx), %ebp
jmp 0x6418
leal (%r15,%r13), %esi
addl 0x34(%rdi), %esi
movl %eax, %r9d
subl %esi, %r9d
movl 0x30(%rbx), %ebp
cmpl %r8d, %r9d
jg 0x6418
movq %r15, 0x40(%rsp)
movl %r11d, 0x18(%rsp)
movl 0x28(%rdi), %esi
movl 0x30(%rdi), %r15d
movl %esi, 0x14(%rsp)
addl %esi, %r15d
movl %r13d, %r11d
subl %edx, %r11d
addl %r15d, %r11d
movl %r12d, %r9d
negl %r12d
cmovsl %r9d, %r12d
movl %r11d, %esi
negl %esi
cmovsl %r11d, %esi
cmpl %esi, %r12d
jb 0x63a2
movl %r11d, %r9d
leal (%rdx,%rbp), %esi
subl %esi, %r15d
movl %r9d, %r11d
negl %r11d
cmovsl %r9d, %r11d
movl %r15d, %r12d
negl %r12d
cmovsl %r15d, %r12d
cmpl %r12d, %r11d
movl %r9d, %r12d
jb 0x63c7
movl %r15d, %r12d
addl %r13d, %esi
movl 0x14(%rsp), %r9d
movl %r9d, %r15d
subl %esi, %r15d
movl %r12d, %esi
negl %esi
cmovsl %r12d, %esi
movl %r15d, %r11d
negl %r11d
cmovsl %r15d, %r11d
cmpl %r11d, %esi
jb 0x63f0
movl %r15d, %r12d
subl %edx, %r9d
movl %r12d, %esi
negl %esi
cmovsl %r12d, %esi
movl %r9d, %r11d
negl %r11d
cmovsl %r9d, %r11d
cmpl %r11d, %esi
jb 0x640e
movl %r9d, %r12d
movl 0x18(%rsp), %r11d
movq 0x40(%rsp), %r15
movl 0x28(%rdi), %esi
addl %r13d, %ebp
addl %edx, %ebp
movl %esi, %r9d
subl %ebp, %r9d
cmpl %r8d, %r9d
jg 0x643c
addl %r13d, %esi
addl 0x30(%rdi), %esi
movl %edx, %r9d
subl %esi, %r9d
cmpl %r8d, %r9d
jle 0x6446
leaq 0x48(%rsp), %r13
jmp 0x6303
movl 0x34(%rdi), %edi
addl %r15d, %edi
subl %eax, %r13d
addl %edi, %r13d
movl %r11d, %esi
negl %esi
cmovsl %r11d, %esi
movl %r13d, %r9d
negl %r9d
cmovsl %r13d, %r9d
cmpl %r9d, %esi
jb 0x646d
movl %r13d, %r11d
subl %r14d, %edi
movl %r11d, %esi
negl %esi
cmovsl %r11d, %esi
movl %edi, %r9d
negl %r9d
cmovsl %edi, %r9d
cmpl %r9d, %esi
jb 0x648b
movl %edi, %r11d
movl %r11d, %esi
negl %esi
cmovsl %r11d, %esi
movl %ecx, %edi
negl %edi
cmovsl %ecx, %edi
cmpl %edi, %esi
leaq 0x48(%rsp), %r13
jb 0x64a7
movl %ecx, %r11d
subl %eax, %r15d
movl %r11d, %ecx
negl %ecx
cmovsl %r11d, %ecx
movl %r15d, %esi
negl %esi
cmovsl %r15d, %esi
cmpl %esi, %ecx
jb 0x6303
movl %r15d, %r11d
jmp 0x6303
cmpl %r15d, 0x9c(%rsp)
jne 0x6230
jmp 0x6646
movl %r12d, %ecx
negl %ecx
cmovsl %r12d, %ecx
cmpl %r8d, %ecx
jge 0x64f7
addl %edx, %r12d
movl %r12d, 0x28(%rbx)
movl %r12d, %edx
movl %r11d, %ecx
negl %ecx
cmovsl %r11d, %ecx
cmpl %r8d, %ecx
jge 0x650b
addl %r11d, %eax
movl %eax, 0x2c(%rbx)
movl 0x3c(%rbx), %r10d
movq 0x8(%rsp), %rcx
movl (%rcx), %esi
leal (%rsi,%r10), %edi
movl %edx, %ecx
subl %edi, %ecx
movl %ecx, %r9d
negl %r9d
cmovsl %ecx, %r9d
cmpl %r8d, %r9d
jge 0x6532
movl %edi, 0x28(%rbx)
movl %edi, %edx
movq 0x8(%rsp), %rcx
movl 0x4(%rcx), %ecx
leal (%rcx,%r10), %r9d
movl %eax, %r11d
subl %r9d, %r11d
movl %r11d, %ebp
negl %ebp
cmovsl %r11d, %ebp
cmpl %r8d, %ebp
jge 0x6559
movl %r9d, 0x2c(%rbx)
movl %r9d, %eax
movl 0x30(%rbx), %r11d
movq 0x30(%rsp), %r14
leal (%rsi,%r14), %ebp
leal (%r11,%r10), %r14d
movl %edx, %r15d
subl %ebp, %r15d
addl %r14d, %r15d
movl %r15d, %r12d
negl %r12d
cmovsl %r15d, %r12d
cmpl %r8d, %r12d
jge 0x658a
subl %r14d, %ebp
movl %ebp, 0x28(%rbx)
movl %ebp, %edx
movl 0x34(%rbx), %ebp
movq 0x38(%rsp), %r14
addl %ecx, %r14d
addl %ebp, %r10d
movl %eax, %r15d
subl %r14d, %r15d
addl %r10d, %r15d
movl %r15d, %r12d
negl %r12d
cmovsl %r15d, %r12d
cmpl %r8d, %r12d
jge 0x65ba
subl %r10d, %r14d
movl %r14d, 0x2c(%rbx)
movl %r14d, %eax
movl %edx, %r8d
negl %r8d
cmovsl %edx, %r8d
xorl %edi, %r8d
xorl 0x30(%rsp), %r11d
orl %r8d, %r11d
leaq 0x9152(%rip), %r14      # 0xf728
movl 0x1c(%rsp), %r15d
leaq 0x930e(%rip), %r12      # 0xf8f0
jne 0x65e9
movl %esi, 0x28(%rbx)
movl %esi, %edx
movl %eax, %esi
negl %esi
cmovsl %eax, %esi
xorl %r9d, %esi
xorl 0x38(%rsp), %ebp
orl %esi, %ebp
jne 0x6600
movl %ecx, 0x2c(%rbx)
jmp 0x6602
movl %eax, %ecx
cmpl $0x0, 0x38(%r12)
movq (%r14), %rdi
je 0x6629
xorl %esi, %esi
callq 0x4500
movq (%r14), %rdi
callq 0x4110
movq %rbx, %rdi
callq 0x6048
jmp 0x6230
movq 0x8(%rbx), %rsi
movl 0x3c(%rbx), %eax
subl %eax, %edx
subl %eax, %ecx
callq 0x4070
movq %rbx, %rdi
callq 0x567f
jmp 0x6230
cmpl $0x0, 0x38(%r12)
je 0x665e
movq %rbx, %rdi
callq 0x6048
movq (%r14), %rdi
callq 0x43a0
movq (%r14), %rdi
xorl %esi, %esi
callq 0x41b0
cmpl $0x0, 0x38(%r12)
je 0x6680
movq %rbx, %rdi
callq 0x5611
movq %rbx, %rdi
callq 0x67ab
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq