// File: /workspace/github_c_makefile_star2_O1/kek[P]evilwm/screen.c
// Function: drag
void drag(Client *c) {
	XEvent ev;
	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);
				}
				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 0x5015(%rip), %r14      # 0xc7e0
movq (%r14), %rdi
movq 0x10(%rbx), %rax
movq 0x8(%rax), %rsi
leaq 0x5023(%rip), %rax      # 0xc800
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 0x7c87
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 0x4f32(%rip), %r12      # 0xc788
cmpl $0x0, (%r12)
je 0x786d
movq (%r14), %rdi
callq 0x34b0
movq %rbx, %rdi
callq 0x72b6
leaq 0x38(%rsp), %r13
movl %r15d, 0x14(%rsp)
movl %ebp, 0x10(%rsp)
movq (%r14), %rdi
movl $0x4c, %esi
movq %r13, %rdx
callq 0x3730
movl 0x38(%rsp), %eax
cmpl $0x6, %eax
je 0x789e
cmpl $0x5, %eax
jne 0x787b
jmp 0x7c57
movq 0x60(%rsp), %rax
movq 0x10(%rbx), %rcx
cmpq 0x8(%rcx), %rax
jne 0x787b
cmpl $0x0, (%r12)
je 0x78c4
movq %rbx, %rdi
callq 0x72b6
movq (%r14), %rdi
callq 0x33f0
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 0x4e9e(%rip), %rax      # 0xc784
movl (%rax), %edx
testl %edx, %edx
je 0x7c0e
leaq 0x4ae1(%rip), %rax      # 0xc3d8
movl (%rax), %eax
testl %eax, 0x88(%rsp)
jne 0x7c0e
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 0x4e64(%rip), %rax      # 0xc798
movq (%rax), %r11
movl %edx, 0x8(%rsp)
movl %edx, %r15d
testq %r11, %r11
je 0x7b2e
movl %edx, %r15d
movl %edx, 0x8(%rsp)
movq 0x8(%r11), %rbp
cmpq %rbx, %rbp
je 0x795d
cmpq %r9, 0x10(%rbp)
je 0x796a
movq (%r11), %r11
testq %r11, %r11
jne 0x794e
jmp 0x7b2e
movl 0x74(%rbp), %eax
cmpl $-0x1, %eax
je 0x7978
cmpl 0x40(%r9), %eax
jne 0x795d
cmpl $0x0, 0x78(%rbp)
je 0x7985
cmpl $0x0, 0x68(%r9)
je 0x795d
movl 0x28(%rbp), %eax
movl 0x34(%rbx), %r13d
addl 0x34(%rbp), %r13d
movl 0x30(%rbx), %r12d
addl %esi, %r12d
movl %eax, %r8d
subl %r12d, %r8d
subl %r13d, %r8d
cmpl %edx, %r8d
movq %rax, 0x28(%rsp)
jg 0x7a65
leal (%rax,%r13), %ecx
addl 0x30(%rbp), %ecx
movl %esi, %r10d
subl %ecx, %r10d
cmpl %edx, %r10d
jg 0x7a65
movl 0x24(%rbp), %eax
movl 0x2c(%rbp), %r10d
movl %eax, 0xc(%rsp)
addl %eax, %r10d
movl %r13d, %eax
subl %edi, %eax
addl %r10d, %eax
movl %r15d, %r14d
negl %r15d
cmovsl %r14d, %r15d
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
cmpl %ecx, %r15d
jb 0x79f3
movl %eax, %r14d
movl 0x2c(%rbx), %ecx
addl %edi, %ecx
subl %ecx, %r10d
movl %r14d, %eax
negl %eax
cmovsl %r14d, %eax
movl %r10d, %r15d
negl %r15d
cmovsl %r10d, %r15d
cmpl %r15d, %eax
jb 0x7a16
movl %r10d, %r14d
addl %r13d, %ecx
movl 0xc(%rsp), %r10d
subl %ecx, %r10d
movl %r14d, %eax
negl %eax
cmovsl %r14d, %eax
movl %r10d, %ecx
negl %ecx
cmovsl %r10d, %ecx
cmpl %ecx, %eax
jb 0x7a3a
movl %r10d, %r14d
movl 0xc(%rsp), %r10d
subl %edi, %r10d
movl %r14d, %eax
negl %eax
movl %r14d, %r15d
cmovsl %r14d, %eax
movl %r10d, %ecx
negl %ecx
cmovsl %r10d, %ecx
cmpl %ecx, %eax
jb 0x7a5e
movl %r10d, %r15d
leaq 0x4d7b(%rip), %r14      # 0xc7e0
leal (%rdi,%r13), %eax
addl 0x2c(%rbx), %eax
movl 0x24(%rbp), %ecx
movl %ecx, %r10d
subl %eax, %r10d
cmpl %edx, %r10d
jg 0x7a88
addl %r13d, %ecx
addl 0x2c(%rbp), %ecx
movl %edi, %eax
subl %ecx, %eax
cmpl %edx, %eax
jle 0x7a99
leaq 0x4cf9(%rip), %r12      # 0xc788
leaq 0x38(%rsp), %r13
jmp 0x795d
movl 0x30(%rbp), %r10d
addl 0x28(%rsp), %r10d
subl %esi, %r13d
addl %r10d, %r13d
movl 0x8(%rsp), %ebp
movl %ebp, %eax
negl %eax
cmovsl %ebp, %eax
movl %r13d, %ecx
negl %ecx
cmovsl %r13d, %ecx
cmpl %ecx, %eax
jb 0x7ac3
movl %r13d, %ebp
subl %r12d, %r10d
movl %ebp, %eax
negl %eax
cmovsl %ebp, %eax
movl %r10d, %ecx
negl %ecx
cmovsl %r10d, %ecx
cmpl %ecx, %eax
jb 0x7add
movl %r10d, %ebp
movl %ebp, %eax
negl %eax
cmovsl %ebp, %eax
movl %r8d, %ecx
negl %ecx
cmovsl %r8d, %ecx
cmpl %ecx, %eax
leaq 0x4c92(%rip), %r12      # 0xc788
leaq 0x38(%rsp), %r13
jb 0x7b00
movl %r8d, %ebp
movq 0x28(%rsp), %r8
subl %esi, %r8d
movl %ebp, %eax
negl %eax
movl %ebp, 0x8(%rsp)
cmovsl %ebp, %eax
movl %r8d, %ecx
negl %ecx
cmovsl %r8d, %ecx
cmpl %ecx, %eax
jb 0x795d
movl %r8d, 0x8(%rsp)
jmp 0x795d
movl %r15d, %eax
negl %eax
cmovsl %r15d, %eax
cmpl %edx, %eax
jge 0x7b42
addl %edi, %r15d
movl %r15d, 0x24(%rbx)
movl 0x8(%rsp), %ecx
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
cmpl %edx, %eax
movl 0x1c(%rsp), %r9d
movl 0x18(%rsp), %r10d
jge 0x7b60
addl %esi, %ecx
movl %ecx, 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 0x7b7b
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
jge 0x7b92
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 0x7bb4
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 0x7bda
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 0x7bf4
cmpl %r10d, %ecx
jne 0x7bf4
movl $0x0, 0x24(%rbx)
movl 0x28(%rbx), %ecx
movl %ecx, %edx
negl %edx
cmovsl %ecx, %edx
cmpl %eax, %edx
jne 0x7c0e
cmpl %r9d, %esi
jne 0x7c0e
movl $0x0, 0x28(%rbx)
cmpl $0x0, (%r12)
movq (%r14), %rdi
je 0x7c34
xorl %esi, %esi
callq 0x3490
movq (%r14), %rdi
callq 0x34b0
movq %rbx, %rdi
callq 0x72b6
jmp 0x787b
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 0x3bc8
jmp 0x787b
cmpl $0x0, (%r12)
je 0x7c6e
movq %rbx, %rdi
callq 0x72b6
movq (%r14), %rdi
callq 0x33f0
movq (%r14), %rdi
xorl %esi, %esi
callq 0x33c0
cmpl $0x0, (%r12)
je 0x7c87
movq %rbx, %rdi
callq 0x73c5
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq