// File: /workspace/github_c_makefile_star2_O1/mati75[P]evilwm/events.c
// Function: do_window_changes
static void do_window_changes(int value_mask, XWindowChanges *wc, struct client *c,
		int gravity) {
	LOG_XENTER("do_window_changes(window=%lx), was: %dx%d+%d+%d", (unsigned long)c->window, c->width, c->height, c->x, c->y);
	if (gravity == 0)
		gravity = c->win_gravity_hint;
	c->win_gravity = gravity;
	if (value_mask & CWX) {
		c->x = wc->x;
		LOG_XDEBUG("CWX      x=%d\n", wc->x);
	}
	if (value_mask & CWY) {
		c->y = wc->y;
		LOG_XDEBUG("CWY      y=%d\n", wc->y);
	}
	if (value_mask & (CWWidth|CWHeight)) {
		int dw = 0, dh = 0;
		if (!(value_mask & (CWX|CWY))) {
			client_gravitate(c, -c->border);
		}
		if (value_mask & CWWidth) {
			LOG_XDEBUG("CWWidth  width=%d\n", wc->width);
			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) {
			LOG_XDEBUG("CWHeight height=%d\n", wc->height);
			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;
			client_gravitate(c, c->border);
		}
	}

	wc->x = c->x - c->border;
	wc->y = c->y - c->border;
	wc->border_width = c->border;
	XConfigureWindow(display.dpy, c->parent, value_mask, wc);
	XMoveResizeWindow(display.dpy, c->window, 0, 0, c->width, c->height);
	if ((value_mask & (CWX|CWY)) && !(value_mask & (CWWidth|CWHeight))) {
		send_config(c);
	}
	LOG_XLEAVE();
}

// 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 0x7c3d
movl 0x8c(%rbx), %r15d
movl %r15d, 0x90(%rbx)
testb $0x1, %bpl
je 0x7c50
movl (%r14), %eax
movl %eax, 0x28(%rbx)
testb $0x2, %bpl
je 0x7c5d
movl 0x4(%r14), %eax
movl %eax, 0x2c(%rbx)
testb $0xc, %bpl
je 0x7d47
testb $0x3, %bpl
jne 0x7c7a
xorl %esi, %esi
subl 0x3c(%rbx), %esi
movq %rbx, %rdi
callq 0x57c7
xorl %eax, %eax
movl $0x0, %ecx
testb $0x4, %bpl
je 0x7caa
movl 0x8(%r14), %ecx
movl 0x6c(%rbx), %edx
movl 0x74(%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 $0x8, %bpl
je 0x7cd3
movl 0xc(%r14), %eax
movl 0x70(%rbx), %edx
movl 0x78(%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 0x34(%rbx), %eax
movl %edi, 0x34(%rbx)
testb $0x3, %bpl
jne 0x7d47
addl $-0x2, %r15d
cmpl $0x7, %r15d
ja 0x7d39
leaq 0x3c66(%rip), %rdx      # 0xb950
movslq (%rdx,%r15,4), %rsi
addq %rdx, %rsi
jmpq *%rsi
movl %ecx, %eax
shrl $0x1f, %eax
addl %ecx, %eax
sarl %eax
subl %eax, 0x28(%rbx)
jmp 0x7d39
subl %ecx, 0x28(%rbx)
jmp 0x7d12
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
subl %edx, 0x28(%rbx)
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
subl %ecx, 0x2c(%rbx)
jmp 0x7d39
subl %ecx, 0x28(%rbx)
jmp 0x7d36
subl %ecx, 0x28(%rbx)
jmp 0x7d39
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
subl %edx, 0x28(%rbx)
subl %eax, 0x2c(%rbx)
orl $0x3, %ebp
movl 0x3c(%rbx), %esi
movq %rbx, %rdi
callq 0x57c7
movl 0x28(%rbx), %eax
movl 0x3c(%rbx), %ecx
subl %ecx, %eax
movl %eax, (%r14)
movl 0x2c(%rbx), %eax
subl %ecx, %eax
movl %eax, 0x4(%r14)
movl %ecx, 0x10(%r14)
leaq 0x89d2(%rip), %r15      # 0x10738
movq (%r15), %rdi
movq 0x8(%rbx), %rsi
movl %ebp, %edx
movq %r14, %rcx
callq 0x40e0
movq (%r15), %rdi
movq (%rbx), %rsi
movl 0x30(%rbx), %r8d
movl 0x34(%rbx), %r9d
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x43b0
testb $0x3, %bpl
sete %al
testb $0xc, %bpl
setne %cl
orb %al, %cl
jne 0x7db2
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5755
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)