// File: /workspace/github_c_makefile_star2_O2/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 $0x128, %rsp            # imm = 0x128
movq %rdi, %rbx
movl 0x24(%rdi), %eax
movl %eax, 0x3c(%rsp)
movl 0x28(%rdi), %r13d
leaq 0x6364(%rip), %r12      # 0xd8e0
movq (%r12), %rdi
movq 0x10(%rbx), %rax
movq 0x8(%rax), %rsi
leaq 0x6371(%rip), %rax      # 0xd900
movq (%rax), %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 0x32a0
testl %eax, %eax
jne 0x7a7a
movq %rbx, %rdi
callq 0x391b
movq (%r12), %rdi
movq 0x10(%rbx), %rax
movq 0x8(%rax), %rsi
leaq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x64(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %rax, (%rsp)
leaq 0x68(%rsp), %rcx
leaq 0x44(%rsp), %r8
leaq 0x40(%rsp), %r9
movq %rcx, %rdx
callq 0x3390
leaq 0x6233(%rip), %rax      # 0xd838
cmpl $0x0, (%rax)
je 0x761b
movq (%r12), %rdi
callq 0x34b0
movq %rbx, %rdi
callq 0x7077
pushq $0x4c
popq %r14
leaq 0x68(%rsp), %r15
movl %r13d, 0x28(%rsp)
movq (%r12), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3730
movl 0x68(%rsp), %eax
cmpl $0x6, %eax
je 0x764b
cmpl $0x5, %eax
jne 0x7629
jmp 0x7a3e
movq 0x90(%rsp), %rax
movq 0x10(%rbx), %rcx
cmpq 0x8(%rcx), %rax
jne 0x7629
leaq 0x61d4(%rip), %rax      # 0xd838
cmpl $0x0, (%rax)
je 0x767a
movq %rbx, %rdi
callq 0x7077
movq (%r12), %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 0x769c
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7a8c
movl 0xa8(%rsp), %edx
subl 0x44(%rsp), %edx
addl 0x3c(%rsp), %edx
movl %edx, 0x24(%rbx)
movl 0xac(%rsp), %ecx
subl 0x40(%rsp), %ecx
addl %r13d, %ecx
movl %ecx, 0x28(%rbx)
leaq 0x616e(%rip), %rax      # 0xd834
movl (%rax), %edi
testl %edi, %edi
je 0x79f4
leaq 0x5d01(%rip), %rax      # 0xd3d8
movl (%rax), %eax
testl %eax, 0xb8(%rsp)
jne 0x79f4
movq (%r12), %rax
movq 0xe8(%rax), %rax
movq 0x10(%rbx), %r8
movslq (%r8), %rsi
shlq $0x7, %rsi
movl 0x18(%rax,%rsi), %r9d
movl %r9d, 0x24(%rsp)
movl 0x1c(%rax,%rsi), %eax
movl %eax, 0x2c(%rsp)
movl %edi, %r10d
leaq 0x6130(%rip), %r9       # 0xd848
movl %edi, %r11d
movq (%r9), %r9
testq %r9, %r9
je 0x7907
movq 0x8(%r9), %r13
cmpq %rbx, %r13
je 0x771b
cmpq %r8, 0x10(%r13)
jne 0x771b
movl 0x78(%r13), %eax
cmpl $-0x1, %eax
je 0x7745
cmpl 0x40(%r8), %eax
jne 0x771b
cmpl $0x0, 0x7c(%r13)
je 0x7753
cmpl $0x0, 0x68(%r8)
je 0x771b
movl 0x28(%r13), %esi
movl 0x34(%rbx), %r14d
addl 0x34(%r13), %r14d
movl 0x30(%rbx), %eax
addl %ecx, %eax
movq %rax, 0x58(%rsp)
addl %r14d, %eax
movl %esi, %ebp
subl %eax, %ebp
movl %ebp, 0x38(%rsp)
cmpl %edi, %ebp
movq %rsi, 0x48(%rsp)
jle 0x778d
movl 0x2c(%rbx), %eax
movq %rax, 0x30(%rsp)
movq %r14, %rbp
jmp 0x7841
leal (%rsi,%r14), %eax
addl 0x30(%r13), %eax
movl %ecx, %esi
subl %eax, %esi
movl 0x2c(%rbx), %eax
movq %rax, 0x30(%rsp)
cmpl %edi, %esi
movq %r14, %rbp
jg 0x7841
movl 0x24(%r13), %r15d
movl 0x2c(%r13), %r14d
addl %r15d, %r14d
movl %ebp, %eax
subl %edx, %eax
addl %r14d, %eax
movl %r11d, %esi
negl %esi
cmovsl %r11d, %esi
movq %rbp, 0x50(%rsp)
movl %eax, %ebp
negl %ebp
cmovsl %eax, %ebp
cmpl %ebp, %esi
cmovbl %r11d, %eax
movq 0x30(%rsp), %rsi
addl %edx, %esi
subl %esi, %r14d
movl %eax, %r11d
negl %r11d
cmovsl %eax, %r11d
movl %r14d, %ebp
negl %ebp
cmovsl %r14d, %ebp
cmpl %ebp, %r11d
movq 0x50(%rsp), %rbp
cmovbl %eax, %r14d
addl %ebp, %esi
movl %r15d, %eax
subl %esi, %eax
movl %r14d, %esi
negl %esi
cmovsl %r14d, %esi
movl %eax, %r11d
negl %r11d
cmovsl %eax, %r11d
cmpl %r11d, %esi
cmovbl %r14d, %eax
subl %edx, %r15d
movl %eax, %esi
negl %esi
cmovsl %eax, %esi
movl %r15d, %r11d
negl %r11d
cmovsl %r15d, %r11d
cmpl %r11d, %esi
cmovbl %eax, %r15d
movl %r15d, %r11d
pushq $0x4c
popq %r14
movl 0x24(%r13), %esi
leal (%rdx,%rbp), %eax
movq %rbp, %r15
movq 0x30(%rsp), %rbp
addl %eax, %ebp
movl %esi, %eax
subl %ebp, %eax
movq %r15, %rbp
cmpl %edi, %eax
leaq 0x68(%rsp), %r15
jg 0x771b
addl %ebp, %esi
addl 0x2c(%r13), %esi
movl %edx, %eax
subl %esi, %eax
cmpl %edi, %eax
jg 0x771b
movl 0x30(%r13), %eax
addl 0x48(%rsp), %eax
subl %ecx, %ebp
addl %eax, %ebp
movl %r10d, %esi
negl %esi
cmovsl %r10d, %esi
movq %rbp, %r14
negl %ebp
cmovsl %r14d, %ebp
cmpl %ebp, %esi
cmovbl %r10d, %r14d
subl 0x58(%rsp), %eax
movl %r14d, %esi
negl %esi
cmovsl %r14d, %esi
movl %eax, %r10d
negl %r10d
cmovsl %eax, %r10d
cmpl %r10d, %esi
cmovbl %r14d, %eax
pushq $0x4c
popq %r14
movl %eax, %esi
negl %esi
cmovsl %eax, %esi
movl 0x38(%rsp), %r13d
movl %r13d, %r10d
negl %r10d
cmovsl %r13d, %r10d
cmpl %r10d, %esi
cmovael %r13d, %eax
movq 0x48(%rsp), %r13
subl %ecx, %r13d
movl %eax, %esi
negl %esi
cmovsl %eax, %esi
movl %r13d, %r10d
negl %r10d
cmovsl %r13d, %r10d
cmpl %r10d, %esi
cmovbl %eax, %r13d
movl %r13d, %r10d
jmp 0x771b
movl %r11d, %eax
negl %eax
cmovsl %r11d, %eax
cmpl %edi, %eax
jge 0x791e
addl %edx, %r11d
movl %r11d, 0x24(%rbx)
movl %r11d, %edx
movl 0x28(%rsp), %r13d
movl 0x2c(%rsp), %r11d
movl %r10d, %eax
negl %eax
cmovsl %r10d, %eax
cmpl %edi, %eax
jge 0x793f
addl %ecx, %r10d
movl %r10d, 0x28(%rbx)
movl %r10d, %ecx
movl 0x34(%rbx), %r8d
movl %edx, %eax
subl %r8d, %eax
movl %eax, %esi
negl %esi
cmovsl %eax, %esi
cmpl %edi, %esi
jge 0x795a
movl %r8d, 0x24(%rbx)
movl %r8d, %edx
movl %ecx, %eax
subl %r8d, %eax
movl %eax, %esi
negl %esi
cmovsl %eax, %esi
cmpl %edi, %esi
jge 0x7971
movl %r8d, 0x28(%rbx)
movl %r8d, %ecx
movl 0x2c(%rbx), %eax
movl %r8d, %esi
subl 0x24(%rsp), %esi
addl %edx, %esi
addl %eax, %esi
movl %esi, %r9d
negl %r9d
cmovsl %esi, %r9d
cmpl %edi, %r9d
jge 0x799a
movl 0x24(%rsp), %edx
subl %r8d, %edx
subl %eax, %edx
movl %edx, 0x24(%rbx)
movl 0x30(%rbx), %r9d
movl %r8d, %esi
subl %r11d, %esi
addl %ecx, %esi
addl %r9d, %esi
movl %esi, %r10d
negl %r10d
cmovsl %esi, %r10d
cmpl %edi, %r10d
jge 0x79c4
movl %r11d, %ecx
subl %r8d, %ecx
subl %r9d, %ecx
movl %ecx, 0x28(%rbx)
movl %edx, %esi
negl %esi
cmovsl %edx, %esi
xorl %r8d, %esi
xorl 0x24(%rsp), %eax
orl %esi, %eax
jne 0x79dc
andl $0x0, 0x24(%rbx)
xorl %edx, %edx
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
xorl %r8d, %eax
xorl %r11d, %r9d
orl %eax, %r9d
jne 0x79f4
andl $0x0, 0x28(%rbx)
xorl %ecx, %ecx
leaq 0x5e3d(%rip), %rax      # 0xd838
cmpl $0x0, (%rax)
movq (%r12), %rdi
je 0x7a21
xorl %esi, %esi
callq 0x3490
movq (%r12), %rdi
callq 0x34b0
movq %rbx, %rdi
callq 0x7077
jmp 0x7629
movq 0x8(%rbx), %rsi
movl 0x34(%rbx), %eax
subl %eax, %edx
subl %eax, %ecx
callq 0x3220
movq %rbx, %rdi
callq 0x39e7
jmp 0x7629
leaq 0x5df3(%rip), %rax      # 0xd838
cmpl $0x0, (%rax)
je 0x7a5b
movq %rbx, %rdi
callq 0x7077
movq (%r12), %rdi
callq 0x33f0
movq (%r12), %rdi
xorl %esi, %esi
callq 0x33c0
leaq 0x5dcb(%rip), %rax      # 0xd838
cmpl $0x0, (%rax)
je 0x7a7a
movq %rbx, %rdi
callq 0x7184
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq