// File: /workspace/github_c_makefile_star2_O1/zenlinux[P]cwm/mousefunc.c
// Function: mousefunc_window_resize
void
mousefunc_window_resize(struct client_ctx *cc, void *arg)
{
	XEvent			 ev;
	Time			 ltime = 0;
	struct screen_ctx	*sc = cc->sc;
	int			 x = cc->geom.x, y = cc->geom.y;

	if (cc->flags & CLIENT_FREEZE)
		return;

	client_raise(cc);
	client_ptrsave(cc);

	if (xu_ptr_grab(cc->win, MOUSEMASK, Cursor_resize) < 0)
		return;

	xu_ptr_setpos(cc->win, cc->geom.w, cc->geom.h);
	mousefunc_sweep_draw(cc);

	for (;;) {
		XMaskEvent(X_Dpy, MOUSEMASK|ExposureMask, &ev);

		switch (ev.type) {
		case Expose:
			client_draw_border(cc);
			break;
		case MotionNotify:
			if (mousefunc_sweep_calc(cc, x, y,
			    ev.xmotion.x_root, ev.xmotion.y_root))
				/* Recompute window output */
				mousefunc_sweep_draw(cc);

			/* don't resize more than 60 times / second */
			if ((ev.xmotion.time - ltime) > (1000 / 60)) {
				ltime = ev.xmotion.time;
				client_resize(cc, 1);
			}
			break;
		case ButtonRelease:
			if (ltime)
				client_resize(cc, 1);
			XUnmapWindow(X_Dpy, sc->menuwin);
			XReparentWindow(X_Dpy, sc->menuwin, sc->rootwin, 0, 0);
			xu_ptr_ungrab();

			/* Make sure the pointer stays within the window. */
			if (cc->ptr.x > cc->geom.w)
				cc->ptr.x = cc->geom.w - cc->bwidth;
			if (cc->ptr.y > cc->geom.h)
				cc->ptr.y = cc->geom.h - cc->bwidth;
			client_ptrwarp(cc);
			return;
		}
	}
	/* NOTREACHED */
}

// Assembly:
testb $0x10, 0xa8(%rdi)
jne 0xbbde
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdi, %rbx
movq 0x30(%rdi), %r14
movl 0x54(%rdi), %eax
movl %eax, 0xc(%rsp)
movl 0x58(%rdi), %eax
movl %eax, 0x8(%rsp)
callq 0x70cf
movq %rbx, %rdi
callq 0x7161
movq 0x38(%rbx), %rdi
leaq 0xae59(%rip), %rax      # 0x16880
movq (%rax), %rdx
movl $0x4c, %esi
callq 0x88b4
testl %eax, %eax
js 0xbbcd
movq %r14, 0x20(%rsp)
movq 0x38(%rbx), %rdi
movl 0x5c(%rbx), %esi
movl 0x60(%rbx), %edx
callq 0x8a27
movq %rbx, %rdi
callq 0xbbdf
movq $0x0, 0x10(%rsp)
leaq 0xadf0(%rip), %rbp      # 0x16858
leaq 0x28(%rsp), %r12
movq (%rbp), %rdi
movl $0x804c, %esi           # imm = 0x804C
movq %r12, %rdx
callq 0x55d0
movl 0x28(%rsp), %eax
cmpl $0x6, %eax
je 0xbaa0
cmpl $0xc, %eax
je 0xba96
cmpl $0x5, %eax
jne 0xba6d
jmp 0xbb5b
movq %rbx, %rdi
callq 0x6983
jmp 0xba6d
movl 0x74(%rsp), %r14d
movl 0x50(%rbx), %eax
movl 0x5c(%rbx), %r13d
movl 0x60(%rbx), %ecx
movl %ecx, 0x1c(%rsp)
movl 0x70(%rsp), %r15d
movl 0xc(%rsp), %r12d
movl %r12d, %ecx
subl %r15d, %ecx
movl %ecx, %edx
negl %edx
cmovsl %ecx, %edx
subl %eax, %edx
movl %edx, 0x5c(%rbx)
movl 0x8(%rsp), %ecx
subl %r14d, %ecx
movl %ecx, %edx
negl %edx
cmovsl %ecx, %edx
subl %eax, %edx
movl %edx, 0x60(%rbx)
movq %rbx, %rdi
callq 0x7301
movl %r12d, %eax
cmpl %r15d, %r12d
jle 0xbaf9
movl 0xc(%rsp), %eax
subl 0x5c(%rbx), %eax
movl %eax, 0x54(%rbx)
movl 0x8(%rsp), %ecx
movl %ecx, %eax
cmpl %r14d, %ecx
jle 0xbb0e
movl 0x8(%rsp), %eax
subl 0x60(%rbx), %eax
movl %eax, 0x58(%rbx)
cmpl 0x5c(%rbx), %r13d
leaq 0x28(%rsp), %r12
jne 0xbb25
movl 0x1c(%rsp), %eax
cmpl 0x60(%rbx), %eax
je 0xbb2d
movq %rbx, %rdi
callq 0xbbdf
movq 0x60(%rsp), %r14
movq %r14, %rax
subq 0x10(%rsp), %rax
cmpq $0x11, %rax
jb 0xba6d
movq %rbx, %rdi
movl $0x1, %esi
callq 0x6eb4
movq %r14, 0x10(%rsp)
jmp 0xba6d
cmpq $0x0, 0x10(%rsp)
je 0xbb70
movq %rbx, %rdi
movl $0x1, %esi
callq 0x6eb4
movq (%rbp), %rdi
movq 0x20(%rsp), %r14
movq 0x20(%r14), %rsi
callq 0x53d0
movq (%rbp), %rdi
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x5800
callq 0x8910
movl 0x5c(%rbx), %eax
cmpl %eax, 0x9c(%rbx)
jle 0xbbb1
subl 0x50(%rbx), %eax
movl %eax, 0x9c(%rbx)
movl 0x60(%rbx), %eax
cmpl %eax, 0xa0(%rbx)
jle 0xbbc5
subl 0x50(%rbx), %eax
movl %eax, 0xa0(%rbx)
movq %rbx, %rdi
callq 0x70e5
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq