// File: /workspace/github_c_makefile_star2_O0/baskerville[P]bspwm/src/window.c
// Function: draw_presel_feedback
void draw_presel_feedback(monitor_t *m, desktop_t *d, node_t *n)
{
	if (n == NULL || n->presel == NULL || d->user_layout == LAYOUT_MONOCLE || !presel_feedback) {
		return;
	}

	bool exists = (n->presel->feedback != XCB_NONE);
	if (!exists) {
		initialize_presel_feedback(n);
	}

	int gap = gapless_monocle && d->layout == LAYOUT_MONOCLE ? 0 : d->window_gap;
	presel_t *p = n->presel;
	xcb_rectangle_t rect = n->rectangle;
	rect.x = rect.y = 0;
	rect.width -= gap;
	rect.height -= gap;
	xcb_rectangle_t presel_rect = rect;

	switch (p->split_dir) {
		case DIR_NORTH:
			presel_rect.height = p->split_ratio * rect.height;
			break;
		case DIR_EAST:
			presel_rect.width = (1 - p->split_ratio) * rect.width;
			presel_rect.x = rect.width - presel_rect.width;
			break;
		case DIR_SOUTH:
			presel_rect.height = (1 - p->split_ratio) * rect.height;
			presel_rect.y = rect.height - presel_rect.height;
			break;
		case DIR_WEST:
			presel_rect.width = p->split_ratio * rect.width;
			break;
	}

	window_move_resize(p->feedback, n->rectangle.x + presel_rect.x, n->rectangle.y + presel_rect.y,
	                   presel_rect.width, presel_rect.height);

	if (!exists && m->desk == d) {
		window_show(p->feedback);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x16bbc
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x16bbc
movq -0x10(%rbp), %rax
cmpl $0x1, 0x28(%rax)
je 0x16bbc
leaq 0x1f22e(%rip), %rax     # 0x35de5
testb $0x1, (%rax)
jne 0x16bc1
jmp 0x16d90
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl 0xc(%rax), %eax
cmpq $0x0, %rax
setne %al
andb $0x1, %al
movb %al, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x16be7
movq -0x18(%rbp), %rdi
callq 0x16990
leaq 0x1f1f9(%rip), %rax     # 0x35de7
testb $0x1, (%rax)
je 0x16c04
movq -0x10(%rbp), %rax
cmpl $0x1, 0x24(%rax)
jne 0x16c04
xorl %eax, %eax
movl %eax, -0x3c(%rbp)
jmp 0x16c0e
movq -0x10(%rbp), %rax
movl 0x60(%rax), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
movw $0x0, -0x2e(%rbp)
movw $0x0, -0x30(%rbp)
movl -0x20(%rbp), %ecx
movzwl -0x2c(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x2c(%rbp)
movl -0x20(%rbp), %ecx
movzwl -0x2a(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x2a(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movl 0x8(%rax), %eax
movq %rax, -0x48(%rbp)
subq $0x3, %rax
ja 0x16d30
movq -0x48(%rbp), %rax
leaq 0x170ea(%rip), %rcx     # 0x2dd64
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x28(%rbp), %rax
movsd (%rax), %xmm0
movzwl -0x2a(%rbp), %eax
cvtsi2sd %eax, %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movw %ax, -0x32(%rbp)
jmp 0x16d30
movq -0x28(%rbp), %rax
movsd (%rax), %xmm1
movsd 0x16afc(%rip), %xmm0    # 0x2d7b0
subsd %xmm1, %xmm0
movzwl -0x2c(%rbp), %eax
cvtsi2sd %eax, %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movw %ax, -0x34(%rbp)
movzwl -0x2c(%rbp), %eax
movzwl -0x34(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x38(%rbp)
jmp 0x16d30
movq -0x28(%rbp), %rax
movsd (%rax), %xmm1
movsd 0x16ac4(%rip), %xmm0    # 0x2d7b0
subsd %xmm1, %xmm0
movzwl -0x2a(%rbp), %eax
cvtsi2sd %eax, %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movw %ax, -0x32(%rbp)
movzwl -0x2a(%rbp), %eax
movzwl -0x32(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x36(%rbp)
jmp 0x16d30
movq -0x28(%rbp), %rax
movsd (%rax), %xmm0
movzwl -0x2c(%rbp), %eax
cvtsi2sd %eax, %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movw %ax, -0x34(%rbp)
movq -0x28(%rbp), %rax
movl 0xc(%rax), %edi
movq -0x18(%rbp), %rax
movswl 0x18(%rax), %eax
movswl -0x38(%rbp), %ecx
addl %ecx, %eax
movw %ax, %dx
movq -0x18(%rbp), %rax
movswl 0x1a(%rax), %eax
movswl -0x36(%rbp), %ecx
addl %ecx, %eax
movw %ax, %cx
movw -0x34(%rbp), %ax
movswl %dx, %esi
movswl %cx, %edx
movzwl %ax, %ecx
movzwl -0x32(%rbp), %r8d
callq 0x16da0
testb $0x1, -0x19(%rbp)
jne 0x16d90
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
cmpq -0x10(%rbp), %rax
jne 0x16d90
movq -0x28(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x16590
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)