// File: /workspace/github_c_makefile_star2_O0/baskerville[P]bspwm/src/events.c
// Function: configure_request
void configure_request(xcb_generic_event_t *evt)
{
	xcb_configure_request_event_t *e = (xcb_configure_request_event_t *) evt;

	coordinates_t loc;
	bool is_managed = locate_window(e->window, &loc);
	client_t *c = (is_managed ? loc.node->client : NULL);
	uint16_t width, height;

	if (!is_managed) {
		uint16_t mask = 0;
		uint32_t values[7];
		unsigned short i = 0;

		if (e->value_mask & XCB_CONFIG_WINDOW_X) {
			mask |= XCB_CONFIG_WINDOW_X;
			values[i++] = e->x;
		}

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

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

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

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

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

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

		xcb_configure_window(dpy, e->window, mask, values);

	} else if (IS_FLOATING(c)) {
		width = c->floating_rectangle.width;
		height = c->floating_rectangle.height;

		if (e->value_mask & XCB_CONFIG_WINDOW_X) {
			c->floating_rectangle.x = e->x;
		}

		if (e->value_mask & XCB_CONFIG_WINDOW_Y) {
			c->floating_rectangle.y = e->y;
		}

		if (e->value_mask & XCB_CONFIG_WINDOW_WIDTH) {
			width = e->width;
		}

		if (e->value_mask & XCB_CONFIG_WINDOW_HEIGHT) {
			height = e->height;
		}

		apply_size_hints(c, &width, &height);
		c->floating_rectangle.width = width;
		c->floating_rectangle.height = height;
		xcb_rectangle_t r = c->floating_rectangle;

		r.x -= c->border_width;
		r.y -= c->border_width;

		window_move_resize(e->window, r.x, r.y, r.width, r.height);

		put_status(SBSC_MASK_NODE_GEOMETRY, "node_geometry 0x%08X 0x%08X 0x%08X %ux%u+%i+%i\n", loc.monitor->id, loc.desktop->id, e->window, r.width, r.height, r.x, r.y);

		monitor_t *m = monitor_from_client(c);
		if (m != loc.monitor) {
			transfer_node(loc.monitor, loc.desktop, loc.node, m, m->desk, m->desk->focus, false);
		}
	} else {
		if (c->state == STATE_PSEUDO_TILED) {
			width = c->floating_rectangle.width;
			height = c->floating_rectangle.height;
			if (e->value_mask & XCB_CONFIG_WINDOW_WIDTH) {
				width = e->width;
			}
			if (e->value_mask & XCB_CONFIG_WINDOW_HEIGHT) {
				height = e->height;
			}
			apply_size_hints(c, &width, &height);
			if (width != c->floating_rectangle.width || height != c->floating_rectangle.height) {
				c->floating_rectangle.width = width;
				c->floating_rectangle.height = height;
				arrange(loc.monitor, loc.desktop);
			}
		}


		xcb_configure_notify_event_t evt;
		unsigned int bw = c->border_width;

		xcb_rectangle_t r = IS_FULLSCREEN(c) ? loc.monitor->rectangle : c->tiled_rectangle;

		evt.response_type = XCB_CONFIGURE_NOTIFY;
		evt.event = e->window;
		evt.window = e->window;
		evt.above_sibling = XCB_NONE;
		evt.x = r.x;
		evt.y = r.y;
		evt.width = r.width;
		evt.height = r.height;
		evt.border_width = bw;
		evt.override_redirect = false;

		xcb_send_event(dpy, false, e->window, XCB_EVENT_MASK_STRUCTURE_NOTIFY, (const char *) &evt);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edi
leaq -0x28(%rbp), %rsi
callq 0x26b20
andb $0x1, %al
movb %al, -0x29(%rbp)
testb $0x1, -0x29(%rbp)
je 0x134d3
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0xb0(%rbp)
jmp 0x134de
xorl %eax, %eax
movq %rax, -0xb0(%rbp)
jmp 0x134de
movq -0xb0(%rbp), %rax
movq %rax, -0x38(%rbp)
testb $0x1, -0x29(%rbp)
jne 0x136b6
movw $0x0, -0x3e(%rbp)
movw $0x0, -0x62(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x1a(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x13538
movzwl -0x3e(%rbp), %eax
orl $0x1, %eax
movw %ax, -0x3e(%rbp)
movq -0x10(%rbp), %rax
movswl 0x10(%rax), %ecx
movw -0x62(%rbp), %ax
movw %ax, %dx
addw $0x1, %dx
movw %dx, -0x62(%rbp)
movzwl %ax, %eax
movl %ecx, -0x60(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movzwl 0x1a(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x13571
movzwl -0x3e(%rbp), %eax
orl $0x2, %eax
movw %ax, -0x3e(%rbp)
movq -0x10(%rbp), %rax
movswl 0x12(%rax), %ecx
movw -0x62(%rbp), %ax
movw %ax, %dx
addw $0x1, %dx
movw %dx, -0x62(%rbp)
movzwl %ax, %eax
movl %ecx, -0x60(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movzwl 0x1a(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x135aa
movzwl -0x3e(%rbp), %eax
orl $0x4, %eax
movw %ax, -0x3e(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x14(%rax), %ecx
movw -0x62(%rbp), %ax
movw %ax, %dx
addw $0x1, %dx
movw %dx, -0x62(%rbp)
movzwl %ax, %eax
movl %ecx, -0x60(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movzwl 0x1a(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x135e3
movzwl -0x3e(%rbp), %eax
orl $0x8, %eax
movw %ax, -0x3e(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x16(%rax), %ecx
movw -0x62(%rbp), %ax
movw %ax, %dx
addw $0x1, %dx
movw %dx, -0x62(%rbp)
movzwl %ax, %eax
movl %ecx, -0x60(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movzwl 0x1a(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x1361c
movzwl -0x3e(%rbp), %eax
orl $0x10, %eax
movw %ax, -0x3e(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x18(%rax), %ecx
movw -0x62(%rbp), %ax
movw %ax, %dx
addw $0x1, %dx
movw %dx, -0x62(%rbp)
movzwl %ax, %eax
movl %ecx, -0x60(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movzwl 0x1a(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x13654
movzwl -0x3e(%rbp), %eax
orl $0x20, %eax
movw %ax, -0x3e(%rbp)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
movw -0x62(%rbp), %ax
movw %ax, %dx
addw $0x1, %dx
movw %dx, -0x62(%rbp)
movzwl %ax, %eax
movl %ecx, -0x60(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movzwl 0x1a(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x1368d
movzwl -0x3e(%rbp), %eax
orl $0x40, %eax
movw %ax, -0x3e(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x1(%rax), %ecx
movw -0x62(%rbp), %ax
movw %ax, %dx
addw $0x1, %dx
movw %dx, -0x62(%rbp)
movzwl %ax, %eax
movl %ecx, -0x60(%rbp,%rax,4)
leaq 0x22024(%rip), %rax     # 0x356b8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %esi
movw -0x3e(%rbp), %ax
leaq -0x60(%rbp), %rcx
movzwl %ax, %edx
callq 0x4320
movl %eax, -0x68(%rbp)
jmp 0x13a28
movq -0x38(%rbp), %rax
cmpl $0x2, 0x308(%rax)
jne 0x13886
movq -0x38(%rbp), %rax
movw 0x31c(%rax), %ax
movw %ax, -0x3a(%rbp)
movq -0x38(%rbp), %rax
movw 0x31e(%rax), %ax
movw %ax, -0x3c(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x1a(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x13708
movq -0x10(%rbp), %rax
movw 0x10(%rax), %cx
movq -0x38(%rbp), %rax
movw %cx, 0x318(%rax)
movq -0x10(%rbp), %rax
movzwl 0x1a(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1372b
movq -0x10(%rbp), %rax
movw 0x12(%rax), %cx
movq -0x38(%rbp), %rax
movw %cx, 0x31a(%rax)
movq -0x10(%rbp), %rax
movzwl 0x1a(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x13747
movq -0x10(%rbp), %rax
movw 0x14(%rax), %ax
movw %ax, -0x3a(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x1a(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x13763
movq -0x10(%rbp), %rax
movw 0x16(%rax), %ax
movw %ax, -0x3c(%rbp)
movq -0x38(%rbp), %rdi
leaq -0x3a(%rbp), %rsi
leaq -0x3c(%rbp), %rdx
callq 0x17f40
movw -0x3a(%rbp), %cx
movq -0x38(%rbp), %rax
movw %cx, 0x31c(%rax)
movw -0x3c(%rbp), %cx
movq -0x38(%rbp), %rax
movw %cx, 0x31e(%rax)
movq -0x38(%rbp), %rax
movq 0x318(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x38(%rbp), %rax
movl 0x300(%rax), %ecx
movswl -0x70(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x70(%rbp)
movq -0x38(%rbp), %rax
movl 0x300(%rax), %ecx
movswl -0x6e(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x6e(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edi
movw -0x70(%rbp), %dx
movw -0x6e(%rbp), %cx
movw -0x6c(%rbp), %ax
movswl %dx, %esi
movswl %cx, %edx
movzwl %ax, %ecx
movzwl -0x6a(%rbp), %r8d
callq 0x16da0
movq -0x28(%rbp), %rax
movl 0x20(%rax), %edx
movq -0x20(%rbp), %rax
movl 0x20(%rax), %ecx
movq -0x10(%rbp), %rax
movl 0x8(%rax), %r8d
movzwl -0x6c(%rbp), %r9d
movzwl -0x6a(%rbp), %r11d
movswl -0x70(%rbp), %r10d
movswl -0x6e(%rbp), %eax
movl $0x800000, %edi         # imm = 0x800000
leaq 0x19f94(%rip), %rsi     # 0x2d7b8
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movl %eax, 0x10(%rsp)
movb $0x0, %al
callq 0x2c0b0
movq -0x38(%rbp), %rdi
callq 0x90e0
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
cmpq -0x28(%rbp), %rax
je 0x13881
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x78(%rbp), %rcx
movq -0x78(%rbp), %rax
movq 0x58(%rax), %r8
movq -0x78(%rbp), %rax
movq 0x58(%rax), %rax
movq 0x38(%rax), %r9
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0xd180
jmp 0x13a26
movq -0x38(%rbp), %rax
cmpl $0x1, 0x308(%rax)
jne 0x13951
movq -0x38(%rbp), %rax
movw 0x31c(%rax), %ax
movw %ax, -0x3a(%rbp)
movq -0x38(%rbp), %rax
movw 0x31e(%rax), %ax
movw %ax, -0x3c(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x1a(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x138d1
movq -0x10(%rbp), %rax
movw 0x14(%rax), %ax
movw %ax, -0x3a(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x1a(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x138ed
movq -0x10(%rbp), %rax
movw 0x16(%rax), %ax
movw %ax, -0x3c(%rbp)
movq -0x38(%rbp), %rdi
leaq -0x3a(%rbp), %rsi
leaq -0x3c(%rbp), %rdx
callq 0x17f40
movzwl -0x3a(%rbp), %eax
movq -0x38(%rbp), %rcx
movzwl 0x31c(%rcx), %ecx
cmpl %ecx, %eax
jne 0x13924
movzwl -0x3c(%rbp), %eax
movq -0x38(%rbp), %rcx
movzwl 0x31e(%rcx), %ecx
cmpl %ecx, %eax
je 0x1394f
movw -0x3a(%rbp), %cx
movq -0x38(%rbp), %rax
movw %cx, 0x31c(%rax)
movw -0x3c(%rbp), %cx
movq -0x38(%rbp), %rax
movw %cx, 0x31e(%rax)
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xafd0
jmp 0x13951
movq -0x38(%rbp), %rax
movl 0x300(%rax), %eax
movl %eax, -0x98(%rbp)
movq -0x38(%rbp), %rax
cmpl $0x3, 0x308(%rax)
jne 0x1397f
movq -0x28(%rbp), %rax
movq 0x4c(%rax), %rax
movq %rax, -0xa0(%rbp)
jmp 0x13991
movq -0x38(%rbp), %rax
movq 0x320(%rax), %rax
movq %rax, -0xa0(%rbp)
movb $0x16, -0x94(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x90(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x8c(%rbp)
movl $0x0, -0x88(%rbp)
movw -0xa0(%rbp), %ax
movw %ax, -0x84(%rbp)
movw -0x9e(%rbp), %ax
movw %ax, -0x82(%rbp)
movw -0x9c(%rbp), %ax
movw %ax, -0x80(%rbp)
movw -0x9a(%rbp), %ax
movw %ax, -0x7e(%rbp)
movl -0x98(%rbp), %eax
movw %ax, -0x7c(%rbp)
movb $0x0, -0x7a(%rbp)
leaq 0x21cb5(%rip), %rax     # 0x356b8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edx
xorl %esi, %esi
movl $0x20000, %ecx          # imm = 0x20000
leaq -0x94(%rbp), %r8
callq 0x45f0
movl %eax, -0xa4(%rbp)
jmp 0x13a28
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)