// File: /workspace/github_c_makefile_star2_O3/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), %ebp
movl 0x28(%rdi), %r14d
leaq 0x4fc6(%rip), %r12      # 0xc8e0
movq (%r12), %rdi
movq 0x10(%rbx), %rax
movq 0x8(%rax), %rsi
leaq 0x4fd3(%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 0x7e39
movq %rbx, %rdi
callq 0x3ad0
movq (%r12), %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 0x4e91(%rip), %r15      # 0xc838
cmpl $0x0, (%r15)
je 0x79be
movq (%r12), %rdi
callq 0x34b0
movq %rbx, %rdi
callq 0x7405
leaq 0x4a13(%rip), %r13      # 0xc3d8
movl %ebp, 0x10(%rsp)
movl %r14d, 0xc(%rsp)
movq (%r12), %rdi
movl $0x4c, %esi
leaq 0x38(%rsp), %rdx
callq 0x3730
movl 0x38(%rsp), %eax
cmpl $0x6, %eax
je 0x79f4
cmpl $0x5, %eax
jne 0x79ce
jmp 0x7e09
movq 0x60(%rsp), %rax
movq 0x10(%rbx), %rcx
cmpq 0x8(%rcx), %rax
jne 0x79ce
cmpl $0x0, (%r15)
je 0x7a1a
movq %rbx, %rdi
callq 0x7405
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 0x7a3c
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7e4b
movl 0x78(%rsp), %edx
subl 0x24(%rsp), %edx
addl %ebp, %edx
movl %edx, 0x24(%rbx)
movl 0x7c(%rsp), %ecx
subl 0x20(%rsp), %ecx
addl %r14d, %ecx
movl %ecx, 0x28(%rbx)
leaq 0x4dd6(%rip), %rax      # 0xc834
movl (%rax), %edi
testl %edi, %edi
je 0x7dc5
movl (%r13), %eax
testl %eax, 0x88(%rsp)
jne 0x7dc5
movq (%r12), %rax
movq 0xe8(%rax), %rax
movq 0x10(%rbx), %r9
movslq (%r9), %rsi
shlq $0x7, %rsi
movl 0x18(%rax,%rsi), %r8d
movl %r8d, 0x4(%rsp)
movl 0x1c(%rax,%rsi), %eax
movl %eax, 0x18(%rsp)
leaq 0x4da0(%rip), %rax      # 0xc848
movq (%rax), %r11
movl %edi, %r14d
movl %edi, (%rsp)
testq %r11, %r11
je 0x7cc8
movl %edi, (%rsp)
movl %edi, %r14d
movq 0x8(%r11), %r13
cmpq %rbx, %r13
je 0x7acf
cmpq %r9, 0x10(%r13)
je 0x7adc
movq (%r11), %r11
testq %r11, %r11
jne 0x7ac0
jmp 0x7cc8
movl 0x78(%r13), %eax
cmpl $-0x1, %eax
je 0x7aeb
cmpl 0x40(%r9), %eax
jne 0x7acf
cmpl $0x0, 0x7c(%r13)
je 0x7af9
cmpl $0x0, 0x68(%r9)
je 0x7acf
movl %r14d, 0x8(%rsp)
movl 0x28(%r13), %r8d
movl 0x34(%rbx), %esi
addl 0x34(%r13), %esi
movl 0x30(%rbx), %eax
addl %ecx, %eax
movl %r8d, %ebp
subl %eax, %ebp
subl %esi, %ebp
cmpl %edi, %ebp
movl %ebp, 0x1c(%rsp)
jle 0x7b26
movl 0x2c(%rbx), %r14d
jmp 0x7c09
leal (%r8,%rsi), %r10d
addl 0x30(%r13), %r10d
movl %ecx, %r15d
subl %r10d, %r15d
movl 0x2c(%rbx), %r14d
cmpl %edi, %r15d
jle 0x7b49
leaq 0x4cf4(%rip), %r15      # 0xc838
jmp 0x7c09
movq %r8, 0x28(%rsp)
movl 0x24(%r13), %r8d
movl 0x2c(%r13), %r15d
movl %r8d, 0x14(%rsp)
addl %r8d, %r15d
movl %esi, %r10d
subl %edx, %r10d
addl %r15d, %r10d
movl (%rsp), %r8d
movl %r8d, %ebp
negl %ebp
cmovsl %r8d, %ebp
movl %r10d, %r12d
negl %r12d
cmovsl %r10d, %r12d
cmpl %r12d, %ebp
jb 0x7b86
movl %r10d, %r8d
leal (%r14,%rdx), %r12d
subl %r12d, %r15d
movl %r8d, %r10d
negl %r10d
cmovsl %r8d, %r10d
movl %r15d, %ebp
negl %ebp
cmovsl %r15d, %ebp
cmpl %ebp, %r10d
jb 0x7ba8
movl %r15d, %r8d
addl %esi, %r12d
movl 0x14(%rsp), %r15d
subl %r12d, %r15d
movl %r8d, %r10d
negl %r10d
cmovsl %r8d, %r10d
movl %r15d, %ebp
negl %ebp
cmovsl %r15d, %ebp
cmpl %ebp, %r10d
jb 0x7bce
movl %r15d, %r8d
movl 0x14(%rsp), %r15d
subl %edx, %r15d
movl %r8d, %r10d
negl %r10d
movl %r8d, (%rsp)
cmovsl %r8d, %r10d
movl %r15d, %ebp
negl %ebp
cmovsl %r15d, %ebp
cmpl %ebp, %r10d
leaq 0x4ce9(%rip), %r12      # 0xc8e0
jb 0x7bfd
movl %r15d, (%rsp)
leaq 0x4c34(%rip), %r15      # 0xc838
movq 0x28(%rsp), %r8
movl 0x24(%r13), %r10d
addl %esi, %r14d
addl %edx, %r14d
movl %r10d, %ebp
subl %r14d, %ebp
cmpl %edi, %ebp
jle 0x7c27
movl 0x8(%rsp), %r14d
jmp 0x7acf
addl %esi, %r10d
addl 0x2c(%r13), %r10d
movl %edx, %ebp
subl %r10d, %ebp
cmpl %edi, %ebp
movl 0x8(%rsp), %r14d
jg 0x7acf
movl 0x30(%r13), %r10d
addl %r8d, %r10d
subl %ecx, %esi
addl %r10d, %esi
movl %r14d, %ebp
negl %ebp
cmovsl %r14d, %ebp
movl %esi, %r14d
negl %r14d
cmovsl %esi, %r14d
cmpl %r14d, %ebp
movl 0x8(%rsp), %r14d
jb 0x7c6c
movl %esi, %r14d
subl %eax, %r10d
movl %r14d, %eax
negl %eax
cmovsl %r14d, %eax
movl %r10d, %esi
negl %esi
cmovsl %r10d, %esi
cmpl %esi, %eax
movl 0x1c(%rsp), %ebp
jb 0x7c8c
movl %r10d, %r14d
movl %r14d, %eax
negl %eax
cmovsl %r14d, %eax
movl %ebp, %esi
negl %esi
cmovsl %ebp, %esi
cmpl %esi, %eax
jb 0x7ca3
movl %ebp, %r14d
subl %ecx, %r8d
movl %r14d, %eax
negl %eax
cmovsl %r14d, %eax
movl %r8d, %esi
negl %esi
cmovsl %r8d, %esi
cmpl %esi, %eax
jb 0x7acf
movl %r8d, %r14d
jmp 0x7acf
movl (%rsp), %esi
movl %esi, %eax
negl %eax
cmovsl %esi, %eax
cmpl %edi, %eax
jge 0x7cdd
addl %edx, %esi
movl %esi, 0x24(%rbx)
movl %esi, %edx
movl 0x18(%rsp), %r11d
movl %r14d, %eax
negl %eax
cmovsl %r14d, %eax
cmpl %edi, %eax
jge 0x7cf9
addl %ecx, %r14d
movl %r14d, 0x28(%rbx)
movl %r14d, %ecx
movl 0x10(%rsp), %ebp
movl 0xc(%rsp), %r14d
leaq 0x46cf(%rip), %r13      # 0xc3d8
movl 0x34(%rbx), %eax
movl %edx, %esi
subl %eax, %esi
movl %esi, %r8d
negl %r8d
cmovsl %esi, %r8d
cmpl %edi, %r8d
jge 0x7d24
movl %eax, 0x24(%rbx)
movl %eax, %edx
movl %ecx, %esi
subl %eax, %esi
movl %esi, %r8d
negl %r8d
cmovsl %esi, %r8d
cmpl %edi, %r8d
jge 0x7d3c
movl %eax, 0x28(%rbx)
movl %eax, %ecx
movl 0x2c(%rbx), %esi
movl %eax, %r8d
subl 0x4(%rsp), %r8d
addl %edx, %r8d
addl %esi, %r8d
movl %r8d, %r9d
negl %r9d
cmovsl %r8d, %r9d
cmpl %edi, %r9d
jge 0x7d67
movl 0x4(%rsp), %edx
subl %eax, %edx
subl %esi, %edx
movl %edx, 0x24(%rbx)
movl 0x30(%rbx), %r8d
movl %eax, %r9d
subl %r11d, %r9d
addl %ecx, %r9d
addl %r8d, %r9d
movl %r9d, %r10d
negl %r10d
cmovsl %r9d, %r10d
cmpl %edi, %r10d
jge 0x7d91
movl %r11d, %ecx
subl %eax, %ecx
subl %r8d, %ecx
movl %ecx, 0x28(%rbx)
movl %edx, %edi
negl %edi
cmovsl %edx, %edi
xorl %eax, %edi
xorl 0x4(%rsp), %esi
orl %edi, %esi
jne 0x7dab
movl $0x0, 0x24(%rbx)
xorl %edx, %edx
movl %ecx, %esi
negl %esi
cmovsl %ecx, %esi
xorl %eax, %esi
xorl %r11d, %r8d
orl %esi, %r8d
jne 0x7dc5
movl $0x0, 0x28(%rbx)
xorl %ecx, %ecx
cmpl $0x0, (%r15)
movq (%r12), %rdi
je 0x7dec
xorl %esi, %esi
callq 0x3490
movq (%r12), %rdi
callq 0x34b0
movq %rbx, %rdi
callq 0x7405
jmp 0x79ce
movq 0x8(%rbx), %rsi
movl 0x34(%rbx), %eax
subl %eax, %edx
subl %eax, %ecx
callq 0x3220
movq %rbx, %rdi
callq 0x3ba8
jmp 0x79ce
cmpl $0x0, (%r15)
je 0x7e20
movq %rbx, %rdi
callq 0x7405
movq (%r12), %rdi
callq 0x33f0
movq (%r12), %rdi
xorl %esi, %esi
callq 0x33c0
cmpl $0x0, (%r15)
je 0x7e39
movq %rbx, %rdi
callq 0x7514
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq