// File: /workspace/github_c_makefile_star2_O3/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 0x4c41
movl 0x68(%rbx), %r15d
movl %r15d, 0x6c(%rbx)
testb $0x1, %bpl
je 0x4c51
movl (%r14), %eax
movl %eax, 0x24(%rbx)
testb $0x2, %bpl
je 0x4c5e
movl 0x4(%r14), %eax
movl %eax, 0x28(%rbx)
testb $0xc, %bpl
je 0x4d48
testb $0x3, %bpl
jne 0x4c7b
xorl %esi, %esi
subl 0x34(%rbx), %esi
movq %rbx, %rdi
callq 0x3bfb
xorl %eax, %eax
movl $0x0, %ecx
testb $0x4, %bpl
je 0x4cab
movl 0x8(%r14), %ecx
movl 0x48(%rbx), %edx
movl 0x50(%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 0x2c(%rbx), %ecx
movl %edi, 0x2c(%rbx)
testb $0x8, %bpl
je 0x4cd4
movl 0xc(%r14), %eax
movl 0x4c(%rbx), %edx
movl 0x54(%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 0x30(%rbx), %eax
movl %edi, 0x30(%rbx)
testb $0x3, %bpl
jne 0x4d48
addl $-0x2, %r15d
cmpl $0x7, %r15d
ja 0x4d3a
leaq 0x43dd(%rip), %rdx      # 0x90c8
movslq (%rdx,%r15,4), %rsi
addq %rdx, %rsi
jmpq *%rsi
movl %ecx, %eax
shrl $0x1f, %eax
addl %ecx, %eax
sarl %eax
subl %eax, 0x24(%rbx)
jmp 0x4d3a
subl %ecx, 0x24(%rbx)
jmp 0x4d13
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
subl %edx, 0x24(%rbx)
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
subl %ecx, 0x28(%rbx)
jmp 0x4d3a
subl %ecx, 0x24(%rbx)
jmp 0x4d37
subl %ecx, 0x24(%rbx)
jmp 0x4d3a
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
subl %edx, 0x24(%rbx)
subl %eax, 0x28(%rbx)
orl $0x3, %ebp
movl 0x34(%rbx), %esi
movq %rbx, %rdi
callq 0x3bfb
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 0x7a73(%rip), %r15      # 0xc7e0
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 0x4db9
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3bac
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq