// File: /workspace/github_c_makefile_star2_O0/baskerville[P]bspwm/src/window.c
// Function: query_pointer
void query_pointer(xcb_window_t *win, xcb_point_t *pt)
{
	if (motion_recorder.enabled) {
		window_hide(motion_recorder.id);
	}

	xcb_query_pointer_reply_t *qpr = xcb_query_pointer_reply(dpy, xcb_query_pointer(dpy, root), NULL);

	if (qpr != NULL) {
		if (win != NULL) {
			if (qpr->child == XCB_NONE) {
				xcb_point_t mpt = (xcb_point_t) {qpr->root_x, qpr->root_y};
				monitor_t *m = monitor_from_point(mpt);
				if (m != NULL) {
					desktop_t *d = m->desk;
					for (node_t *n = first_extrema(d->root); n != NULL; n = next_leaf(n, d->root)) {
						if (n->client == NULL && is_inside(mpt, get_rectangle(m, d, n))) {
							*win = n->id;
							break;
						}
					}
				}
			} else {
				*win = qpr->child;
				xcb_point_t pt = {qpr->root_x, qpr->root_y};
				for (stacking_list_t *s = stack_tail; s != NULL; s = s->prev) {
					if (!s->node->client->shown || s->node->hidden) {
						continue;
					}
					xcb_rectangle_t rect = get_rectangle(NULL, NULL, s->node);
					if (is_inside(pt, rect)) {
						if (s->node->id == qpr->child || is_presel_window(qpr->child)) {
							*win = s->node->id;
						}
						break;
					}
				}
			}
		}
		if (pt != NULL) {
			*pt = (xcb_point_t) {qpr->root_x, qpr->root_y};
		}
	}

	free(qpr);

	if (motion_recorder.enabled) {
		window_show(motion_recorder.id);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x1e021(%rip), %rax     # 0x356d8
testb $0x1, 0x6(%rax)
je 0x176cb
leaq 0x1e014(%rip), %rax     # 0x356d8
movl (%rax), %edi
callq 0x16f50
leaq 0x1dfe6(%rip), %rax     # 0x356b8
movq (%rax), %rax
movq %rax, -0x68(%rbp)
leaq 0x1dfd8(%rip), %rax     # 0x356b8
movq (%rax), %rdi
leaq 0x1e07e(%rip), %rax     # 0x35768
movl (%rax), %esi
callq 0x4840
movq -0x68(%rbp), %rdi
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x49d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x178de
cmpq $0x0, -0x8(%rbp)
je 0x178b4
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
cmpq $0x0, %rax
jne 0x177de
movq -0x18(%rbp), %rax
movw 0x10(%rax), %ax
movw %ax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movw 0x12(%rax), %ax
movw %ax, -0x1e(%rbp)
movl -0x20(%rbp), %edi
callq 0x9080
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x177d9
movq -0x28(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xbe70
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x177d7
movq -0x38(%rbp), %rax
cmpq $0x0, 0x48(%rax)
jne 0x177be
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0xc7f0
movq %rax, -0x40(%rbp)
movl -0x20(%rbp), %edi
movq -0x40(%rbp), %rsi
callq 0x6bf0
testb $0x1, %al
jne 0x177b0
jmp 0x177be
movq -0x38(%rbp), %rax
movl (%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
jmp 0x177d7
jmp 0x177c0
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0xbf80
movq %rax, -0x38(%rbp)
jmp 0x17777
jmp 0x177d9
jmp 0x178b2
movq -0x18(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movw 0x10(%rax), %ax
movw %ax, -0x44(%rbp)
movq -0x18(%rbp), %rax
movw 0x12(%rax), %ax
movw %ax, -0x42(%rbp)
leaq 0x1df26(%rip), %rax     # 0x35730
movq (%rax), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x178b0
movq -0x50(%rbp), %rax
movq (%rax), %rax
movq 0x48(%rax), %rax
testb $0x1, 0x305(%rax)
je 0x1783d
movq -0x50(%rbp), %rax
movq (%rax), %rax
testb $0x1, 0x25(%rax)
je 0x1783f
jmp 0x1789f
movq -0x50(%rbp), %rax
movq (%rax), %rdx
xorl %eax, %eax
movl %eax, %esi
movq %rsi, %rdi
callq 0xc7f0
movq %rax, -0x58(%rbp)
movl -0x44(%rbp), %edi
movq -0x58(%rbp), %rsi
callq 0x6bf0
testb $0x1, %al
jne 0x17868
jmp 0x1789d
movq -0x50(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0xc(%rcx), %eax
je 0x1788c
movq -0x18(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x16900
testb $0x1, %al
jne 0x1788c
jmp 0x1789b
movq -0x50(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
jmp 0x178b0
jmp 0x1789f
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x17811
jmp 0x178b2
jmp 0x178b4
cmpq $0x0, -0x10(%rbp)
je 0x178dc
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movw 0x10(%rcx), %cx
movw %cx, -0x5c(%rbp)
movq -0x18(%rbp), %rcx
movw 0x12(%rcx), %cx
movw %cx, -0x5a(%rbp)
movl -0x5c(%rbp), %ecx
movl %ecx, (%rax)
jmp 0x178de
movq -0x18(%rbp), %rdi
callq 0x4450
leaq 0x1ddea(%rip), %rax     # 0x356d8
testb $0x1, 0x6(%rax)
je 0x17902
leaq 0x1dddd(%rip), %rax     # 0x356d8
movl (%rax), %edi
callq 0x16590
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)