// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
leaq 0xbdf7(%rip), %rax      # 0x12d80
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rsi
leaq 0xbde1(%rip), %rax      # 0x12d80
movq 0x168(%rax), %rax
xorl %edx, %edx
movl $0x4c, %ecx
movl $0x1, %r9d
xorl %r8d, %r8d
movl %r9d, %r8d
movq $0x0, (%rsp)
movq %rax, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
callq 0x4230
cmpl $0x0, %eax
je 0x6fde
jmp 0x7204
movq -0x8(%rbp), %rdi
callq 0x5cb0
movq -0x8(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x2c(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdi
leaq -0x10(%rbp), %rsi
leaq -0x14(%rbp), %rdx
callq 0xcc80
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x5890
movq %rax, -0x28(%rbp)
leaq 0xbf1c(%rip), %rax      # 0x12f48
cmpl $0x0, 0x38(%rax)
je 0x704a
leaq 0xbd47(%rip), %rax      # 0x12d80
movq (%rax), %rdi
callq 0x4120
movq -0x8(%rbp), %rdi
callq 0x6bb0
jmp 0x704c
leaq 0xbd2d(%rip), %rax      # 0x12d80
movq (%rax), %rdi
movl $0x4c, %esi
leaq -0xe8(%rbp), %rdx
callq 0x4520
movl -0xe8(%rbp), %eax
movl %eax, -0xec(%rbp)
subl $0x5, %eax
je 0x719d
jmp 0x707e
movl -0xec(%rbp), %eax
subl $0x6, %eax
jne 0x71fd
jmp 0x708f
movq -0xc0(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
cmpq 0x10(%rcx), %rax
je 0x70a9
jmp 0x71ff
leaq 0xbe98(%rip), %rax      # 0x12f48
cmpl $0x0, 0x38(%rax)
je 0x70ce
movq -0x8(%rbp), %rdi
callq 0x6bb0
leaq 0xbcba(%rip), %rax      # 0x12d80
movq (%rax), %rdi
callq 0x43b0
movl -0x18(%rbp), %ecx
movl -0xa8(%rbp), %eax
subl -0x10(%rbp), %eax
addl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x28(%rax)
movl -0x1c(%rbp), %ecx
movl -0xa4(%rbp), %eax
subl -0x14(%rbp), %eax
addl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x2c(%rax)
leaq 0xbe49(%rip), %rax      # 0x12f48
cmpl $0x0, 0x30(%rax)
je 0x7127
movl -0x98(%rbp), %eax
leaq 0xb2de(%rip), %rcx      # 0x123f0
andl 0x28(%rcx), %eax
cmpl $0x0, %eax
jne 0x7127
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x7210
leaq 0xbe1a(%rip), %rax      # 0x12f48
cmpl $0x0, 0x38(%rax)
je 0x715f
leaq 0xbc45(%rip), %rax      # 0x12d80
movq (%rax), %rdi
xorl %esi, %esi
callq 0x4510
leaq 0xbc34(%rip), %rax      # 0x12d80
movq (%rax), %rdi
callq 0x4120
movq -0x8(%rbp), %rdi
callq 0x6bb0
jmp 0x719b
leaq 0xbc1a(%rip), %rax      # 0x12d80
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x8(%rbp), %rax
movl 0x28(%rax), %edx
movq -0x8(%rbp), %rax
subl 0x3c(%rax), %edx
movq -0x8(%rbp), %rax
movl 0x2c(%rax), %ecx
movq -0x8(%rbp), %rax
subl 0x3c(%rax), %ecx
callq 0x4070
movq -0x8(%rbp), %rdi
callq 0x5d50
jmp 0x71ff
movl -0x94(%rbp), %eax
cmpl -0xc(%rbp), %eax
je 0x71ad
jmp 0x704c
leaq 0xbd94(%rip), %rax      # 0x12f48
cmpl $0x0, 0x38(%rax)
je 0x71d2
movq -0x8(%rbp), %rdi
callq 0x6bb0
leaq 0xbbb6(%rip), %rax      # 0x12d80
movq (%rax), %rdi
callq 0x43b0
leaq 0xbba7(%rip), %rax      # 0x12d80
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x41c0
leaq 0xbd5c(%rip), %rax      # 0x12f48
cmpl $0x0, 0x38(%rax)
je 0x71fb
movq -0x8(%rbp), %rdi
callq 0x6f40
jmp 0x7204
jmp 0x71ff
jmp 0x704c
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopl (%rax)