// File: /workspace/github_c_makefile_star2_O2/mati75[P]evilwm/client_move.c
// Function: client_resize_sweep
void client_resize_sweep(struct client *c, unsigned button) {
	// Ensure we can grab pointer events.
	if (!grab_pointer(c->screen->root, display.resize_curs))
		return;

	// Sweeping always raises.
	client_raise(c);

	int old_cx = c->x;
	int old_cy = c->y;

#ifdef INFOBANNER_MOVERESIZE
	create_info_window(c);
#endif
	XGrabServer(display.dpy);
	draw_outline(c);  // draw

	// Warp pointer to the bottom-right of the client for resizing
	setmouse(c->window, c->width, c->height);

	for (;;) {
		XEvent ev;
		XMaskEvent(display.dpy, ButtonPressMask|ButtonReleaseMask|PointerMotionMask, &ev);
		switch (ev.type) {
			case MotionNotify:
				if (ev.xmotion.root != c->screen->root)
					break;
				draw_outline(c);  // erase
				XUngrabServer(display.dpy);
				recalculate_sweep(c, old_cx, old_cy, ev.xmotion.x, ev.xmotion.y, ev.xmotion.state & altmask);
#ifdef INFOBANNER_MOVERESIZE
				update_info_window(c);
#endif
				XSync(display.dpy, False);
				XGrabServer(display.dpy);
				draw_outline(c);  // draw
				break;

			case ButtonRelease:
				if (ev.xbutton.button != button)
					continue;
				draw_outline(c);  // erase
				XUngrabServer(display.dpy);
#ifdef INFOBANNER_MOVERESIZE
				remove_info_window();
#endif
				XUngrabPointer(display.dpy, CurrentTime);
				client_moveresizeraise(c);
				// In case maximise state has changed:
				ewmh_set_net_wm_state(c);
				return;

			default:
				break;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x9bff(%rip), %r12      # 0xf728
movq 0x10(%rdi), %rax
movq 0x10(%rax), %rsi
movq (%r12), %rdi
movq 0x170(%r12), %rax
movq %rax, 0x8(%rsp)
andq $0x0, 0x10(%rsp)
andq $0x0, (%rsp)
pushq $0x4c
popq %rcx
pushq $0x1
popq %r8
xorl %edx, %edx
movl %r8d, %r9d
callq 0x4220
testl %eax, %eax
jne 0x5d3a
movl %ebp, 0x24(%rsp)
movq %rbx, %rdi
callq 0x5360
movl 0x28(%rbx), %r13d
movl 0x2c(%rbx), %ebp
movq (%r12), %rdi
callq 0x4110
movq %rbx, %rdi
callq 0x5d4c
movq (%r12), %rdi
movq (%rbx), %rdx
movl 0x30(%rbx), %eax
movl 0x34(%rbx), %ecx
andl $0x0, (%rsp)
movl %ecx, 0x10(%rsp)
movl %eax, 0x8(%rsp)
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x4530
pushq $0x4c
popq %r14
leaq 0x28(%rsp), %r15
movq (%r12), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4510
movl 0x28(%rsp), %eax
cmpl $0x5, %eax
je 0x5c7a
cmpl $0x6, %eax
jne 0x5bbb
movq 0x50(%rsp), %rax
movq 0x10(%rbx), %rcx
cmpq 0x10(%rcx), %rax
jne 0x5bbb
movq %rbx, %rdi
callq 0x5d4c
movq (%r12), %rdi
callq 0x43a0
movl 0x68(%rsp), %edi
movl 0x6c(%rsp), %ecx
leaq 0x97d5(%rip), %rax      # 0xf3e0
movl 0x28(%rax), %esi
andl 0x78(%rsp), %esi
je 0x5c8d
movl %r13d, %eax
subl %edi, %eax
movl %eax, %r8d
negl %r8d
cmovsl %eax, %r8d
movl %r8d, %eax
subl 0x84(%rbx), %eax
cltd
idivl 0x7c(%rbx)
subl %edx, %r8d
movl 0x6c(%rbx), %edx
movl %r8d, %eax
cmpl %edx, %r8d
jg 0x5c40
movl %edx, %eax
movl 0x74(%rbx), %r9d
testl %edx, %edx
cmovel %r8d, %eax
movl %eax, %edx
cmpl %r9d, %eax
jl 0x5c54
movl %r9d, %edx
testl %r9d, %r9d
cmovel %eax, %edx
cmpl %edi, %r13d
movl $0x0, %eax
cmovgl %edx, %eax
andl $0x0, 0x48(%rbx)
movl %r13d, %edi
subl %eax, %edi
movl %edx, 0x30(%rbx)
movl %edi, 0x28(%rbx)
testl %esi, %esi
jne 0x5c99
jmp 0x5c93
movl 0x24(%rsp), %eax
cmpl %eax, 0x7c(%rsp)
jne 0x5bbb
jmp 0x5d0e
cmpl $0x0, 0x48(%rbx)
je 0x5c14
cmpl $0x0, 0x4c(%rbx)
jne 0x5ced
movl %ebp, %eax
subl %ecx, %eax
movl %eax, %esi
negl %esi
cmovsl %eax, %esi
movl %esi, %eax
subl 0x88(%rbx), %eax
cltd
idivl 0x80(%rbx)
subl %edx, %esi
movl 0x70(%rbx), %edx
movl %esi, %eax
cmpl %edx, %esi
jg 0x5cc0
movl %edx, %eax
movl 0x78(%rbx), %edi
testl %edx, %edx
cmovel %esi, %eax
movl %eax, %edx
cmpl %edi, %eax
jl 0x5cd0
movl %edi, %edx
testl %edi, %edi
cmovel %eax, %edx
cmpl %ecx, %ebp
movl %edx, 0x34(%rbx)
movl $0x0, %eax
cmovlel %eax, %edx
andl $0x0, 0x4c(%rbx)
movl %ebp, %eax
subl %edx, %eax
movl %eax, 0x2c(%rbx)
movq (%r12), %rdi
xorl %esi, %esi
callq 0x4500
movq (%r12), %rdi
callq 0x4110
movq %rbx, %rdi
callq 0x5d4c
jmp 0x5bbb
movq %rbx, %rdi
callq 0x5d4c
movq (%r12), %rdi
callq 0x43a0
movq (%r12), %rdi
xorl %esi, %esi
callq 0x41b0
movq %rbx, %rdi
callq 0x5e5f
movq %rbx, %rdi
callq 0x7b5e
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq