// File: /workspace/github_c_makefile_star2_O2/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 0xb50d
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 0x6e94
movq %rbx, %rdi
callq 0x6f15
movq 0x38(%rbx), %rdi
leaq 0xb515(%rip), %rax      # 0x16870
movq (%rax), %rdx
pushq $0x4c
popq %rsi
callq 0x847c
testl %eax, %eax
js 0xb4fc
movq %r14, 0x20(%rsp)
movq 0x38(%rbx), %rdi
movl 0x5c(%rbx), %esi
movl 0x60(%rbx), %edx
callq 0x85f5
movq %rbx, %rdi
callq 0xb50e
movq $0x0, 0x10(%rsp)
leaq 0xb4ae(%rip), %r15      # 0x16848
leaq 0x28(%rsp), %r12
movl 0xc(%rsp), %r13d
movq (%r15), %rdi
movl $0x804c, %esi           # imm = 0x804C
movq %r12, %rdx
callq 0x55c0
movl 0x28(%rsp), %eax
cmpl $0x6, %eax
je 0xb3d6
cmpl $0xc, %eax
je 0xb3cc
cmpl $0x5, %eax
jne 0xb3a4
jmp 0xb48e
movq %rbx, %rdi
callq 0x67a1
jmp 0xb3a4
movq %r15, %r12
movl 0x74(%rsp), %r14d
movl 0x50(%rbx), %eax
movl 0x5c(%rbx), %ebp
movl 0x60(%rbx), %ecx
movl %ecx, 0x1c(%rsp)
movl 0x70(%rsp), %r15d
movl %r13d, %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 0x70b3
movl %r13d, %eax
cmpl %r15d, %r13d
jle 0xb42c
movl 0xc(%rsp), %eax
subl 0x5c(%rbx), %eax
movl %eax, 0x54(%rbx)
movl 0x8(%rsp), %ecx
movl %ecx, %eax
cmpl %r14d, %ecx
jle 0xb441
movl 0x8(%rsp), %eax
subl 0x60(%rbx), %eax
movl %eax, 0x58(%rbx)
cmpl 0x5c(%rbx), %ebp
movq %r12, %r15
jne 0xb455
movl 0x1c(%rsp), %eax
cmpl 0x60(%rbx), %eax
je 0xb45d
movq %rbx, %rdi
callq 0xb50e
movq 0x60(%rsp), %r14
movq %r14, %rax
subq 0x10(%rsp), %rax
cmpq $0x11, %rax
leaq 0x28(%rsp), %r12
jb 0xb3a4
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0x6c74
movq %r14, 0x10(%rsp)
jmp 0xb3a4
cmpq $0x0, 0x10(%rsp)
je 0xb4a1
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x6c74
movq (%r15), %rdi
movq 0x20(%rsp), %r14
movq 0x20(%r14), %rsi
callq 0x53c0
movq (%r15), %rdi
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x57f0
callq 0x84dd
movl 0x5c(%rbx), %eax
cmpl %eax, 0x9c(%rbx)
jle 0xb4e0
subl 0x50(%rbx), %eax
movl %eax, 0x9c(%rbx)
movl 0x60(%rbx), %eax
cmpl %eax, 0xa0(%rbx)
jle 0xb4f4
subl 0x50(%rbx), %eax
movl %eax, 0xa0(%rbx)
movq %rbx, %rdi
callq 0x6eaa
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq