// File: /workspace/github_c_makefile_star2_O3/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 $0xc8, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x98ff(%rip), %r15      # 0xf728
movq 0x10(%rdi), %rax
movq 0x10(%rax), %rsi
movq (%r15), %rdi
subq $0x8, %rsp
xorl %eax, %eax
xorl %edx, %edx
movl $0x4c, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
pushq %rax
pushq 0x170(%r15)
pushq %rax
callq 0x4220
addq $0x20, %rsp
testl %eax, %eax
jne 0x6036
movq %rbx, %rdi
callq 0x5611
movl 0x28(%rbx), %r13d
movl 0x2c(%rbx), %r12d
movq (%r15), %rdi
callq 0x4110
movq %rbx, %rdi
callq 0x6048
movq (%r15), %rdi
movq (%rbx), %rdx
movl 0x30(%rbx), %eax
movl 0x34(%rbx), %r10d
subq $0x8, %rsp
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %r10
pushq %rax
pushq $0x0
callq 0x4530
addq $0x20, %rsp
leaq 0x8(%rsp), %r14
movq (%r15), %rdi
movl $0x4c, %esi
movq %r14, %rdx
callq 0x4510
movl 0x8(%rsp), %eax
cmpl $0x5, %eax
je 0x5f7a
cmpl $0x6, %eax
jne 0x5eb5
movq 0x30(%rsp), %rax
movq 0x10(%rbx), %rcx
cmpq 0x10(%rcx), %rax
jne 0x5eb5
movq %rbx, %rdi
callq 0x6048
movq (%r15), %rdi
callq 0x43a0
movl 0x48(%rsp), %edi
movl 0x4c(%rsp), %ecx
leaq 0x94db(%rip), %rax      # 0xf3e0
movl 0x28(%rax), %esi
andl 0x58(%rsp), %esi
movl $0x0, %r10d
je 0x5f86
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 0x5f40
movl %edx, %eax
movl 0x74(%rbx), %r9d
testl %edx, %edx
cmovel %r8d, %eax
movl %eax, %edx
cmpl %r9d, %eax
jl 0x5f54
movl %r9d, %edx
testl %r9d, %r9d
cmovel %eax, %edx
cmpl %edi, %r13d
movl $0x0, %eax
cmovgl %edx, %eax
movl %r13d, %edi
subl %eax, %edi
movl %r10d, 0x48(%rbx)
movl %edx, 0x30(%rbx)
movl %edi, 0x28(%rbx)
testl %esi, %esi
jne 0x5f92
jmp 0x5f8c
cmpl %ebp, 0x5c(%rsp)
jne 0x5eb5
jmp 0x6004
cmpl $0x0, 0x48(%rbx)
je 0x5f14
cmpl $0x0, 0x4c(%rbx)
jne 0x5fe5
movl %r12d, %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 0x5fba
movl %edx, %eax
movl 0x78(%rbx), %edi
testl %edx, %edx
cmovel %esi, %eax
movl %eax, %edx
cmpl %edi, %eax
jl 0x5fca
movl %edi, %edx
testl %edi, %edi
cmovel %eax, %edx
cmpl %ecx, %r12d
movl %r10d, 0x4c(%rbx)
movl %edx, 0x34(%rbx)
cmovlel %r10d, %edx
movl %r12d, %eax
subl %edx, %eax
movl %eax, 0x2c(%rbx)
movq (%r15), %rdi
xorl %esi, %esi
callq 0x4500
movq (%r15), %rdi
callq 0x4110
movq %rbx, %rdi
callq 0x6048
jmp 0x5eb5
movq %rbx, %rdi
callq 0x6048
movq (%r15), %rdi
callq 0x43a0
movq (%r15), %rdi
xorl %esi, %esi
callq 0x41b0
movq %rbx, %rdi
callq 0x5611
movq %rbx, %rdi
callq 0x67ab
movq %rbx, %rdi
callq 0x7f2c
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq