// File: /workspace/github_c_makefile_star2_O2/kek[P]evilwm/events.c
// Function: do_window_changes
static void do_window_changes(int value_mask, XWindowChanges *wc, Client *c,
		int gravity) {
	if (gravity == 0)
		gravity = c->win_gravity_hint;
	c->win_gravity = gravity;
	if (value_mask & CWX) c->x = wc->x;
	if (value_mask & CWY) c->y = wc->y;
	if (value_mask & (CWWidth|CWHeight)) {
		int dw = 0, dh = 0;
		if (!(value_mask & (CWX|CWY))) {
			gravitate_border(c, -c->border);
		}
		if (value_mask & CWWidth) {
			int neww = wc->width;
			if (neww < c->min_width)
				neww = c->min_width;
			if (c->max_width && neww > c->max_width)
				neww = c->max_width;
			dw = neww - c->width;
			c->width = neww;
		}
		if (value_mask & CWHeight) {
			int newh = wc->height;
			if (newh < c->min_height)
				newh = c->min_height;
			if (c->max_height && newh > c->max_height)
				newh = c->max_height;
			dh = newh - c->height;
			c->height = newh;
		}
		/* only apply position fixes if not being explicitly moved */
		if (!(value_mask & (CWX|CWY))) {
			switch (gravity) {
			default:
			case NorthWestGravity:
				break;
			case NorthGravity:
				c->x -= (dw / 2);
				break;
			case NorthEastGravity:
				c->x -= dw;
				break;
			case WestGravity:
				c->y -= (dh / 2);
				break;
			case CenterGravity:
				c->x -= (dw / 2);
				c->y -= (dh / 2);
				break;
			case EastGravity:
				c->x -= dw;
				c->y -= (dh / 2);
				break;
			case SouthWestGravity:
				c->y -= dh;
				break;
			case SouthGravity:
				c->x -= (dw / 2);
				c->y -= dh;
				break;
			case SouthEastGravity:
				c->x -= dw;
				c->y -= dh;
				break;
			}
			value_mask |= CWX|CWY;
			gravitate_border(c, c->border);
		}
	}
	wc->x = c->x - c->border;
	wc->y = c->y - c->border;
	wc->border_width = c->border;
	XConfigureWindow(dpy, c->parent, value_mask, wc);
	XMoveResizeWindow(dpy, c->window, 0, 0, c->width, c->height);
	if ((value_mask & (CWX|CWY)) && !(value_mask & (CWWidth|CWHeight))) {
		send_config(c);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %r15d
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
testl %ecx, %ecx
jne 0x4998
movl 0x68(%rbx), %r15d
movl %r15d, 0x6c(%rbx)
testb $0x1, %bpl
je 0x49a8
movl (%r14), %eax
movl %eax, 0x24(%rbx)
testb $0x2, %bpl
je 0x49b5
movl 0x4(%r14), %eax
movl %eax, 0x28(%rbx)
testb $0xc, %bpl
je 0x4a95
testb $0x3, %bpl
jne 0x49d2
xorl %esi, %esi
subl 0x34(%rbx), %esi
movq %rbx, %rdi
callq 0x3a3e
xorl %ecx, %ecx
movl $0x0, %eax
testb $0x4, %bpl
je 0x4a02
movl 0x8(%r14), %eax
movl 0x48(%rbx), %edx
movl 0x50(%rbx), %esi
cmpl %edx, %eax
cmovgl %eax, %edx
cmpl %esi, %edx
movl %esi, %edi
cmovll %edx, %edi
testl %esi, %esi
cmovel %edx, %edi
movl %edi, %eax
subl 0x2c(%rbx), %eax
movl %edi, 0x2c(%rbx)
testb $0x8, %bpl
je 0x4a2b
movl 0xc(%r14), %ecx
movl 0x4c(%rbx), %edx
movl 0x54(%rbx), %esi
cmpl %edx, %ecx
cmovgl %ecx, %edx
cmpl %esi, %edx
movl %esi, %edi
cmovll %edx, %edi
testl %esi, %esi
cmovel %edx, %edi
movl %edi, %ecx
subl 0x30(%rbx), %ecx
movl %edi, 0x30(%rbx)
testb $0x3, %bpl
jne 0x4a95
addl $-0x2, %r15d
cmpl $0x7, %r15d
ja 0x4a87
leaq 0x4686(%rip), %rdx      # 0x90c8
movslq (%rdx,%r15,4), %rsi
addq %rdx, %rsi
jmpq *%rsi
pushq $-0x2
popq %rcx
cltd
idivl %ecx
addl %eax, 0x24(%rbx)
jmp 0x4a87
subl %eax, 0x24(%rbx)
pushq $-0x2
popq %rsi
jmp 0x4a67
pushq $-0x2
popq %rsi
cltd
idivl %esi
addl %eax, 0x24(%rbx)
movl %ecx, %eax
cltd
idivl %esi
addl %eax, 0x28(%rbx)
jmp 0x4a87
subl %eax, 0x24(%rbx)
jmp 0x4a84
subl %eax, 0x24(%rbx)
jmp 0x4a87
pushq $-0x2
popq %rsi
cltd
idivl %esi
addl %eax, 0x24(%rbx)
subl %ecx, 0x28(%rbx)
orl $0x3, %ebp
movl 0x34(%rbx), %esi
movq %rbx, %rdi
callq 0x3a3e
movl 0x34(%rbx), %eax
movq 0x24(%rbx), %xmm0
movd %eax, %xmm1
pshufd $0x50, %xmm1, %xmm1     # xmm1 = xmm1[0,0,1,1]
psubd %xmm1, %xmm0
movq %xmm0, (%r14)
movl %eax, 0x10(%r14)
leaq 0x8d26(%rip), %r15      # 0xd7e0
movq (%r15), %rdi
movq 0x8(%rbx), %rsi
movl %ebp, %edx
movq %r14, %rcx
callq 0x3040
movq (%r15), %rdi
movq (%rbx), %rsi
movl 0x2c(%rbx), %r8d
movl 0x30(%rbx), %r9d
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3250
testb $0x3, %bpl
sete %al
testb $0xc, %bpl
setne %cl
orb %al, %cl
jne 0x4b06
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x39f2
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)