// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x98c9
movq -0x18(%rbp), %rax
movl 0x8c(%rax), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x90(%rax)
movl -0x4(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x98ee
movq -0x10(%rbp), %rax
movl (%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x28(%rax)
movl -0x4(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x9907
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x2c(%rax)
movl -0x4(%rbp), %eax
andl $0xc, %eax
cmpl $0x0, %eax
je 0x9b64
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x4(%rbp), %eax
andl $0x3, %eax
cmpl $0x0, %eax
jne 0x9941
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rax
xorl %esi, %esi
subl 0x3c(%rax), %esi
callq 0x5e00
movl -0x4(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x99a3
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x6c(%rcx), %eax
jge 0x996c
movq -0x18(%rbp), %rax
movl 0x6c(%rax), %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x74(%rax)
je 0x998c
movl -0x28(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x74(%rcx), %eax
jle 0x998c
movq -0x18(%rbp), %rax
movl 0x74(%rax), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq -0x18(%rbp), %rcx
subl 0x30(%rcx), %eax
movl %eax, -0x20(%rbp)
movl -0x28(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x30(%rax)
movl -0x4(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x9a05
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x70(%rcx), %eax
jge 0x99ce
movq -0x18(%rbp), %rax
movl 0x70(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x78(%rax)
je 0x99ee
movl -0x2c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x78(%rcx), %eax
jle 0x99ee
movq -0x18(%rbp), %rax
movl 0x78(%rax), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x18(%rbp), %rcx
subl 0x34(%rcx), %eax
movl %eax, -0x24(%rbp)
movl -0x2c(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x34(%rax)
movl -0x4(%rbp), %eax
andl $0x3, %eax
cmpl $0x0, %eax
jne 0x9b62
movl -0x1c(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x8, %eax
ja 0x9a38
movq -0x38(%rbp), %rax
leaq 0x4e9d(%rip), %rcx      # 0xe8cc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x9a3a
jmp 0x9b49
movl -0x20(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edx
movq -0x18(%rbp), %rax
movl 0x28(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x28(%rax)
jmp 0x9b49
movl -0x20(%rbp), %edx
movq -0x18(%rbp), %rax
movl 0x28(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x28(%rax)
jmp 0x9b49
movl -0x24(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edx
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x2c(%rax)
jmp 0x9b49
movl -0x20(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edx
movq -0x18(%rbp), %rax
movl 0x28(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x28(%rax)
movl -0x24(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edx
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x2c(%rax)
jmp 0x9b49
movl -0x20(%rbp), %edx
movq -0x18(%rbp), %rax
movl 0x28(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x28(%rax)
movl -0x24(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edx
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x2c(%rax)
jmp 0x9b49
movl -0x24(%rbp), %edx
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x2c(%rax)
jmp 0x9b49
movl -0x20(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edx
movq -0x18(%rbp), %rax
movl 0x28(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x28(%rax)
movl -0x24(%rbp), %edx
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x2c(%rax)
jmp 0x9b49
movl -0x20(%rbp), %edx
movq -0x18(%rbp), %rax
movl 0x28(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x28(%rax)
movl -0x24(%rbp), %edx
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x2c(%rax)
movl -0x4(%rbp), %eax
orl $0x3, %eax
movl %eax, -0x4(%rbp)
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %esi
callq 0x5e00
jmp 0x9b64
movq -0x18(%rbp), %rax
movl 0x28(%rax), %ecx
movq -0x18(%rbp), %rax
subl 0x3c(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %ecx
movq -0x18(%rbp), %rax
subl 0x3c(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10(%rax)
leaq 0x91de(%rip), %rax      # 0x12d80
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
movl -0x4(%rbp), %edx
movq -0x10(%rbp), %rcx
callq 0x40e0
leaq 0x91c0(%rip), %rax      # 0x12d80
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
movq -0x18(%rbp), %rax
movl 0x30(%rax), %r8d
movq -0x18(%rbp), %rax
movl 0x34(%rax), %r9d
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x43c0
movl -0x4(%rbp), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x9c02
movl -0x4(%rbp), %eax
andl $0xc, %eax
cmpl $0x0, %eax
jne 0x9c02
movq -0x18(%rbp), %rdi
callq 0x5d50
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)