// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0xd8(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0xe0(%rbp)
movq -0x8(%rbp), %rax
movl 0x54(%rax), %eax
movl %eax, -0xe4(%rbp)
movq -0x8(%rbp), %rax
movl 0x58(%rax), %eax
movl %eax, -0xe8(%rbp)
movq -0x8(%rbp), %rax
movl 0xa8(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0xfdde
jmp 0xffc5
movq -0x8(%rbp), %rdi
callq 0x81a0
movq -0x8(%rbp), %rdi
callq 0x8260
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
leaq 0xc9d1(%rip), %rax      # 0x1c7d0
movq (%rax), %rdx
movl $0x4c, %esi
callq 0xaa30
cmpl $0x0, %eax
jge 0xfe16
jmp 0xffc5
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x5c(%rax), %esi
movq -0x8(%rbp), %rax
movl 0x60(%rax), %edx
callq 0xac50
movq -0x8(%rbp), %rdi
callq 0xffd0
leaq 0xc967(%rip), %rax      # 0x1c7a8
movq (%rax), %rdi
movl $0x804c, %esi           # imm = 0x804C
leaq -0xd0(%rbp), %rdx
callq 0x55c0
movl -0xd0(%rbp), %eax
movl %eax, -0xec(%rbp)
subl $0x5, %eax
je 0xfefd
jmp 0xfe6c
movl -0xec(%rbp), %eax
subl $0x6, %eax
je 0xfe98
jmp 0xfe79
movl -0xec(%rbp), %eax
subl $0xc, %eax
jne 0xffc0
jmp 0xfe8a
movq -0x8(%rbp), %rdi
callq 0x7210
jmp 0xffc0
movq -0x8(%rbp), %rdi
movl -0xe4(%rbp), %esi
movl -0xe8(%rbp), %edx
movl -0x88(%rbp), %ecx
movl -0x84(%rbp), %r8d
callq 0x10270
cmpl $0x0, %eax
je 0xfec8
movq -0x8(%rbp), %rdi
callq 0xffd0
movq -0x98(%rbp), %rax
subq -0xd8(%rbp), %rax
cmpq $0x10, %rax
jbe 0xfef8
movq -0x98(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x7d20
jmp 0xffc0
cmpq $0x0, -0xd8(%rbp)
je 0xff15
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x7d20
leaq 0xc88c(%rip), %rax      # 0x1c7a8
movq (%rax), %rdi
movq -0xe0(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x53c0
leaq 0xc872(%rip), %rax      # 0x1c7a8
movq (%rax), %rdi
movq -0xe0(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0xe0(%rbp), %rax
movq 0x18(%rax), %rdx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x57f0
callq 0xaae0
movq -0x8(%rbp), %rax
movl 0x9c(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x5c(%rcx), %eax
jle 0xff8a
movq -0x8(%rbp), %rax
movl 0x5c(%rax), %ecx
movq -0x8(%rbp), %rax
subl 0x50(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x9c(%rax)
movq -0x8(%rbp), %rax
movl 0xa0(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x60(%rcx), %eax
jle 0xffb5
movq -0x8(%rbp), %rax
movl 0x60(%rax), %ecx
movq -0x8(%rbp), %rax
subl 0x50(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xa0(%rax)
movq -0x8(%rbp), %rdi
callq 0x81d0
jmp 0xffc5
jmp 0xfe3a
addq $0xf0, %rsp
popq %rbp
retq
nop