// File: /workspace/github_c_makefile_star2_O1/yugecin[P]evilwm/screen.c
// Function: drag
void drag(Client *c) {
	XEvent ev;
	int hv;
	int x1, y1;
	int old_cx = c->x;
	int old_cy = c->y;

	if (!grab_pointer(c->screen->root, MouseMask, move_curs)) return;
	client_raise(c);
	get_mouse_position(&x1, &y1, c->screen->root);
#ifdef INFOBANNER_MOVERESIZE
	create_info_window(c);
#endif
	if (no_solid_drag) {
		XGrabServer(dpy);
		draw_outline(c);
	}
	for (;;) {
		XMaskEvent(dpy, MouseMask, &ev);
		switch (ev.type) {
			case MotionNotify:
				if (ev.xmotion.root != c->screen->root)
					break;
				if (no_solid_drag) {
					draw_outline(c); /* clear */
					XUngrabServer(dpy);
				}

				hv = 0;
				if (c->oldh) {
					hv |= MAXIMISE_VERT;
				}
				if (c->oldw) {
					hv |= MAXIMISE_HORZ;
				}
				if (hv) {
					maximise_client(c, NET_WM_STATE_REMOVE, hv);
				}

				c->x = old_cx + (ev.xmotion.x - x1);
				c->y = old_cy + (ev.xmotion.y - y1);
				if (opt_snap && !(ev.xmotion.state & altmask))
					snap_client(c);

#ifdef INFOBANNER_MOVERESIZE
				update_info_window(c);
#endif
				if (no_solid_drag) {
					XSync(dpy, False);
					XGrabServer(dpy);
					draw_outline(c);
				} else {
					XMoveWindow(dpy, c->parent,
							c->x - c->border,
							c->y - c->border);
					send_config(c);
				}
				break;
			case ButtonRelease:
				if (no_solid_drag) {
					draw_outline(c); /* clear */
					XUngrabServer(dpy);
				}
#ifdef INFOBANNER_MOVERESIZE
				remove_info_window();
#endif
				XUngrabPointer(dpy, CurrentTime);
				if (no_solid_drag) {
					moveresize(c);
				}
				return;
			default: break;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdi, %rbx
movl 0x24(%rdi), %r15d
movl 0x28(%rdi), %ebp
leaq 0x4fbf(%rip), %r14      # 0xc8e0
movq (%r14), %rdi
movq 0x10(%rbx), %rax
movq 0x8(%rax), %rsi
leaq 0x4fcd(%rip), %rax      # 0xc900
subq $0x8, %rsp
xorl %r10d, %r10d
xorl %edx, %edx
movl $0x4c, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
pushq %r10
pushq (%rax)
pushq %r10
callq 0x32a0
addq $0x20, %rsp
testl %eax, %eax
jne 0x7e0c
movq %rbx, %rdi
callq 0x3ae2
movq (%r14), %rdi
movq 0x10(%rbx), %rax
movq 0x8(%rax), %rsi
subq $0x8, %rsp
leaq 0x38(%rsp), %rax
leaq 0x3c(%rsp), %r10
leaq 0x40(%rsp), %rcx
leaq 0x2c(%rsp), %r8
leaq 0x28(%rsp), %r9
movq %rcx, %rdx
pushq %rax
pushq %r10
pushq %r10
callq 0x3390
addq $0x20, %rsp
leaq 0x4e8c(%rip), %r13      # 0xc838
cmpl $0x0, (%r13)
je 0x79c3
movq (%r14), %rdi
callq 0x34b0
movq %rbx, %rdi
callq 0x740c
leaq 0x4a0e(%rip), %r12      # 0xc3d8
movl %r15d, 0x14(%rsp)
movl %ebp, 0x10(%rsp)
movq (%r14), %rdi
movl $0x4c, %esi
leaq 0x38(%rsp), %rdx
callq 0x3730
movl 0x38(%rsp), %eax
cmpl $0x6, %eax
je 0x79f8
cmpl $0x5, %eax
jne 0x79d3
jmp 0x7ddc
movq 0x60(%rsp), %rax
movq 0x10(%rbx), %rcx
cmpq 0x8(%rcx), %rax
jne 0x79d3
cmpl $0x0, (%r13)
je 0x7a1e
movq %rbx, %rdi
callq 0x740c
movq (%r14), %rdi
callq 0x33f0
xorl %eax, %eax
cmpl $0x0, 0x48(%rbx)
setne %al
addl %eax, %eax
xorl %edx, %edx
cmpl $0x0, 0x44(%rbx)
setne %dl
orl %eax, %edx
je 0x7a40
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7e1e
movl 0x78(%rsp), %edi
subl 0x24(%rsp), %edi
addl %r15d, %edi
movl %edi, 0x24(%rbx)
movl 0x7c(%rsp), %esi
subl 0x20(%rsp), %esi
addl %ebp, %esi
movl %esi, 0x28(%rbx)
leaq 0x4dd2(%rip), %rax      # 0xc834
movl (%rax), %edx
testl %edx, %edx
je 0x7d93
movl (%r12), %eax
testl %eax, 0x88(%rsp)
jne 0x7d93
movq (%r14), %rax
movq 0xe8(%rax), %rax
movq 0x10(%rbx), %r9
movslq (%r9), %rcx
shlq $0x7, %rcx
movl 0x18(%rax,%rcx), %r8d
movl %r8d, 0x18(%rsp)
movl 0x1c(%rax,%rcx), %eax
movl %eax, 0x1c(%rsp)
leaq 0x4d9d(%rip), %rax      # 0xc848
movq (%rax), %r11
movl %edx, %ebp
movl %edx, %r15d
testq %r11, %r11
je 0x7cb0
movl %edx, %r15d
movl %edx, %ebp
movq 0x8(%r11), %r12
cmpq %rbx, %r12
je 0x7ad1
cmpq %r9, 0x10(%r12)
je 0x7ade
movq (%r11), %r11
testq %r11, %r11
jne 0x7ac1
jmp 0x7cb0
movl 0x78(%r12), %eax
cmpl $-0x1, %eax
je 0x7aee
cmpl 0x40(%r9), %eax
jne 0x7ad1
cmpl $0x0, 0x7c(%r12)
je 0x7afd
cmpl $0x0, 0x68(%r9)
je 0x7ad1
movl %ebp, 0x8(%rsp)
movl 0x28(%r12), %eax
movl 0x34(%rbx), %ecx
addl 0x34(%r12), %ecx
movl 0x30(%rbx), %r13d
addl %esi, %r13d
movl %eax, %r8d
subl %r13d, %r8d
subl %ecx, %r8d
cmpl %edx, %r8d
movq %rax, 0x28(%rsp)
jg 0x7be4
leal (%rax,%rcx), %r10d
addl 0x30(%r12), %r10d
movl %esi, %ebp
subl %r10d, %ebp
cmpl %edx, %ebp
jg 0x7be4
movl 0x24(%r12), %eax
movl 0x2c(%r12), %r10d
movl %eax, 0xc(%rsp)
addl %eax, %r10d
movl %ecx, %eax
subl %edi, %eax
addl %r10d, %eax
movl %r15d, %r14d
negl %r15d
cmovsl %r14d, %r15d
movl %eax, %ebp
negl %ebp
cmovsl %eax, %ebp
cmpl %ebp, %r15d
jb 0x7b73
movl %eax, %r14d
movl 0x2c(%rbx), %ebp
addl %edi, %ebp
subl %ebp, %r10d
movl %r14d, %eax
negl %eax
cmovsl %r14d, %eax
movl %r10d, %r15d
negl %r15d
cmovsl %r10d, %r15d
cmpl %r15d, %eax
jb 0x7b96
movl %r10d, %r14d
addl %ecx, %ebp
movl 0xc(%rsp), %r10d
subl %ebp, %r10d
movl %r14d, %eax
negl %eax
cmovsl %r14d, %eax
movl %r10d, %ebp
negl %ebp
cmovsl %r10d, %ebp
cmpl %ebp, %eax
jb 0x7bb9
movl %r10d, %r14d
movl 0xc(%rsp), %r10d
subl %edi, %r10d
movl %r14d, %eax
negl %eax
movl %r14d, %r15d
cmovsl %r14d, %eax
movl %r10d, %ebp
negl %ebp
cmovsl %r10d, %ebp
cmpl %ebp, %eax
jb 0x7bdd
movl %r10d, %r15d
leaq 0x4cfc(%rip), %r14      # 0xc8e0
leal (%rcx,%rdi), %eax
addl 0x2c(%rbx), %eax
movl 0x24(%r12), %r10d
movl %r10d, %ebp
subl %eax, %ebp
cmpl %edx, %ebp
jle 0x7c08
leaq 0x4c39(%rip), %r13      # 0xc838
movl 0x8(%rsp), %ebp
jmp 0x7ad1
addl %ecx, %r10d
addl 0x2c(%r12), %r10d
movl %edi, %eax
subl %r10d, %eax
cmpl %edx, %eax
movl 0x8(%rsp), %ebp
jle 0x7c29
leaq 0x4c14(%rip), %r13      # 0xc838
jmp 0x7ad1
movl 0x30(%r12), %r10d
addl 0x28(%rsp), %r10d
subl %esi, %ecx
addl %r10d, %ecx
movl %ebp, %eax
negl %eax
cmovsl %ebp, %eax
movl %ecx, %ebp
negl %ebp
cmovsl %ecx, %ebp
cmpl %ebp, %eax
movl 0x8(%rsp), %ebp
jb 0x7c50
movl %ecx, %ebp
subl %r13d, %r10d
movl %ebp, %eax
negl %eax
cmovsl %ebp, %eax
movl %r10d, %ecx
negl %ecx
cmovsl %r10d, %ecx
cmpl %ecx, %eax
jb 0x7c6a
movl %r10d, %ebp
movl %ebp, %eax
negl %eax
cmovsl %ebp, %eax
movl %r8d, %ecx
negl %ecx
cmovsl %r8d, %ecx
cmpl %ecx, %eax
leaq 0x4bb5(%rip), %r13      # 0xc838
jb 0x7c88
movl %r8d, %ebp
movq 0x28(%rsp), %r8
subl %esi, %r8d
movl %ebp, %eax
negl %eax
cmovsl %ebp, %eax
movl %r8d, %ecx
negl %ecx
cmovsl %r8d, %ecx
cmpl %ecx, %eax
jb 0x7ad1
movl %r8d, %ebp
jmp 0x7ad1
movl %r15d, %eax
negl %eax
cmovsl %r15d, %eax
cmpl %edx, %eax
jge 0x7cc4
addl %edi, %r15d
movl %r15d, 0x24(%rbx)
movl %ebp, %eax
negl %eax
cmovsl %ebp, %eax
cmpl %edx, %eax
movl 0x1c(%rsp), %r9d
movl 0x18(%rsp), %r10d
jge 0x7cde
addl %esi, %ebp
movl %ebp, 0x28(%rbx)
movl 0x24(%rbx), %ecx
movl 0x34(%rbx), %eax
subl %eax, %ecx
movl %ecx, %esi
negl %esi
cmovsl %ecx, %esi
cmpl %edx, %esi
movl 0x14(%rsp), %r15d
jge 0x7cf9
movl %eax, 0x24(%rbx)
movl 0x28(%rbx), %ecx
subl %eax, %ecx
movl %ecx, %esi
negl %esi
cmovsl %ecx, %esi
cmpl %edx, %esi
movl 0x10(%rsp), %ebp
leaq 0x46c6(%rip), %r12      # 0xc3d8
jge 0x7d17
movl %eax, 0x28(%rbx)
movl 0x2c(%rbx), %ecx
movl %eax, %esi
subl %r10d, %esi
addl 0x24(%rbx), %esi
addl %ecx, %esi
movl %esi, %edi
negl %edi
cmovsl %esi, %edi
cmpl %edx, %edi
jge 0x7d39
movl %r10d, %edi
subl %eax, %edi
subl %ecx, %edi
movl %edi, 0x24(%rbx)
movl 0x30(%rbx), %esi
movl %eax, %edi
subl %r9d, %edi
addl 0x28(%rbx), %edi
addl %esi, %edi
movl %edi, %r8d
negl %r8d
cmovsl %edi, %r8d
cmpl %edx, %r8d
jge 0x7d5f
movl %r9d, %edi
subl %eax, %edi
subl %esi, %edi
movl %edi, 0x28(%rbx)
movl 0x24(%rbx), %edx
movl %edx, %edi
negl %edi
cmovsl %edx, %edi
cmpl %eax, %edi
jne 0x7d79
cmpl %r10d, %ecx
jne 0x7d79
movl $0x0, 0x24(%rbx)
movl 0x28(%rbx), %ecx
movl %ecx, %edx
negl %edx
cmovsl %ecx, %edx
cmpl %eax, %edx
jne 0x7d93
cmpl %r9d, %esi
jne 0x7d93
movl $0x0, 0x28(%rbx)
cmpl $0x0, (%r13)
movq (%r14), %rdi
je 0x7db9
xorl %esi, %esi
callq 0x3490
movq (%r14), %rdi
callq 0x34b0
movq %rbx, %rdi
callq 0x740c
jmp 0x79d3
movq 0x8(%rbx), %rsi
movl 0x24(%rbx), %edx
movl 0x34(%rbx), %eax
subl %eax, %edx
movl 0x28(%rbx), %ecx
subl %eax, %ecx
callq 0x3220
movq %rbx, %rdi
callq 0x3bba
jmp 0x79d3
cmpl $0x0, (%r13)
je 0x7df3
movq %rbx, %rdi
callq 0x740c
movq (%r14), %rdi
callq 0x33f0
movq (%r14), %rdi
xorl %esi, %esi
callq 0x33c0
cmpl $0x0, (%r13)
je 0x7e0c
movq %rbx, %rdi
callq 0x751b
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq