// File: /workspace/github_c_makefile_star2_O1/tudurom[P]windowchef/wm.c
// Function: event_configure_request
static void
event_configure_request(xcb_generic_event_t *ev)
{
	xcb_configure_request_event_t *e = (xcb_configure_request_event_t *)ev;
	struct client *client;
	uint32_t values[7];
	int i = 0;

	client = find_client(&e->window);
	if (client != NULL) {

		if (e->value_mask & XCB_CONFIG_WINDOW_X
				&& !client->maxed && !client->monocled && !client->hmaxed)
			client->geom.x = e->x;

		if (e->value_mask & XCB_CONFIG_WINDOW_Y
				&& !client->maxed && !client->monocled && !client->vmaxed)
			client->geom.y = e->y;

		if (e->value_mask & XCB_CONFIG_WINDOW_WIDTH
				&& !client->maxed && !client->monocled && !client->hmaxed)
			client->geom.width = e->width;

		if (e->value_mask & XCB_CONFIG_WINDOW_HEIGHT
				&& !client->maxed && !client->monocled && !client->vmaxed)
			client->geom.height = e->height;

		if (e->value_mask & XCB_CONFIG_WINDOW_STACK_MODE) {
			values[0] = e->stack_mode;
			xcb_configure_window(conn, e->window,
					XCB_CONFIG_WINDOW_STACK_MODE, values);
		}

		if (e->value_mask & XCB_CONFIG_WINDOW_BORDER_WIDTH) {
			values[0] = e->border_width;
			xcb_configure_window(conn, e->window,
					XCB_CONFIG_WINDOW_BORDER_WIDTH, values);
		}

		if (!client->maxed) {
			fit_on_screen(client);
		}

		teleport_window(client->window, client->geom.x, client->geom.y);
		resize_window_absolute(client->window, client->geom.width, client->geom.height);
	} else {
		if (e->value_mask & XCB_CONFIG_WINDOW_X) {
			values[i] = e->x;
			i++;
		}

		if (e->value_mask & XCB_CONFIG_WINDOW_Y) {
			values[i] = e->y;
			i++;
		}

		if (e->value_mask & XCB_CONFIG_WINDOW_WIDTH) {
			values[i] = e->width;
			i++;
		}

		if (e->value_mask & XCB_CONFIG_WINDOW_HEIGHT) {
			values[i] = e->height;
			i++;
		}

		if (e->value_mask & XCB_CONFIG_WINDOW_SIBLING) {
			values[i] = e->sibling;
			i++;
		}

		if (e->value_mask & XCB_CONFIG_WINDOW_STACK_MODE) {
			values[i] = e->stack_mode;
			i++;
		}

		if (e->value_mask & XCB_CONFIG_WINDOW_BORDER_WIDTH) {
			values[i] = e->border_width;
			i++;
		}

		if (i == 0)
			return;
		xcb_configure_window(conn, e->window, e->value_mask, values);
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x81e9(%rip), %rax      # 0xc3c8
testq %rax, %rax
je 0x41f8
movl 0x8(%rbx), %ecx
movq (%rax), %r14
cmpl %ecx, (%r14)
je 0x41fb
movq 0x10(%rax), %rax
testq %rax, %rax
jne 0x41e7
xorl %r14d, %r14d
movzwl 0x1a(%rbx), %eax
testq %r14, %r14
je 0x430c
testb $0x1, %al
je 0x422a
cmpb $0x0, 0x24(%r14)
jne 0x422a
cmpb $0x0, 0x27(%r14)
jne 0x422a
cmpb $0x0, 0x25(%r14)
jne 0x422a
movzwl 0x10(%rbx), %ecx
movw %cx, 0x4(%r14)
testb $0x2, %al
je 0x424c
cmpb $0x0, 0x24(%r14)
jne 0x424c
cmpb $0x0, 0x27(%r14)
jne 0x424c
cmpb $0x0, 0x26(%r14)
jne 0x424c
movzwl 0x12(%rbx), %ecx
movw %cx, 0x6(%r14)
testb $0x4, %al
je 0x426e
cmpb $0x0, 0x24(%r14)
jne 0x426e
cmpb $0x0, 0x27(%r14)
jne 0x426e
cmpb $0x0, 0x25(%r14)
jne 0x426e
movzwl 0x14(%rbx), %ecx
movw %cx, 0x8(%r14)
testb $0x8, %al
je 0x4290
cmpb $0x0, 0x24(%r14)
jne 0x4290
cmpb $0x0, 0x27(%r14)
jne 0x4290
cmpb $0x0, 0x26(%r14)
jne 0x4290
movzwl 0x16(%rbx), %ecx
movw %cx, 0xa(%r14)
testb $0x40, %al
je 0x42b1
movzbl 0x1(%rbx), %eax
movq %rsp, %rcx
movl %eax, (%rcx)
movq 0x8114(%rip), %rdi      # 0xc3b8
movl 0x8(%rbx), %esi
movl $0x40, %edx
callq 0x3200
testb $0x10, 0x1a(%rbx)
je 0x42d4
movzwl 0x18(%rbx), %eax
movq %rsp, %rcx
movl %eax, (%rcx)
movq 0x80f1(%rip), %rdi      # 0xc3b8
movl 0x8(%rbx), %esi
movl $0x10, %edx
callq 0x3200
cmpb $0x0, 0x24(%r14)
jne 0x42e3
movq %r14, %rdi
callq 0x4bf6
movl (%r14), %edi
movswl 0x4(%r14), %esi
movswl 0x6(%r14), %edx
callq 0x4e11
movl (%r14), %edi
movzwl 0x8(%r14), %esi
movzwl 0xa(%r14), %edx
callq 0x4e79
jmp 0x4393
xorl %ecx, %ecx
testb $0x1, %al
je 0x431e
movswl 0x10(%rbx), %ecx
movl %ecx, (%rsp)
movl $0x1, %ecx
testb $0x2, %al
je 0x432d
movswl 0x12(%rbx), %edx
movl %ecx, %esi
movl %edx, (%rsp,%rsi,4)
incl %ecx
testb $0x4, %al
je 0x433c
movzwl 0x14(%rbx), %edx
movl %ecx, %esi
movl %edx, (%rsp,%rsi,4)
incl %ecx
testb $0x8, %al
je 0x434b
movzwl 0x16(%rbx), %edx
movl %ecx, %esi
movl %edx, (%rsp,%rsi,4)
incl %ecx
testb $0x20, %al
je 0x4359
movl 0xc(%rbx), %edx
movl %ecx, %esi
movl %edx, (%rsp,%rsi,4)
incl %ecx
testb $0x40, %al
je 0x4368
movzbl 0x1(%rbx), %edx
movl %ecx, %esi
movl %edx, (%rsp,%rsi,4)
incl %ecx
testb $0x10, %al
je 0x437a
movzwl 0x18(%rbx), %edx
movl %ecx, %ecx
movl %edx, (%rsp,%rcx,4)
movl $0x1, %ecx
testl %ecx, %ecx
je 0x4393
movq 0x8033(%rip), %rdi      # 0xc3b8
movl 0x8(%rbx), %esi
movzwl %ax, %edx
movq %rsp, %rcx
callq 0x3200
addq $0x28, %rsp
popq %rbx
popq %r14
retq