// File: /workspace/github_c_makefile_star2_O0/gitluin[P]sara/src/sara.c
// Function: manipulate
void
manipulate(const Arg arg){
	int x, y, ocx, ocy, nx, ny, nw, nh;
	client* c;
	XEvent ev;
	int doresize = (arg.i == WantResize), trytoggle = 0;
	monitor* m = NULL;
	Time lasttime = 0;

	if ( !(c = curmon->current) || c->isfull )
		return;

	restack(curmon);

	if (XGrabPointer(dis, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
		None, cursor, CurrentTime) != GrabSuccess)
		return;

	if (!getptrcoords(&x, &y))
		return;

	if (doresize){
		if ( !(m = c->mon) )
			return;
		XWarpPointer(dis, None, c->win, 0, 0, 0, 0, c->w + 1, c->h + 1);
	}

	ocx = c->x;
	ocy = c->y;
	do {
		XMaskEvent(dis, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev);
		switch(ev.type){
		case ConfigureRequest:
		case Expose:
		case MapRequest:
			events[ev.type](&ev);
			break;
		case MotionNotify:
			if ((ev.xmotion.time - lasttime) <= (1000 / 60))
				continue;
			lasttime = ev.xmotion.time;

			/* Only adjust if moving */
			nx = doresize ? c->x : ocx + (ev.xmotion.x - x);
			ny = doresize ? c->y : ocy + (ev.xmotion.y - y);
			/* Only adjust if resizing */
			nw = doresize ? MAX(ev.xmotion.x - ocx + 1, 1) : c->w;
			nh = doresize ? MAX(ev.xmotion.y - ocy + 1, 1) : c->h;

			/* if c extends beyond the boundaries of its monitor, make it a float */
			if (doresize && (m->mx + nw >= curmon->mx
						&& m->mx + nw <= curmon->mx + curmon->mw
						&& m->wy + nh >= curmon->wy
						&& m->wy + nh <= curmon->wy + curmon->wh)){
				trytoggle = 1;

			} else {
				/* if c is within snappx of the monitor borders,
				 * then snap and make it a float
				 */
				nx = (abs(curmon->mx - nx) < snappx) ? curmon->mx : nx;
				nx = (abs((curmon->mx + curmon->mw) - (nx + c->w)) < snappx)
					? curmon->mx + curmon->mw - c->w : nx;
				ny = (abs(curmon->wy - ny) < snappx) ? curmon->wy : ny;
				ny = (abs((curmon->wy + curmon->wh) - (ny + c->h)) < snappx)
					? curmon->wy + curmon->wh - c->h : ny;
				trytoggle = 1;
			}
			/* don't toggle if floating layout, do resize if floating */
			if (!c->isfloat && trytoggle && !(curmon->curlayout->arrange == &floaty))
				togglefloat(dumbarg);
			if (c->isfloat || (curmon->curlayout->arrange == &floaty))
				resizeclient(c, nx, ny, nw, nh);
			XFlush(dis);
			break;
		}
	} while (ev.type != ButtonRelease);

	if (doresize)
		XWarpPointer(dis, None, c->win, 0, 0, 0, 0, c->w + 1, c->h + 1);
	XUngrabPointer(dis, CurrentTime);

	if (doresize)
		while (XCheckMaskEvent(dis, EnterWindowMask, &ev));

	if ( (m = coordstomon(c->x, c->y)) && m != curmon){
		sendmon(c, m);
		changemon(m, YesFocus);
		outputstats();
	}
#ifdef _SHAPE_H_
	roundcorners(c);
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
cmpl $0x1, -0x8(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0xf4(%rbp)
movl $0x0, -0xf8(%rbp)
movq $0x0, -0x100(%rbp)
movq $0x0, -0x108(%rbp)
movq 0x6c30(%rip), %rax      # 0xb528
movq 0x28(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x4910
movq -0x30(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x4915
jmp 0x4f09
movq 0x6c0c(%rip), %rdi      # 0xb528
callq 0x4150
movq 0x6bd8(%rip), %rdi      # 0xb500
movq 0x6cc1(%rip), %rsi      # 0xb5f0
movq 0x6cc2(%rip), %rax      # 0xb5f8
xorl %edx, %edx
movl $0x4c, %ecx
movl $0x1, %r9d
xorl %r8d, %r8d
movl %r9d, %r8d
movq $0x0, (%rsp)
movq %rax, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
callq 0x2180
cmpl $0x0, %eax
je 0x496e
jmp 0x4f09
leaq -0xc(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x4f20
cmpl $0x0, %eax
jne 0x4985
jmp 0x4f09
cmpl $0x0, -0xf4(%rbp)
je 0x49ef
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x100(%rbp)
cmpq $0x0, %rax
jne 0x49a8
jmp 0x4f09
movq 0x6b51(%rip), %rdi      # 0xb500
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rdx
movq -0x30(%rbp), %rax
movl 0x8(%rax), %r10d
addl $0x1, %r10d
movq -0x30(%rbp), %rax
movl 0xc(%rax), %eax
addl $0x1, %eax
xorl %ecx, %ecx
movl %ecx, %esi
xorl %r9d, %r9d
movl %r9d, %ecx
movl %r9d, %r8d
movl $0x0, (%rsp)
movl %r10d, 0x8(%rsp)
movl %eax, 0x10(%rsp)
callq 0x2360
movq -0x30(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x18(%rbp)
movq 0x6af7(%rip), %rdi      # 0xb500
movl $0x10804c, %esi         # imm = 0x10804C
leaq -0xf0(%rbp), %rdx
callq 0x2340
movl -0xf0(%rbp), %eax
addl $-0x6, %eax
movl %eax, %ecx
movq %rcx, -0x110(%rbp)
subl $0x11, %eax
ja 0x4e10
movq -0x110(%rbp), %rax
leaq 0x35e5(%rip), %rcx      # 0x8028
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movslq -0xf0(%rbp), %rcx
leaq -0xf0(%rbp), %rdi
leaq 0x682f(%rip), %rax      # 0xb290
callq *(%rax,%rcx,8)
jmp 0x4e10
movq -0xb8(%rbp), %rax
subq -0x108(%rbp), %rax
cmpq $0x10, %rax
ja 0x4a82
jmp 0x4e12
movq -0xb8(%rbp), %rax
movq %rax, -0x108(%rbp)
cmpl $0x0, -0xf4(%rbp)
je 0x4aa7
movq -0x30(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x114(%rbp)
jmp 0x4abb
movl -0x14(%rbp), %eax
movl -0xb0(%rbp), %ecx
subl -0xc(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x114(%rbp)
movl -0x114(%rbp), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0xf4(%rbp)
je 0x4adc
movq -0x30(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x118(%rbp)
jmp 0x4af0
movl -0x18(%rbp), %eax
movl -0xac(%rbp), %ecx
subl -0x10(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x118(%rbp)
movl -0x118(%rbp), %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0xf4(%rbp)
je 0x4b42
movl -0xb0(%rbp), %eax
subl -0x14(%rbp), %eax
addl $0x1, %eax
cmpl $0x1, %eax
jle 0x4b27
movl -0xb0(%rbp), %eax
subl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x11c(%rbp)
jmp 0x4b34
movl $0x1, %eax
movl %eax, -0x11c(%rbp)
jmp 0x4b34
movl -0x11c(%rbp), %eax
movl %eax, -0x120(%rbp)
jmp 0x4b4f
movq -0x30(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x120(%rbp)
movl -0x120(%rbp), %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0xf4(%rbp)
je 0x4ba1
movl -0xac(%rbp), %eax
subl -0x18(%rbp), %eax
addl $0x1, %eax
cmpl $0x1, %eax
jle 0x4b86
movl -0xac(%rbp), %eax
subl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x124(%rbp)
jmp 0x4b93
movl $0x1, %eax
movl %eax, -0x124(%rbp)
jmp 0x4b93
movl -0x124(%rbp), %eax
movl %eax, -0x128(%rbp)
jmp 0x4bae
movq -0x30(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x128(%rbp)
movl -0x128(%rbp), %eax
movl %eax, -0x28(%rbp)
cmpl $0x0, -0xf4(%rbp)
je 0x4c4f
movq -0x100(%rbp), %rax
movl 0x8(%rax), %eax
addl -0x24(%rbp), %eax
movq 0x6950(%rip), %rcx      # 0xb528
cmpl 0x8(%rcx), %eax
jl 0x4c4f
movq -0x100(%rbp), %rax
movl 0x8(%rax), %eax
addl -0x24(%rbp), %eax
movq 0x6937(%rip), %rcx      # 0xb528
movl 0x8(%rcx), %ecx
movq 0x692d(%rip), %rdx      # 0xb528
addl 0x14(%rdx), %ecx
cmpl %ecx, %eax
jg 0x4c4f
movq -0x100(%rbp), %rax
movl 0x18(%rax), %eax
addl -0x28(%rbp), %eax
movq 0x6912(%rip), %rcx      # 0xb528
cmpl 0x18(%rcx), %eax
jl 0x4c4f
movq -0x100(%rbp), %rax
movl 0x18(%rax), %eax
addl -0x28(%rbp), %eax
movq 0x68f9(%rip), %rcx      # 0xb528
movl 0x18(%rcx), %ecx
movq 0x68ef(%rip), %rdx      # 0xb528
addl 0x1c(%rdx), %ecx
cmpl %ecx, %eax
jg 0x4c4f
movl $0x1, -0xf8(%rbp)
jmp 0x4d95
movq 0x68d2(%rip), %rax      # 0xb528
movl 0x8(%rax), %eax
subl -0x1c(%rbp), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
cmpl $0x20, %eax
jae 0x4c7a
movq 0x68b9(%rip), %rax      # 0xb528
movl 0x8(%rax), %eax
movl %eax, -0x12c(%rbp)
jmp 0x4c83
movl -0x1c(%rbp), %eax
movl %eax, -0x12c(%rbp)
movl -0x12c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq 0x6895(%rip), %rax      # 0xb528
movl 0x8(%rax), %eax
movq 0x688b(%rip), %rcx      # 0xb528
addl 0x14(%rcx), %eax
movl -0x1c(%rbp), %ecx
movq -0x30(%rbp), %rdx
addl 0x8(%rdx), %ecx
subl %ecx, %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
cmpl $0x20, %eax
jae 0x4cdb
movq 0x6869(%rip), %rax      # 0xb528
movl 0x8(%rax), %eax
movq 0x685f(%rip), %rcx      # 0xb528
addl 0x14(%rcx), %eax
movq -0x30(%rbp), %rcx
subl 0x8(%rcx), %eax
movl %eax, -0x130(%rbp)
jmp 0x4ce4
movl -0x1c(%rbp), %eax
movl %eax, -0x130(%rbp)
movl -0x130(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq 0x6834(%rip), %rax      # 0xb528
movl 0x18(%rax), %eax
subl -0x20(%rbp), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
cmpl $0x20, %eax
jae 0x4d18
movq 0x681b(%rip), %rax      # 0xb528
movl 0x18(%rax), %eax
movl %eax, -0x134(%rbp)
jmp 0x4d21
movl -0x20(%rbp), %eax
movl %eax, -0x134(%rbp)
movl -0x134(%rbp), %eax
movl %eax, -0x20(%rbp)
movq 0x67f7(%rip), %rax      # 0xb528
movl 0x18(%rax), %eax
movq 0x67ed(%rip), %rcx      # 0xb528
addl 0x1c(%rcx), %eax
movl -0x20(%rbp), %ecx
movq -0x30(%rbp), %rdx
addl 0xc(%rdx), %ecx
subl %ecx, %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
cmpl $0x20, %eax
jae 0x4d79
movq 0x67cb(%rip), %rax      # 0xb528
movl 0x18(%rax), %eax
movq 0x67c1(%rip), %rcx      # 0xb528
addl 0x1c(%rcx), %eax
movq -0x30(%rbp), %rcx
subl 0xc(%rcx), %eax
movl %eax, -0x138(%rbp)
jmp 0x4d82
movl -0x20(%rbp), %eax
movl %eax, -0x138(%rbp)
movl -0x138(%rbp), %eax
movl %eax, -0x20(%rbp)
movl $0x1, -0xf8(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x4dcc
cmpl $0x0, -0xf8(%rbp)
je 0x4dcc
movq 0x6779(%rip), %rax      # 0xb528
movq 0x40(%rax), %rax
leaq 0x1b6(%rip), %rcx       # 0x4f70
cmpq %rcx, 0x8(%rax)
je 0x4dcc
movq 0x32a9(%rip), %rdi      # 0x8070
callq 0x35e0
movq -0x30(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x4dee
movq 0x674b(%rip), %rax      # 0xb528
movq 0x40(%rax), %rax
leaq 0x188(%rip), %rcx       # 0x4f70
cmpq %rcx, 0x8(%rax)
jne 0x4e04
movq -0x30(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
movl -0x24(%rbp), %ecx
movl -0x28(%rbp), %r8d
callq 0x4260
movq 0x66f5(%rip), %rdi      # 0xb500
callq 0x2320
jmp 0x4e12
cmpl $0x5, -0xf0(%rbp)
jne 0x4a02
cmpl $0x0, -0xf4(%rbp)
je 0x4e6f
movq 0x66d1(%rip), %rdi      # 0xb500
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rdx
movq -0x30(%rbp), %rax
movl 0x8(%rax), %r10d
addl $0x1, %r10d
movq -0x30(%rbp), %rax
movl 0xc(%rax), %eax
addl $0x1, %eax
xorl %ecx, %ecx
movl %ecx, %esi
xorl %r9d, %r9d
movl %r9d, %ecx
movl %r9d, %r8d
movl $0x0, (%rsp)
movl %r10d, 0x8(%rsp)
movl %eax, 0x10(%rsp)
callq 0x2360
movq 0x668a(%rip), %rdi      # 0xb500
xorl %eax, %eax
movl %eax, %esi
callq 0x2110
cmpl $0x0, -0xf4(%rbp)
je 0x4eab
jmp 0x4e8a
movq 0x666f(%rip), %rdi      # 0xb500
movl $0x10, %esi
leaq -0xf0(%rbp), %rdx
callq 0x22c0
cmpl $0x0, %eax
je 0x4ea9
jmp 0x4e8a
jmp 0x4eab
movq -0x30(%rbp), %rax
movl (%rax), %edi
movq -0x30(%rbp), %rax
movl 0x4(%rax), %esi
callq 0x5010
movq %rax, -0x100(%rbp)
cmpq $0x0, %rax
je 0x4f00
movq -0x100(%rbp), %rax
cmpq 0x6650(%rip), %rax      # 0xb528
je 0x4f00
movq -0x30(%rbp), %rdi
movq -0x100(%rbp), %rsi
callq 0x50c0
movq -0x100(%rbp), %rdi
movl $0x1, %esi
callq 0x51e0
callq 0x5530
movq -0x30(%rbp), %rdi
callq 0x42f0
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw %cs:(%rax,%rax)