// File: /workspace/github_c_makefile_star2_O3/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 0xba02
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 0x7072
movq %rbx, %rdi
callq 0x7104
movq 0x38(%rbx), %rdi
leaq 0xb025(%rip), %rax      # 0x16870
movq (%rax), %rdx
movl $0x4c, %esi
callq 0x8724
testl %eax, %eax
js 0xb9f1
movq %r14, 0x20(%rsp)
movq 0x38(%rbx), %rdi
movl 0x5c(%rbx), %esi
movl 0x60(%rbx), %edx
callq 0x8897
movq %rbx, %rdi
callq 0xba03
movq $0x0, 0x10(%rsp)
leaq 0xafbc(%rip), %rbp      # 0x16848
leaq 0x28(%rsp), %r12
movq (%rbp), %rdi
movl $0x804c, %esi           # imm = 0x804C
movq %r12, %rdx
callq 0x55c0
movl 0x28(%rsp), %eax
cmpl $0x6, %eax
je 0xb8c4
cmpl $0xc, %eax
je 0xb8ba
cmpl $0x5, %eax
jne 0xb891
jmp 0xb97f
movq %rbx, %rdi
callq 0x6936
jmp 0xb891
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 0x728c
movl %r12d, %eax
cmpl %r15d, %r12d
jle 0xb91d
movl 0xc(%rsp), %eax
subl 0x5c(%rbx), %eax
movl %eax, 0x54(%rbx)
movl 0x8(%rsp), %ecx
movl %ecx, %eax
cmpl %r14d, %ecx
jle 0xb932
movl 0x8(%rsp), %eax
subl 0x60(%rbx), %eax
movl %eax, 0x58(%rbx)
cmpl 0x5c(%rbx), %r13d
leaq 0x28(%rsp), %r12
jne 0xb949
movl 0x1c(%rsp), %eax
cmpl 0x60(%rbx), %eax
je 0xb951
movq %rbx, %rdi
callq 0xba03
movq 0x60(%rsp), %r14
movq %r14, %rax
subq 0x10(%rsp), %rax
cmpq $0x11, %rax
jb 0xb891
movq %rbx, %rdi
movl $0x1, %esi
callq 0x6e4d
movq %r14, 0x10(%rsp)
jmp 0xb891
cmpq $0x0, 0x10(%rsp)
je 0xb994
movq %rbx, %rdi
movl $0x1, %esi
callq 0x6e4d
movq (%rbp), %rdi
movq 0x20(%rsp), %r14
movq 0x20(%r14), %rsi
callq 0x53c0
movq (%rbp), %rdi
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x57f0
callq 0x8780
movl 0x5c(%rbx), %eax
cmpl %eax, 0x9c(%rbx)
jle 0xb9d5
subl 0x50(%rbx), %eax
movl %eax, 0x9c(%rbx)
movl 0x60(%rbx), %eax
cmpl %eax, 0xa0(%rbx)
jle 0xb9e9
subl 0x50(%rbx), %eax
movl %eax, 0xa0(%rbx)
movq %rbx, %rdi
callq 0x7088
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq