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

	static uint16_t last_motion_x = 0, last_motion_y = 0;
	static xcb_timestamp_t last_motion_time = 0;

	int64_t dtime = e->time - last_motion_time;

	/* Ignore unintentional pointer motions. */
	if (dtime > 1000) {
		last_motion_time = e->time;
		last_motion_x = e->event_x;
		last_motion_y = e->event_y;
		return;
	}
	int mdist = abs(e->event_x - last_motion_x) + abs(e->event_y - last_motion_y);
	if (mdist < 10) {
		return;
	}

	disable_motion_recorder();

	xcb_window_t win = XCB_NONE;
	query_pointer(&win, NULL);
	coordinates_t loc;
	bool pff = pointer_follows_focus;
	bool pfm = pointer_follows_monitor;
	pointer_follows_focus = false;
	pointer_follows_monitor = false;
	auto_raise = false;

	if (locate_window(win, &loc)) {
		if (loc.monitor->desk == loc.desktop && loc.node != mon->desk->focus) {
			focus_node(loc.monitor, loc.desktop, loc.node);
		}
	} else {
		xcb_point_t pt = {e->root_x, e->root_y};
		monitor_t *m = monitor_from_point(pt);
		if (m != NULL && m != mon) {
			focus_node(m, m->desk, m->desk->focus);
		}
	}

	pointer_follows_focus = pff;
	pointer_follows_monitor = pfm;
	auto_raise = true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
subl 0x22017(%rip), %eax     # 0x35e08
movl %eax, %eax
movq %rax, -0x18(%rbp)
cmpq $0x3e8, -0x18(%rbp)     # imm = 0x3E8
jle 0x13e31
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x21ffa(%rip)     # 0x35e08
movq -0x10(%rbp), %rax
movw 0x18(%rax), %ax
movw %ax, 0x21fe5(%rip)      # 0x35e02
movq -0x10(%rbp), %rax
movw 0x1a(%rax), %ax
movw %ax, 0x21fd8(%rip)      # 0x35e04
jmp 0x13f91
movq -0x10(%rbp), %rax
movswl 0x18(%rax), %eax
movzwl 0x21fc2(%rip), %ecx     # 0x35e02
subl %ecx, %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movq -0x10(%rbp), %rcx
movswl 0x1a(%rcx), %ecx
movzwl 0x21fac(%rip), %edx     # 0x35e04
subl %edx, %ecx
movl %ecx, %edx
negl %edx
cmovnsl %edx, %ecx
addl %ecx, %eax
movl %eax, -0x1c(%rbp)
cmpl $0xa, -0x1c(%rbp)
jge 0x13e71
jmp 0x13f91
callq 0x18640
movl $0x0, -0x20(%rbp)
leaq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x176a0
leaq 0x21f5a(%rip), %rax     # 0x35deb
movb (%rax), %al
andb $0x1, %al
movb %al, -0x39(%rbp)
leaq 0x21f4d(%rip), %rax     # 0x35dec
movb (%rax), %al
andb $0x1, %al
movb %al, -0x3a(%rbp)
leaq 0x21f3e(%rip), %rax     # 0x35deb
movb $0x0, (%rax)
leaq 0x21f35(%rip), %rax     # 0x35dec
movb $0x0, (%rax)
leaq 0x2189a(%rip), %rax     # 0x3575b
movb $0x0, (%rax)
movl -0x20(%rbp), %edi
leaq -0x38(%rbp), %rsi
callq 0x26b20
testb $0x1, %al
jne 0x13ed6
jmp 0x13f0f
movq -0x38(%rbp), %rax
movq 0x58(%rax), %rax
cmpq -0x30(%rbp), %rax
jne 0x13f0d
movq -0x28(%rbp), %rax
leaq 0x21811(%rip), %rcx     # 0x35700
movq (%rcx), %rcx
movq 0x58(%rcx), %rcx
cmpq 0x38(%rcx), %rax
je 0x13f0d
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0xd720
jmp 0x13f69
movq -0x10(%rbp), %rax
movw 0x14(%rax), %ax
movw %ax, -0x3e(%rbp)
movq -0x10(%rbp), %rax
movw 0x16(%rax), %ax
movw %ax, -0x3c(%rbp)
movl -0x3e(%rbp), %edi
callq 0x9080
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x13f67
movq -0x48(%rbp), %rax
leaq 0x217bb(%rip), %rcx     # 0x35700
cmpq (%rcx), %rax
je 0x13f67
movq -0x48(%rbp), %rdi
movq -0x48(%rbp), %rax
movq 0x58(%rax), %rsi
movq -0x48(%rbp), %rax
movq 0x58(%rax), %rax
movq 0x38(%rax), %rdx
callq 0xd720
jmp 0x13f69
movb -0x39(%rbp), %cl
andb $0x1, %cl
leaq 0x21e75(%rip), %rax     # 0x35deb
movb %cl, (%rax)
movb -0x3a(%rbp), %cl
andb $0x1, %cl
leaq 0x21e67(%rip), %rax     # 0x35dec
movb %cl, (%rax)
leaq 0x217cd(%rip), %rax     # 0x3575b
movb $0x1, (%rax)
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)