// File: /workspace/github_c_makefile_star2_O2/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 $0x138, %rsp            # imm = 0x138
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x989a(%rip), %r13      # 0xf728
movq 0x10(%rdi), %rax
movq 0x10(%rax), %rsi
movq (%r13), %rdi
movq 0x168(%r13), %rax
andq $0x0, 0x10(%rsp)
movq %rax, 0x8(%rsp)
andq $0x0, (%rsp)
pushq $0x4c
popq %rcx
pushq $0x1
popq %r8
xorl %edx, %edx
movl %r8d, %r9d
callq 0x4220
testl %eax, %eax
jne 0x635d
movq %rbx, %rdi
callq 0x5360
movl 0x28(%rbx), %r12d
movl 0x2c(%rbx), %r14d
movq 0x10(%rbx), %rax
movq 0x10(%rax), %rdi
leaq 0x3c(%rsp), %rsi
leaq 0x38(%rsp), %rdx
callq 0x9241
movq %rbx, %rdi
xorl %esi, %esi
callq 0x511e
movq %rax, 0x70(%rsp)
leaq 0x99e9(%rip), %r15      # 0xf8f0
cmpl $0x0, 0x38(%r15)
je 0x5f1f
movq (%r13), %rdi
callq 0x4110
movq %rbx, %rdi
callq 0x5d4c
movl %r14d, 0x24(%rsp)
movl %ebp, 0x28(%rsp)
movl %r12d, 0x34(%rsp)
movq (%r13), %rdi
pushq $0x4c
popq %rsi
leaq 0x78(%rsp), %rdx
callq 0x4510
movl 0x78(%rsp), %eax
cmpl $0x5, %eax
je 0x5fbf
cmpl $0x6, %eax
jne 0x5f2d
movq 0xa0(%rsp), %rax
movq 0x10(%rbx), %rcx
cmpq 0x10(%rcx), %rax
jne 0x5f2d
cmpl $0x0, 0x38(%r15)
je 0x5f76
movq %rbx, %rdi
callq 0x5d4c
movq (%r13), %rdi
callq 0x43a0
movl 0xb8(%rsp), %edx
subl 0x3c(%rsp), %edx
addl %r12d, %edx
movl %edx, 0x28(%rbx)
movl 0xbc(%rsp), %r10d
subl 0x38(%rsp), %r10d
addl %r14d, %r10d
movl %r10d, 0x2c(%rbx)
movl 0x30(%r15), %r8d
testl %r8d, %r8d
je 0x5fb7
leaq 0x9435(%rip), %rax      # 0xf3e0
movl 0x28(%rax), %eax
testl %eax, 0xc8(%rsp)
je 0x5fd1
movl %r10d, %ecx
jmp 0x62e6
cmpl %ebp, 0xcc(%rsp)
jne 0x5f2d
jmp 0x632b
movq 0x70(%rsp), %r15
movl 0x8(%r15), %r14d
movl 0xc(%r15), %eax
movq %rax, 0x50(%rsp)
movl %r8d, %r9d
leaq 0x971b(%rip), %rcx      # 0xf708
movl %r8d, %eax
movq %r14, 0x48(%rsp)
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x61d5
movq 0x8(%rcx), %r11
cmpq %rbx, %r11
je 0x5ff5
movq 0x10(%rbx), %rsi
cmpq %rsi, 0x10(%r11)
jne 0x5ff5
movl 0x20(%r11), %edi
cmpl $-0x1, %edi
je 0x6022
cmpl 0x60(%rsi), %edi
jne 0x5ff5
cmpl $0x0, 0x94(%r11)
je 0x6032
cmpl $0x0, 0x68(%rsi)
je 0x5ff5
movl 0x2c(%r11), %esi
movl 0x3c(%rbx), %r12d
addl 0x3c(%r11), %r12d
movl 0x34(%rbx), %edi
addl %r10d, %edi
movq %rdi, 0x58(%rsp)
addl %r12d, %edi
movl %esi, %ebp
subl %edi, %ebp
movl %ebp, 0x30(%rsp)
cmpl %r8d, %ebp
movq %rsi, 0x60(%rsp)
movq %r12, 0x68(%rsp)
jle 0x606c
movl 0x30(%rbx), %r12d
jmp 0x611a
leal (%rsi,%r12), %edi
addl 0x34(%r11), %edi
movl %r10d, %ebp
subl %edi, %ebp
movl 0x30(%rbx), %esi
cmpl %r8d, %ebp
jle 0x6089
movq %rsi, %r12
jmp 0x611a
movl 0x28(%r11), %edi
movl %edi, 0x2c(%rsp)
movl 0x30(%r11), %r14d
addl %edi, %r14d
movl %r12d, %edi
subl %edx, %edi
addl %r14d, %edi
movq %rsi, 0x40(%rsp)
movl %eax, %esi
negl %esi
cmovsl %eax, %esi
movl %edi, %ebp
negl %ebp
cmovsl %edi, %ebp
cmpl %ebp, %esi
cmovbl %eax, %edi
movq 0x40(%rsp), %rax
addl %edx, %eax
subl %eax, %r14d
movl %edi, %esi
negl %esi
cmovsl %edi, %esi
movl %r14d, %ebp
negl %ebp
cmovsl %r14d, %ebp
cmpl %ebp, %esi
cmovbl %edi, %r14d
addl %r12d, %eax
movl 0x2c(%rsp), %ebp
movl %ebp, %esi
subl %eax, %esi
movl %r14d, %eax
negl %eax
cmovsl %r14d, %eax
movl %esi, %edi
negl %edi
cmovsl %esi, %edi
cmpl %edi, %eax
cmovbl %r14d, %esi
movq 0x48(%rsp), %r14
subl %edx, %ebp
movl %esi, %eax
negl %eax
cmovsl %esi, %eax
movl %ebp, %edi
negl %edi
cmovsl %ebp, %edi
cmpl %edi, %eax
cmovbl %esi, %ebp
movl %ebp, %eax
movq 0x40(%rsp), %r12
movl 0x28(%r11), %ebp
movq 0x68(%rsp), %rdi
addl %edi, %r12d
addl %edx, %r12d
movl %ebp, %esi
subl %r12d, %esi
cmpl %r8d, %esi
jg 0x5ff5
addl %edi, %ebp
addl 0x30(%r11), %ebp
movl %edx, %esi
subl %ebp, %esi
cmpl %r8d, %esi
jg 0x5ff5
movq %rdi, %r12
movl 0x34(%r11), %edi
movq 0x60(%rsp), %rbp
addl %ebp, %edi
subl %r10d, %r12d
addl %edi, %r12d
movl %r9d, %esi
negl %esi
cmovsl %r9d, %esi
movl %r12d, %r11d
negl %r11d
cmovsl %r12d, %r11d
cmpl %r11d, %esi
cmovbl %r9d, %r12d
subl 0x58(%rsp), %edi
movl %r12d, %esi
negl %esi
cmovsl %r12d, %esi
movl %edi, %r9d
negl %r9d
cmovsl %edi, %r9d
cmpl %r9d, %esi
cmovbl %r12d, %edi
movl %edi, %esi
negl %esi
cmovsl %edi, %esi
movl 0x30(%rsp), %r11d
movl %r11d, %r9d
negl %r9d
cmovsl %r11d, %r9d
cmpl %r9d, %esi
cmovael %r11d, %edi
subl %r10d, %ebp
movl %edi, %esi
negl %esi
cmovsl %edi, %esi
movl %ebp, %r9d
negl %r9d
cmovsl %ebp, %r9d
cmpl %r9d, %esi
cmovbl %edi, %ebp
movl %ebp, %r9d
jmp 0x5ff5
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
cmpl %r8d, %ecx
jge 0x61e8
addl %edx, %eax
movl %eax, 0x28(%rbx)
movl %eax, %edx
movl %r9d, %eax
negl %eax
cmovsl %r9d, %eax
cmpl %r8d, %eax
jge 0x61fd
addl %r9d, %r10d
movl %r10d, 0x2c(%rbx)
movl 0x3c(%rbx), %edi
movl (%r15), %esi
leal (%rsi,%rdi), %r9d
movl %edx, %eax
subl %r9d, %eax
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
cmpl %r8d, %ecx
jge 0x621f
movl %r9d, 0x28(%rbx)
movl %r9d, %edx
movl 0x4(%r15), %ecx
leal (%rcx,%rdi), %ebp
movl %r10d, %eax
subl %ebp, %eax
movl %eax, %r11d
negl %r11d
cmovsl %eax, %r11d
cmpl %r8d, %r11d
jge 0x6240
movl %ebp, 0x2c(%rbx)
movl %ebp, %r10d
movl 0x30(%rbx), %r11d
addl %esi, %r14d
leal (%r11,%rdi), %eax
movl %edx, %r12d
subl %r14d, %r12d
addl %eax, %r12d
movl %r12d, %r15d
negl %r15d
cmovsl %r12d, %r15d
cmpl %r8d, %r15d
jge 0x626d
subl %eax, %r14d
movl %r14d, 0x28(%rbx)
movl %r14d, %edx
movl 0x34(%rbx), %r14d
movq 0x50(%rsp), %rax
addl %ecx, %eax
addl %r14d, %edi
movl %r10d, %r15d
subl %eax, %r15d
addl %edi, %r15d
movl %r15d, %r12d
negl %r12d
cmovsl %r15d, %r12d
cmpl %r8d, %r12d
jge 0x629b
subl %edi, %eax
movl %eax, 0x2c(%rbx)
movl %eax, %r10d
movl %edx, %eax
negl %eax
cmovsl %edx, %eax
xorl %r9d, %eax
xorl 0x48(%rsp), %r11d
orl %eax, %r11d
leaq 0x963c(%rip), %r15      # 0xf8f0
movl 0x34(%rsp), %r12d
jne 0x62c0
movl %esi, 0x28(%rbx)
movl %esi, %edx
movl %r10d, %eax
negl %eax
cmovsl %r10d, %eax
xorl %ebp, %eax
xorl 0x50(%rsp), %r14d
orl %eax, %r14d
jne 0x62da
movl %ecx, 0x2c(%rbx)
jmp 0x62dd
movl %r10d, %ecx
movl 0x28(%rsp), %ebp
movl 0x24(%rsp), %r14d
cmpl $0x0, 0x38(%r15)
movq (%r13), %rdi
je 0x630e
xorl %esi, %esi
callq 0x4500
movq (%r13), %rdi
callq 0x4110
movq %rbx, %rdi
callq 0x5d4c
jmp 0x5f2d
movq 0x8(%rbx), %rsi
movl 0x3c(%rbx), %eax
subl %eax, %edx
subl %eax, %ecx
callq 0x4070
movq %rbx, %rdi
callq 0x53ce
jmp 0x5f2d
cmpl $0x0, 0x38(%r15)
je 0x6343
movq %rbx, %rdi
callq 0x5d4c
movq (%r13), %rdi
callq 0x43a0
movq (%r13), %rdi
xorl %esi, %esi
callq 0x41b0
cmpl $0x0, 0x38(%r15)
je 0x635d
movq %rbx, %rdi
callq 0x5e5f
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq