LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/stack.c
// Function: limit_below
stacking_list_t *limit_below(node_t *n)
{
	stacking_list_t *s = stack_tail;
	while (s != NULL && stack_cmp(n->client, s->node->client) <= 0) {
		s = s->prev;
	}
	if (s == NULL) {
		s = stack_head;
	}
	if (s->node == n) {
		s = s->next;
	}
	return s;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x1c48b(%rip), %rax     # 0x29740
movq (%rax), %rbx
testq %rbx, %rbx
je 0xd2de
movq 0x48(%r14), %r15
movq (%rbx), %r12
movq 0x48(%r12), %rsi
movq %r15, %rdi
callq 0xd1d2
testl %eax, %eax
jg 0xd2eb
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
jne 0xd2c1
leaq 0x1c463(%rip), %rax     # 0x29748
movq (%rax), %rbx
movq (%rbx), %r12
cmpq %r14, %r12
jne 0xd2f4
movq 0x10(%rbx), %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/stack.c
// Function: stack
void stack(desktop_t *d, node_t *n, bool focused)
{
	for (node_t *f = first_extrema(n); f != NULL; f = next_leaf(f, n)) {
		if (f->client == NULL || (IS_FLOATING(f->client) && !auto_raise)) {
			continue;
		}

		if (stack_head == NULL) {
			stack_insert_after(NULL, f);
		} else {
			stacking_list_t *s = (focused ? limit_above(f) : limit_below(f));
			if (s == NULL) {
				continue;
			}
			int i = stack_cmp(f->client, s->node->client);
			if (i < 0 || (i == 0 && !focused)) {
				stack_insert_before(s, f);
				window_below(f->id, s->node->id);
				put_status(SBSC_MASK_NODE_STACK, "node_stack 0x%08X below 0x%08X\n", f->id, s->node->id);
			} else {
				stack_insert_after(s, f);
				window_above(f->id, s->node->id);
				put_status(SBSC_MASK_NODE_STACK, "node_stack 0x%08X above 0x%08X\n", f->id, s->node->id);
			}
		}
	}

	ewmh_update_client_list(true);
	restack_presel_feedbacks(d);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, (%rsp)
movq %rsi, %rdi
callq 0x920c
testq %rax, %rax
je 0xd434
movq %rax, %r15
leaq 0x1c416(%rip), %rbx     # 0x29748
movq 0x48(%r15), %r13
testq %r13, %r13
je 0xd41d
cmpl $0x2, 0x308(%r13)
jne 0xd359
leaq 0x1c41b(%rip), %rax     # 0x2976b
cmpb $0x1, (%rax)
jne 0xd41d
cmpq $0x0, (%rbx)
je 0xd36e
movq %r15, %rdi
testb %bpl, %bpl
je 0xd392
callq 0xd243
jmp 0xd397
movl $0x1, %edi
movl $0x18, %esi
callq 0x48b0
movq %r15, (%rax)
leaq 0x1c3b9(%rip), %rcx     # 0x29740
movq %rax, (%rcx)
movq %rax, (%rbx)
jmp 0xd41d
callq 0xd2a3
movq %rax, %r12
testq %rax, %rax
je 0xd41d
movq (%r12), %rax
movq 0x48(%rax), %rsi
movq %r13, %rdi
callq 0xd1d2
testl %eax, %eax
setns %al
setne %cl
orb %bpl, %cl
movq %r12, %rdi
movq %r15, %rsi
testb %cl, %al
je 0xd3ee
callq 0xd008
movl (%r15), %edi
movq (%r12), %rax
movl (%rax), %esi
callq 0x10214
movl (%r15), %edx
movq (%r12), %rax
movl (%rax), %ecx
movl $0x200000, %edi         # imm = 0x200000
leaq 0x125a5(%rip), %rsi     # 0x1f991
jmp 0xd416
callq 0xd0d5
movl (%r15), %edi
movq (%r12), %rax
movl (%rax), %esi
callq 0x11346
movl (%r15), %edx
movq (%r12), %rax
movl (%rax), %ecx
movl $0x200000, %edi         # imm = 0x200000
leaq 0x1255b(%rip), %rsi     # 0x1f971
xorl %eax, %eax
callq 0x1e6b8
movq %r15, %rdi
movq %r14, %rsi
callq 0x926e
movq %rax, %r15
testq %rax, %rax
jne 0xd332
movl $0x1, %edi
callq 0x1e08b
movq (%rsp), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xd455
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/stack.c
// Function: restack_presel_feedbacks_in
void restack_presel_feedbacks_in(node_t *r, node_t *n)
{
	if (r == NULL) {
		return;
	} else {
		if (r->presel != NULL) {
			window_above(r->presel->feedback, n->id);
		}
		restack_presel_feedbacks_in(r->first_child, n);
		restack_presel_feedbacks_in(r->second_child, n);
	}
}

// Assembly:
testq %rdi, %rdi
je 0xd4c2
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%r14), %rax
testq %rax, %rax
je 0xd4a6
movl 0xc(%rax), %edi
movl (%rbx), %esi
callq 0x10214
movq 0x30(%r14), %rdi
movq %rbx, %rsi
callq 0xd484
movq 0x38(%r14), %r14
testq %r14, %r14
jne 0xd493
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/history.c
// Function: make_history
history_t *make_history(monitor_t *m, desktop_t *d, node_t *n)
{
	history_t *h = calloc(1, sizeof(history_t));
	h->loc = (coordinates_t) {m, d, n};
	h->prev = h->next = NULL;
	h->latest = true;
	return h;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x1, %edi
movl $0x30, %esi
callq 0x48b0
movq %r15, (%rax)
movq %r14, 0x8(%rax)
movq %rbx, 0x10(%rax)
movb $0x1, 0x18(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/history.c
// Function: history_add
void history_add(monitor_t *m, desktop_t *d, node_t *n, bool focused)
{
	if (!record_history) {
		return;
	}

	if (focused) {
		history_needle = NULL;
	}

	history_t *h = make_history(m, d, n);

	if (history_head == NULL) {
		history_head = history_tail = h;
	} else if ((n != NULL && history_tail->loc.node != n) || (n == NULL && d != history_tail->loc.desktop)) {
		history_t *ip = focused ? history_tail : NULL;

		for (history_t *hh = history_tail; hh != NULL; hh = hh->prev) {
			if ((n != NULL && hh->loc.node == n) || (n == NULL && d == hh->loc.desktop)) {
				hh->latest = false;
			}
			if (ip == NULL && ((n != NULL && hh->loc.desktop == d) || (n == NULL && hh->loc.monitor == m))) {
				ip = hh;
			}
		}

		if (ip != NULL) {
			history_insert_after(h, ip);
		} else {
			ip = history_head;
			if (n != NULL) {
				for (history_t *hh = history_head; hh != NULL; hh = hh->next) {
					if (hh->latest && hh->loc.monitor == m) {
						ip = hh;
						break;
					}
				}
			}
			history_insert_before(h, ip);
		}
	} else {
		free(h);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x1c264(%rip), %rax     # 0x29768
cmpb $0x1, (%rax)
jne 0xd5fc
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
testb %bpl, %bpl
je 0xd52b
leaq 0x1c1f4(%rip), %rax     # 0x29718
movq $0x0, (%rax)
movl $0x1, %edi
movl $0x30, %esi
callq 0x48b0
movq %rbx, (%rax)
movq %r15, 0x8(%rax)
movq %r14, 0x10(%rax)
movb $0x1, 0x18(%rax)
leaq 0x1c1d8(%rip), %rcx     # 0x29728
movq (%rcx), %rdx
testq %rdx, %rdx
je 0xd5ef
leaq 0x1c1bd(%rip), %rsi     # 0x29720
movq (%rsi), %rdi
testq %r14, %r14
je 0xd607
cmpq %r14, 0x10(%rdi)
je 0xd611
xorl %r8d, %r8d
testb %bpl, %bpl
cmovneq %rdi, %r8
movq %rdi, %r9
testq %r14, %r14
je 0xd5a6
cmpq %r14, 0x10(%r9)
jne 0xd596
movb $0x0, 0x18(%r9)
testq %r8, %r8
jne 0xd5be
cmpq %r15, 0x8(%r9)
je 0xd5bb
xorl %r8d, %r8d
jmp 0xd5be
cmpq %r15, 0x8(%r9)
jne 0xd5b1
movb $0x0, 0x18(%r9)
testq %r8, %r8
jne 0xd5be
cmpq %rbx, (%r9)
jne 0xd5a1
movq %r9, %r8
movq 0x20(%r9), %r9
testq %r9, %r9
jne 0xd586
testq %r8, %r8
je 0xd623
movq 0x28(%r8), %rcx
movq %rcx, 0x28(%rax)
testq %rcx, %rcx
je 0xd5dd
movq %rax, 0x20(%rcx)
movq %rax, 0x28(%r8)
movq %r8, 0x20(%rax)
cmpq %r8, %rdi
jne 0xd5fc
movq %rax, (%rsi)
jmp 0xd5fc
leaq 0x1c12a(%rip), %rdx     # 0x29720
movq %rax, (%rdx)
movq %rax, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpq %r15, 0x8(%rdi)
jne 0xd579
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4460
movq %rdx, %rsi
testq %r14, %r14
je 0xd645
movq %rdx, %rsi
cmpb $0x1, 0x18(%rsi)
jne 0xd639
cmpq %rbx, (%rsi)
je 0xd645
movq 0x28(%rsi), %rsi
testq %rsi, %rsi
jne 0xd62e
movq %rdx, %rsi
movq 0x20(%rsi), %rdi
movq %rdi, 0x20(%rax)
testq %rdi, %rdi
je 0xd656
movq %rax, 0x28(%rdi)
movq %rax, 0x20(%rsi)
movq %rsi, 0x28(%rax)
cmpq %rsi, %rdx
jne 0xd5fc
jmp 0xd5f9
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/history.c
// Function: history_insert_after
void history_insert_after(history_t *a, history_t *b)
{
	a->next = b->next;
	if (b->next != NULL) {
		b->next->prev = a;
	}
	b->next = a;
	a->prev = b;
	if (history_tail == b) {
		history_tail = a;
	}
}

// Assembly:
movq 0x28(%rsi), %rax
movq %rax, 0x28(%rdi)
testq %rax, %rax
je 0xd676
movq %rdi, 0x20(%rax)
movq %rdi, 0x28(%rsi)
movq %rsi, 0x20(%rdi)
leaq 0x1c09b(%rip), %rax     # 0x29720
cmpq %rsi, (%rax)
je 0xd68b
retq
movq %rdi, (%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/history.c
// Function: history_insert_before
void history_insert_before(history_t *a, history_t *b)
{
	a->prev = b->prev;
	if (b->prev != NULL) {
		b->prev->next = a;
	}
	b->prev = a;
	a->next = b;
	if (history_head == b) {
		history_head = a;
	}
}

// Assembly:
movq 0x20(%rsi), %rax
movq %rax, 0x20(%rdi)
testq %rax, %rax
je 0xd6a0
movq %rdi, 0x28(%rax)
movq %rdi, 0x20(%rsi)
movq %rsi, 0x28(%rdi)
leaq 0x1c079(%rip), %rax     # 0x29728
cmpq %rsi, (%rax)
je 0xd6b5
retq
movq %rdi, (%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/history.c
// Function: history_remove
void history_remove(desktop_t *d, node_t *n, bool deep)
{
	/* removing from the newest to the oldest is required */
	/* for maintaining the *latest* attribute */
	history_t *b = history_tail;
	while (b != NULL) {
		if ((n != NULL && ((deep && is_descendant(b->loc.node, n)) || (!deep && b->loc.node == n))) ||
		    (n == NULL && d == b->loc.desktop)) {
			history_t *a = b->next;
			history_t *c = b->prev;
			if (a != NULL) {
				/* remove duplicate entries */
				while (c != NULL && ((a->loc.node != NULL && a->loc.node == c->loc.node) ||
				       (a->loc.node == NULL && a->loc.desktop == c->loc.desktop))) {
					history_t *p = c->prev;
					if (history_head == c) {
						history_head = history_tail;
					}
					if (history_needle == c) {
						history_needle = history_tail;
					}
					free(c);
					c = p;
				}
				a->prev = c;
			}
			if (c != NULL) {
				c->next = a;
			}
			if (history_tail == b) {
				history_tail = c;
			}
			if (history_head == b) {
				history_head = a;
			}
			if (history_needle == b) {
				history_needle = c;
			}
			free(b);
			b = c;
		} else {
			b = b->prev;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, 0x4(%rsp)
movq %rdi, 0x8(%rsp)
leaq 0x1c049(%rip), %rax     # 0x29720
movq (%rax), %r14
testq %r14, %r14
je 0xd7fa
movq %rsi, %r13
leaq 0x1c03b(%rip), %r15     # 0x29728
leaq 0x1c024(%rip), %rbx     # 0x29718
movq %rsi, 0x10(%rsp)
testq %r13, %r13
je 0xd7cf
movq 0x10(%r14), %rdi
cmpb $0x0, 0x4(%rsp)
je 0xd7f0
movq %r13, %rsi
callq 0x9dbb
testb %al, %al
je 0xd7de
movq 0x20(%r14), %r12
movq 0x28(%r14), %rbp
testq %rbp, %rbp
je 0xd790
testq %r12, %r12
je 0xd789
movq 0x10(%rbp), %rax
testq %rax, %rax
je 0xd745
cmpq 0x10(%r12), %rax
je 0xd750
jmp 0xd78c
movq 0x8(%rbp), %rax
cmpq 0x8(%r12), %rax
jne 0xd78c
cmpq %r12, (%r15)
jne 0xd762
leaq 0x1bfc4(%rip), %rax     # 0x29720
movq (%rax), %rax
movq %rax, (%r15)
cmpq %r12, (%rbx)
jne 0xd774
leaq 0x1bfb2(%rip), %rax     # 0x29720
movq (%rax), %rax
movq %rax, (%rbx)
movq 0x20(%r12), %r13
movq %r12, %rdi
callq 0x4460
movq %r13, %r12
testq %r13, %r13
jne 0xd733
xorl %r12d, %r12d
movq %r12, 0x20(%rbp)
testq %r12, %r12
je 0xd79a
movq %rbp, 0x28(%r12)
leaq 0x1bf7f(%rip), %rax     # 0x29720
cmpq %r14, (%rax)
jne 0xd7b0
leaq 0x1bf73(%rip), %rax     # 0x29720
movq %r12, (%rax)
cmpq %r14, (%r15)
jne 0xd7b8
movq %rbp, (%r15)
cmpq %r14, (%rbx)
jne 0xd7c0
movq %r12, (%rbx)
movq %r14, %rdi
callq 0x4460
movq 0x10(%rsp), %r13
jmp 0xd7e2
movq 0x8(%rsp), %rax
cmpq %rax, 0x8(%r14)
je 0xd721
movq 0x20(%r14), %r12
movq %r12, %r14
testq %r12, %r12
jne 0xd6f9
jmp 0xd7fa
cmpq %r13, %rdi
jne 0xd7de
jmp 0xd721
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/history.c
// Function: empty_history
void empty_history(void)
{
	history_t *h = history_head;
	while (h != NULL) {
		history_t *next = h->next;
		free(h);
		h = next;
	}
	history_head = history_tail = NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x1bf14(%rip), %rbx     # 0x29728
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xd82d
movq 0x28(%rdi), %r14
callq 0x4460
movq %r14, %rdi
testq %r14, %r14
jne 0xd81c
leaq 0x1beec(%rip), %rax     # 0x29720
xorl %ecx, %ecx
movq %rcx, (%rax)
movq %rcx, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/history.c
// Function: history_last_node
node_t *history_last_node(desktop_t *d, node_t *n)
{
	for (history_t *h = history_tail; h != NULL; h = h->prev) {
		if (h->latest && h->loc.node != NULL && !h->loc.node->hidden &&
		    !is_descendant(h->loc.node, n) && h->loc.desktop == d) {
			return h->loc.node;
		}
	}
	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x1becd(%rip), %rax     # 0x29720
movq (%rax), %r12
testq %r12, %r12
je 0xd89a
movq %rsi, %r14
movq %rdi, %r15
xorl %ebx, %ebx
cmpb $0x1, 0x18(%r12)
jne 0xd88e
movq 0x10(%r12), %rdi
testq %rdi, %rdi
je 0xd88e
cmpb $0x0, 0x25(%rdi)
jne 0xd88e
movq %r14, %rsi
callq 0x9dbb
testb %al, %al
jne 0xd88e
cmpq %r15, 0x8(%r12)
je 0xd8ab
movq 0x20(%r12), %r12
testq %r12, %r12
jne 0xd863
jmp 0xd89c
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x10(%r12), %rbx
jmp 0xd89c
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/history.c
// Function: history_find_newest_node
bool history_find_newest_node(coordinates_t *ref, coordinates_t *dst, node_select_t *sel)
{
	for (history_t *h = history_tail; h != NULL; h = h->prev) {
		if (h->loc.node == NULL ||
		    h->loc.node->hidden ||
		    !node_matches(&h->loc, ref, sel)) {
			continue;
		}
		*dst = h->loc;
		return true;
	}

	return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x1be0d(%rip), %rax     # 0x29720
movq (%rax), %r15
testq %r15, %r15
je 0xd94e
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r12
movq 0x10(%r15), %rax
testq %rax, %rax
je 0xd945
cmpb $0x0, 0x25(%rax)
jne 0xd945
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x191e4
testb %al, %al
jne 0xd95c
movq 0x20(%r15), %r15
testq %r15, %r15
jne 0xd924
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x10(%r15), %rax
movq %rax, 0x10(%rbx)
movups (%r15), %xmm0
movups %xmm0, (%rbx)
movb $0x1, %al
jmp 0xd950
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/history.c
// Function: history_find_node
bool history_find_node(history_dir_t hdi, coordinates_t *ref, coordinates_t *dst, node_select_t *sel)
{
	if (history_needle == NULL || record_history) {
		history_needle = history_tail;
	}

	history_t *h;
	for (h = history_needle; h != NULL; h = (hdi == HISTORY_OLDER ? h->prev : h->next)) {
		if (!h->latest ||
		    h->loc.node == NULL ||
		    h->loc.node == ref->node ||
		    h->loc.node->hidden ||
		    !node_matches(&h->loc, ref, sel)) {
			continue;
		}
		if (!record_history) {
			history_needle = h;
		}
		*dst = h->loc;
		return true;
	}
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %rbx
movq %rsi, %r12
leaq 0x1bd8e(%rip), %r13     # 0x29718
movq (%r13), %r14
testq %r14, %r14
je 0xd99f
leaq 0x1bdce(%rip), %rax     # 0x29768
cmpb $0x1, (%rax)
jne 0xd9b2
leaq 0x1bd7a(%rip), %rax     # 0x29720
movq (%rax), %r14
movq %r14, (%r13)
testq %r14, %r14
je 0xd9f9
xorl %eax, %eax
testl %edi, %edi
setne %al
leaq 0x20(,%rax,8), %rbp
cmpb $0x1, 0x18(%r14)
jne 0xd9f0
movq 0x10(%r14), %rax
testq %rax, %rax
je 0xd9f0
cmpq 0x10(%r12), %rax
je 0xd9f0
cmpb $0x0, 0x25(%rax)
jne 0xd9f0
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x191e4
testb %al, %al
jne 0xda0a
movq (%r14,%rbp), %r14
testq %r14, %r14
jne 0xd9c1
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1bd57(%rip), %rax     # 0x29768
cmpb $0x0, (%rax)
jne 0xda1a
movq %r14, (%r13)
movq 0x10(%r14), %rax
movq %rax, 0x10(%rbx)
movups (%r14), %xmm0
movups %xmm0, (%rbx)
movb $0x1, %al
jmp 0xd9fb
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/history.c
// Function: history_find_newest_desktop
bool history_find_newest_desktop(coordinates_t *ref, coordinates_t *dst, desktop_select_t *sel)
{
	for (history_t *h = history_tail; h != NULL; h = h->prev) {
		if (desktop_matches(&h->loc, ref, sel)) {
			*dst = h->loc;
			return true;
		}
	}

	return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x1bce4(%rip), %rax     # 0x29720
movq (%rax), %r15
testq %r15, %r15
je 0xda68
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r12
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x18fb4
testb %al, %al
jne 0xda6c
movq 0x20(%r15), %r15
testq %r15, %r15
jne 0xda4d
xorl %eax, %eax
jmp 0xda7d
movq 0x10(%r15), %rax
movq %rax, 0x10(%rbx)
movups (%r15), %xmm0
movups %xmm0, (%rbx)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/history.c
// Function: history_find_desktop
bool history_find_desktop(history_dir_t hdi, coordinates_t *ref, coordinates_t *dst, desktop_select_t *sel)
{
	if (history_needle == NULL || record_history) {
		history_needle = history_tail;
	}

	history_t *h;
	for (h = history_needle; h != NULL; h = (hdi == HISTORY_OLDER ? h->prev : h->next)) {
		if (!h->latest ||
		    h->loc.desktop == ref->desktop ||
		    !desktop_matches(&h->loc, ref, sel)) {
			continue;
		}
		if (!record_history) {
			history_needle = h;
		}
		*dst = h->loc;
		return true;
	}
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %rbx
movq %rsi, %r12
leaq 0x1bc74(%rip), %r13     # 0x29718
movq (%r13), %r14
testq %r14, %r14
je 0xdab9
leaq 0x1bcb4(%rip), %rax     # 0x29768
cmpb $0x1, (%rax)
jne 0xdacc
leaq 0x1bc60(%rip), %rax     # 0x29720
movq (%rax), %r14
movq %r14, (%r13)
testq %r14, %r14
je 0xdb08
xorl %eax, %eax
testl %edi, %edi
setne %al
leaq 0x20(,%rax,8), %rbp
cmpb $0x1, 0x18(%r14)
jne 0xdaff
movq 0x8(%r14), %rax
cmpq 0x8(%r12), %rax
je 0xdaff
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x18fb4
testb %al, %al
jne 0xdb19
movq (%r14,%rbp), %r14
testq %r14, %r14
jne 0xdadb
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1bc48(%rip), %rax     # 0x29768
cmpb $0x0, (%rax)
jne 0xdb29
movq %r14, (%r13)
movq 0x10(%r14), %rax
movq %rax, 0x10(%rbx)
movups (%r14), %xmm0
movups %xmm0, (%rbx)
movb $0x1, %al
jmp 0xdb0a
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/history.c
// Function: history_find_newest_monitor
bool history_find_newest_monitor(coordinates_t *ref, coordinates_t *dst, monitor_select_t *sel)
{
	for (history_t *h = history_tail; h != NULL; h = h->prev) {
		if (monitor_matches(&h->loc, ref, sel)) {
			*dst = h->loc;
			return true;
		}
	}

	return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x1bbd5(%rip), %rax     # 0x29720
movq (%rax), %r15
testq %r15, %r15
je 0xdb77
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r12
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x18f6e
testb %al, %al
jne 0xdb7b
movq 0x20(%r15), %r15
testq %r15, %r15
jne 0xdb5c
xorl %eax, %eax
jmp 0xdb8c
movq 0x10(%r15), %rax
movq %rax, 0x10(%rbx)
movups (%r15), %xmm0
movups %xmm0, (%rbx)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/history.c
// Function: history_find_monitor
bool history_find_monitor(history_dir_t hdi, coordinates_t *ref, coordinates_t *dst, monitor_select_t *sel)
{
	if (history_needle == NULL || record_history) {
		history_needle = history_tail;
	}

	history_t *h;

	for (h = history_needle; h != NULL; h = (hdi == HISTORY_OLDER ? h->prev : h->next)) {
		if (!h->latest ||
		    h->loc.monitor == ref->monitor ||
		    !monitor_matches(&h->loc, ref, sel)) {
			continue;
		}
		if (!record_history) {
			history_needle = h;
		}
		*dst = h->loc;
		return true;
	}

	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %rbx
movq %rsi, %r12
leaq 0x1bb65(%rip), %r13     # 0x29718
movq (%r13), %r14
testq %r14, %r14
je 0xdbc8
leaq 0x1bba5(%rip), %rax     # 0x29768
cmpb $0x1, (%rax)
jne 0xdbdb
leaq 0x1bb51(%rip), %rax     # 0x29720
movq (%rax), %r14
movq %r14, (%r13)
testq %r14, %r14
je 0xdc15
xorl %eax, %eax
testl %edi, %edi
setne %al
leaq 0x20(,%rax,8), %rbp
cmpb $0x1, 0x18(%r14)
jne 0xdc0c
movq (%r14), %rax
cmpq (%r12), %rax
je 0xdc0c
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x18f6e
testb %al, %al
jne 0xdc26
movq (%r14,%rbp), %r14
testq %r14, %r14
jne 0xdbea
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1bb3b(%rip), %rax     # 0x29768
cmpb $0x0, (%rax)
jne 0xdc36
movq %r14, (%r13)
movq 0x10(%r14), %rax
movq %rax, 0x10(%rbx)
movups (%r14), %xmm0
movups %xmm0, (%rbx)
movb $0x1, %al
jmp 0xdc17
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/history.c
// Function: history_rank
uint32_t history_rank(node_t *n)
{
	uint32_t r = 0;
	history_t *h = history_tail;
	while (h != NULL && (!h->latest || h->loc.node != n)) {
		h = h->prev;
		r++;
	}
	if (h == NULL) {
		return UINT32_MAX;
	} else {
		return r;
	}
}

// Assembly:
leaq 0x1bad0(%rip), %rax     # 0x29720
movq (%rax), %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rcx, %rcx
je 0xdc76
xorl %edx, %edx
cmpb $0x1, 0x18(%rcx)
jne 0xdc6b
cmpq %rdi, 0x10(%rcx)
je 0xdc77
incl %edx
movq 0x20(%rcx), %rcx
testq %rcx, %rcx
jne 0xdc5f
retq
movl %edx, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/events.c
// Function: client_message
void client_message(xcb_generic_event_t *evt)
{
	xcb_client_message_event_t *e = (xcb_client_message_event_t *) evt;

	if (e->type == ewmh->_NET_CURRENT_DESKTOP) {
		coordinates_t loc;
		if (ewmh_locate_desktop(e->data.data32[0], &loc)) {
			focus_node(loc.monitor, loc.desktop, loc.desktop->focus);
		}
		return;
	}

	coordinates_t loc;
	if (!locate_window(e->window, &loc)) {
		for (pending_rule_t *pr = pending_rule_head; pr != NULL; pr = pr->next) {
			if (pr->win == e->window) {
				postpone_event(pr, evt);
				break;
			}
		}
		return;
	}

	if (e->type == ewmh->_NET_WM_STATE) {
		handle_state(loc.monitor, loc.desktop, loc.node, e->data.data32[1], e->data.data32[0]);
		handle_state(loc.monitor, loc.desktop, loc.node, e->data.data32[2], e->data.data32[0]);
	} else if (e->type == ewmh->_NET_ACTIVE_WINDOW) {
		if ((ignore_ewmh_focus && e->data.data32[0] == XCB_EWMH_CLIENT_SOURCE_TYPE_NORMAL) ||
		    loc.node == mon->desk->focus) {
			return;
		}
		focus_node(loc.monitor, loc.desktop, loc.node);
	} else if (e->type == ewmh->_NET_WM_DESKTOP) {
		coordinates_t dloc;
		if (ewmh_locate_desktop(e->data.data32[0], &dloc)) {
			transfer_node(loc.monitor, loc.desktop, loc.node, dloc.monitor, dloc.desktop, dloc.desktop->focus, false);
		}
	} else if (e->type == ewmh->_NET_CLOSE_WINDOW) {
		close_node(loc.node);
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movl 0x8(%rdi), %eax
leaq 0x1c09d(%rip), %r14     # 0x29e30
movq (%r14), %rcx
cmpl 0x38(%rcx), %eax
jne 0xddc8
movl 0xc(%rbx), %edi
leaq 0x8(%rsp), %rsi
callq 0x1db29
testb %al, %al
je 0xde88
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x38(%rsi), %rdx
callq 0xa308
jmp 0xde88
movl 0x4(%rbx), %edi
leaq 0x8(%rsp), %rsi
callq 0x1ae3e
testb %al, %al
je 0xde1f
movl 0x8(%rbx), %eax
movq (%r14), %rcx
cmpl 0x84(%rcx), %eax
jne 0xde41
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movl 0xc(%rbx), %r8d
movl 0x10(%rbx), %ecx
callq 0xe7a9
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movl 0xc(%rbx), %r8d
movl 0x14(%rbx), %ecx
callq 0xe7a9
jmp 0xde88
leaq 0x1b8b2(%rip), %rax     # 0x296d8
movq (%rax), %rdi
testq %rdi, %rdi
je 0xde88
movl 0x4(%rbx), %eax
cmpl %eax, 0x4(%rdi)
je 0xde80
movq 0x28(%rdi), %rdi
testq %rdi, %rdi
jne 0xde31
jmp 0xde88
cmpl 0x40(%rcx), %eax
jne 0xde90
leaq 0x1bfb2(%rip), %rax     # 0x29dff
cmpb $0x1, (%rax)
jne 0xde58
cmpl $0x1, 0xc(%rbx)
je 0xde88
movq 0x18(%rsp), %rdx
leaq 0x1b8ac(%rip), %rax     # 0x29710
movq (%rax), %rax
movq 0x58(%rax), %rax
cmpq 0x38(%rax), %rdx
je 0xde88
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
jmp 0xddbe
movq %rbx, %rsi
callq 0x1cd98
addq $0x38, %rsp
popq %rbx
popq %r14
retq
cmpl 0x7c(%rcx), %eax
jne 0xded1
movl 0xc(%rbx), %edi
leaq 0x20(%rsp), %rsi
callq 0x1db29
testb %al, %al
je 0xde88
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0x38(%r8), %r9
movl $0x0, (%rsp)
callq 0x9e6b
jmp 0xde88
cmpl 0x58(%rcx), %eax
jne 0xde88
movq 0x18(%rsp), %rdi
callq 0xb801
jmp 0xde88
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/events.c
// Function: enter_notify
void enter_notify(xcb_generic_event_t *evt)
{
	xcb_enter_notify_event_t *e = (xcb_enter_notify_event_t *) evt;
	xcb_window_t win = e->event;

	if (e->mode != XCB_NOTIFY_MODE_NORMAL || e->detail == XCB_NOTIFY_DETAIL_INFERIOR) {
		return;
	}

	/* Ignore the enter notify events that we generated by unmapping the motion
	 * recorder window in `query_pointer`. */
	if (motion_recorder.enabled && motion_recorder.sequence == e->sequence) {
		return;
	}

	if (win == mon->root || (mon->desk->focus != NULL &&
	                         (win == mon->desk->focus->id ||
	                          (mon->desk->focus->presel != NULL &&
	                           win == mon->desk->focus->presel->feedback)))) {
		return;
	}

	update_motion_recorder();
}

// Assembly:
cmpb $0x0, 0x1e(%rdi)
jne 0xe470
cmpb $0x2, 0x1(%rdi)
je 0xe470
movl 0xc(%rdi), %eax
leaq 0x1b2c2(%rip), %rcx     # 0x296e8
cmpb $0x1, 0x6(%rcx)
jne 0xe436
movzwl 0x4(%rcx), %ecx
cmpw 0x2(%rdi), %cx
je 0xe470
leaq 0x1b2d3(%rip), %rcx     # 0x29710
movq (%rcx), %rcx
cmpl 0x28(%rcx), %eax
je 0xe470
movq 0x58(%rcx), %rcx
movq 0x38(%rcx), %rcx
testq %rcx, %rcx
je 0x1113f
cmpl (%rcx), %eax
je 0xe470
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
je 0x1113f
cmpl 0xc(%rcx), %eax
jne 0x1113f
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl 0x4(%rdi), %eax
movl %eax, %ecx
subl 0x1b98b(%rip), %ecx     # 0x29e18
cmpl $0x3e9, %ecx            # imm = 0x3E9
jb 0xe4b6
movl %eax, 0x1b97d(%rip)     # 0x29e18
movzwl 0x18(%rbx), %eax
movw %ax, 0x1b96c(%rip)      # 0x29e12
movzwl 0x1a(%rbx), %eax
movw %ax, 0x1b963(%rip)      # 0x29e14
jmp 0xe5a7
movswl 0x18(%rbx), %eax
movzwl 0x1b951(%rip), %ecx     # 0x29e12
subl %ecx, %eax
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
movswl 0x1a(%rbx), %eax
movzwl 0x1b93f(%rip), %edx     # 0x29e14
subl %edx, %eax
movl %eax, %edx
negl %edx
cmovsl %eax, %edx
addl %ecx, %edx
cmpl $0xa, %edx
jb 0xe5a7
callq 0x112ba
leaq 0xc(%rsp), %r14
movl $0x0, (%r14)
xorl %r15d, %r15d
movq %r14, %rdi
xorl %esi, %esi
callq 0x1095f
leaq 0x1b8ed(%rip), %rax     # 0x29dfb
movb (%rax), %bpl
leaq 0x1b8e4(%rip), %r12     # 0x29dfc
movb (%r12), %r13b
movb %r15b, (%rax)
movb %r15b, (%r12)
leaq 0x1b241(%rip), %rax     # 0x2976b
movb %r15b, (%rax)
movq %rax, %r15
movl (%r14), %edi
leaq 0x10(%rsp), %rsi
callq 0x1ae3e
testb %al, %al
je 0xe56c
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
cmpq %rsi, 0x58(%rdi)
jne 0xe595
movq 0x20(%rsp), %rdx
leaq 0x1b1b3(%rip), %rax     # 0x29710
movq (%rax), %rax
movq 0x58(%rax), %rax
cmpq 0x38(%rax), %rdx
jne 0xe590
jmp 0xe595
movl 0x14(%rbx), %edi
callq 0x7446
testq %rax, %rax
je 0xe595
leaq 0x1b190(%rip), %rcx     # 0x29710
cmpq (%rcx), %rax
je 0xe595
movq 0x58(%rax), %rsi
movq 0x38(%rsi), %rdx
movq %rax, %rdi
callq 0xa308
leaq 0x1b85f(%rip), %rax     # 0x29dfb
movb %bpl, (%rax)
movb %r13b, (%r12)
movb $0x1, (%r15)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/events.c
// Function: button_press
void button_press(xcb_generic_event_t *evt)
{
	xcb_button_press_event_t *e = (xcb_button_press_event_t *) evt;
	bool replay = false;
	for (unsigned int i = 0; i < LENGTH(BUTTONS); i++) {
		if (e->detail != BUTTONS[i]) {
			continue;
		}
		if ((click_to_focus == (int8_t) XCB_BUTTON_INDEX_ANY || click_to_focus == (int8_t) BUTTONS[i]) &&
			cleaned_mask(e->state) == XCB_NONE) {
			bool pff = pointer_follows_focus;
			bool pfm = pointer_follows_monitor;
			pointer_follows_focus = false;
			pointer_follows_monitor = false;
			replay = !grab_pointer(ACTION_FOCUS) || !swallow_first_click;
			pointer_follows_focus = pff;
			pointer_follows_monitor = pfm;
		} else {
			grab_pointer(pointer_actions[i]);
		}
	}
	xcb_allow_events(dpy, replay ? XCB_ALLOW_REPLAY_POINTER : XCB_ALLOW_SYNC_POINTER, e->time);
	xcb_flush(dpy);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x11459(%rip), %r15     # 0x1fa24
leaq 0x1b82b(%rip), %r14     # 0x29dfd
leaq 0x1b847(%rip), %r12     # 0x29e20
leaq 0x1b844(%rip), %rbp     # 0x29e24
xorl %r13d, %r13d
movl $0x0, 0x4(%rsp)
movzbl 0x1(%rbx), %eax
cmpl %eax, (%r13,%r15)
jne 0xe638
movb (%r14), %cl
testb %cl, %cl
setne %dl
cmpb %cl, %al
setne %al
testb %al, %dl
jne 0xe628
movzwl 0x1c(%rbx), %eax
movzwl (%rbp), %ecx
movzwl (%r12), %edx
orl %ecx, %edx
leaq 0x1b805(%rip), %rcx     # 0x29e22
movzwl (%rcx), %ecx
orl %edx, %ecx
notl %ecx
testl %eax, %ecx
je 0xe644
leaq 0x1b7b9(%rip), %rax     # 0x29de8
movl (%rax,%r13), %edi
callq 0xf28a
addq $0x4, %r13
cmpq $0xc, %r13
jne 0xe5eb
jmp 0xe6b1
leaq 0x1b7b0(%rip), %rbp     # 0x29dfb
movb (%rbp), %r14b
leaq 0x1b7a6(%rip), %r12     # 0x29dfc
movb (%r12), %al
movb %al, 0x3(%rsp)
xorl %eax, %eax
movb %al, (%rbp)
movb %al, (%r12)
movl $0x1, %edi
callq 0xf28a
leaq 0x1b786(%rip), %rcx     # 0x29dfe
movb (%rcx), %cl
xorb $0x1, %cl
movzbl %cl, %ecx
testb %al, %al
movl $0x1, %eax
cmovel %eax, %ecx
movl %ecx, 0x4(%rsp)
movb %r14b, (%rbp)
leaq 0x1b764(%rip), %r14     # 0x29dfd
leaq 0x1b784(%rip), %rbp     # 0x29e24
movb 0x3(%rsp), %al
movb %al, (%r12)
leaq 0x1b771(%rip), %r12     # 0x29e20
jmp 0xe638
leaq 0x1b010(%rip), %r14     # 0x296c8
movq (%r14), %rdi
movl 0x4(%rbx), %edx
movzbl 0x4(%rsp), %esi
andl $0x1, %esi
incl %esi
callq 0x4140
movq (%r14), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4660
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/events.c
// Function: focus_in
void focus_in(xcb_generic_event_t *evt)
{
	xcb_focus_in_event_t *e = (xcb_focus_in_event_t *) evt;

	if (e->mode == XCB_NOTIFY_MODE_GRAB || e->mode == XCB_NOTIFY_MODE_UNGRAB
	    || e->detail == XCB_NOTIFY_DETAIL_POINTER || e->detail == XCB_NOTIFY_DETAIL_POINTER_ROOT
	    || e->detail == XCB_NOTIFY_DETAIL_NONE) {
		return;
	}

	if (mon->desk->focus != NULL) {
		if (e->event == mon->desk->focus->id) {
			return;
		}
		if (e->event == root) {
			/* Some clients expect the window manager to refocus the
			   focused window in this case */
			focus_node(mon, mon->desk, mon->desk->focus);
			return;
		}
	}

	coordinates_t loc;
	if (locate_window(e->event, &loc)) {
		// prevent input focus stealing
		update_input_focus();
	}
}

// Assembly:
movb 0x8(%rdi), %al
decb %al
cmpb $0x2, %al
jb 0xe73f
movb 0x1(%rdi), %al
addb $-0x5, %al
cmpb $0x3, %al
jb 0xe73f
leaq 0x1b014(%rip), %rax     # 0x29710
movq (%rax), %rax
movq 0x58(%rax), %rsi
movq 0x38(%rsi), %rdx
movl 0x4(%rdi), %edi
testq %rdx, %rdx
je 0xe726
cmpl (%rdx), %edi
je 0xe73f
leaq 0x1b05e(%rip), %rcx     # 0x29778
cmpl (%rcx), %edi
jne 0xe726
movq %rax, %rdi
jmp 0xa308
subq $0x18, %rsp
movq %rsp, %rsi
callq 0x1ae3e
testb %al, %al
je 0xe73b
callq 0x11483
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/pointer.c
// Function: pointer_init
void pointer_init(void)
{
	num_lock = modfield_from_keysym(XK_Num_Lock);
	caps_lock = modfield_from_keysym(XK_Caps_Lock);
	scroll_lock = modfield_from_keysym(XK_Scroll_Lock);
	if (caps_lock == XCB_NO_SYMBOL) {
		caps_lock = XCB_MOD_MASK_LOCK;
	}
	grabbing = false;
	grabbed_node = NULL;
}

// Assembly:
pushq %rax
movl $0xff7f, %edi           # imm = 0xFF7F
callq 0xecbf
movw %ax, 0x1b1aa(%rip)      # 0x29e20
movl $0xffe5, %edi           # imm = 0xFFE5
callq 0xecbf
movw %ax, 0x1b19b(%rip)      # 0x29e22
movl $0xff14, %edi           # imm = 0xFF14
callq 0xecbf
movw %ax, 0x1b18c(%rip)      # 0x29e24
cmpw $0x0, 0x1b182(%rip)     # 0x29e22
jne 0xecab
movw $0x2, 0x1b177(%rip)     # 0x29e22
movb $0x0, 0x1b174(%rip)     # 0x29e26
movq $0x0, 0x1b16b(%rip) # 0x29e28
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/pointer.c
// Function: modfield_from_keysym
int16_t modfield_from_keysym(xcb_keysym_t keysym)
{
	uint16_t modfield = 0;
	xcb_keycode_t *keycodes = NULL, *mod_keycodes = NULL;
	xcb_get_modifier_mapping_reply_t *reply = NULL;
	xcb_key_symbols_t *symbols = xcb_key_symbols_alloc(dpy);

	if ((keycodes = xcb_key_symbols_get_keycode(symbols, keysym)) == NULL ||
	    (reply = xcb_get_modifier_mapping_reply(dpy, xcb_get_modifier_mapping(dpy), NULL)) == NULL ||
	    reply->keycodes_per_modifier < 1 ||
	    (mod_keycodes = xcb_get_modifier_mapping_keycodes(reply)) == NULL) {
		goto end;
	}

	unsigned int num_mod = xcb_get_modifier_mapping_keycodes_length(reply) / reply->keycodes_per_modifier;
	for (unsigned int i = 0; i < num_mod; i++) {
		for (unsigned int j = 0; j < reply->keycodes_per_modifier; j++) {
			xcb_keycode_t mk = mod_keycodes[i * reply->keycodes_per_modifier + j];
			if (mk == XCB_NO_SYMBOL) {
				continue;
			}
			for (xcb_keycode_t *k = keycodes; *k != XCB_NO_SYMBOL; k++) {
				if (*k == mk) {
					modfield |= (1 << i);
				}
			}
		}
	}

end:
	xcb_key_symbols_free(symbols);
	free(keycodes);
	free(reply);
	return modfield;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebp
leaq 0x1a9f5(%rip), %rbx     # 0x296c8
movq (%rbx), %rdi
callq 0x4590
movq %rax, %r15
movq %rax, %rdi
movl %ebp, %esi
callq 0x4040
movq %rax, %r14
testq %rax, %rax
je 0xedb5
movq %r15, (%rsp)
movq (%rbx), %r15
movq %r15, %rdi
callq 0x4a50
xorl %r12d, %r12d
movq %r15, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x4880
testq %rax, %rax
je 0xedc6
movq %rax, %r15
cmpb $0x0, 0x1(%rax)
je 0xedbc
movq %r15, %rdi
callq 0x4800
testq %rax, %rax
je 0xedbc
movq %rax, %r12
movq %r15, %rdi
callq 0x4970
movzbl 0x1(%r15), %esi
cltd
idivl %esi
xorl %ecx, %ecx
testl %eax, %eax
je 0xedc3
cmpl $0x1, %esi
movl %esi, %edx
adcl $0x0, %edx
movq %r14, %rdi
incq %rdi
xorl %ebp, %ebp
movl %ecx, %r8d
imull %esi, %r8d
movl $0x1, %r9d
shll %cl, %r9d
xorl %r10d, %r10d
leal (%r8,%r10), %r11d
movb (%r12,%r11), %r11b
testb %r11b, %r11b
je 0xeda5
movb (%r14), %bl
testb %bl, %bl
je 0xeda5
movq %rdi, %r13
cmpb %r11b, %bl
movl $0x0, %ebx
cmovel %r9d, %ebx
orl %ebx, %ebp
movb (%r13), %bl
incq %r13
testb %bl, %bl
jne 0xed8c
incq %r10
cmpq %rdx, %r10
jne 0xed75
incl %ecx
cmpl %eax, %ecx
jne 0xed62
jmp 0xedbe
xorl %r12d, %r12d
xorl %ebp, %ebp
jmp 0xedcc
xorl %ebp, %ebp
movq %r15, %r12
jmp 0xedc8
movq %r15, %r12
xorl %ebp, %ebp
movq (%rsp), %r15
movq %r15, %rdi
callq 0x4780
movq %r14, %rdi
callq 0x4460
movq %r12, %rdi
callq 0x4460
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/pointer.c
// Function: window_grab_buttons
void window_grab_buttons(xcb_window_t win)
{
	for (unsigned int i = 0; i < LENGTH(BUTTONS); i++) {
		if (click_to_focus == (int8_t) XCB_BUTTON_INDEX_ANY || click_to_focus == (int8_t) BUTTONS[i]) {
			window_grab_button(win, BUTTONS[i], XCB_NONE);
		}
		if (pointer_actions[i] != ACTION_NONE) {
			window_grab_button(win, BUTTONS[i], pointer_modifier);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
xorl %r14d, %r14d
leaq 0x1aff1(%rip), %r15     # 0x29dfd
leaq 0x10c41(%rip), %r12     # 0x1fa54
leaq 0x1afce(%rip), %r13     # 0x29de8
movsbl (%r15), %eax
testl %eax, %eax
je 0xee30
movl (%r14,%r12), %ebp
movsbl %bpl, %ecx
cmpl %eax, %ecx
je 0xee34
jmp 0xee41
movl (%r14,%r12), %ebp
movzbl %bpl, %esi
movl %ebx, %edi
xorl %edx, %edx
callq 0xee77
cmpl $0x0, (%r13,%r14)
je 0xee5e
leaq 0x1af90(%rip), %rax     # 0x29de0
movzwl (%rax), %edx
movzbl %bpl, %esi
movl %ebx, %edi
callq 0xee77
addq $0x4, %r14
cmpq $0xc, %r14
jne 0xee1a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/pointer.c
// Function: grab_buttons
void grab_buttons(void)
{
	for (monitor_t *m = mon_head; m != NULL; m = m->next) {
		for (desktop_t *d = m->desk_head; d != NULL; d = d->next) {
			for (node_t *n = first_extrema(d->root); n != NULL; n = next_leaf(n, d->root)) {
				window_grab_buttons(n->id);
				if (n->presel != NULL) {
					window_grab_buttons(n->presel->feedback);
				}
			}
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0x1a622(%rip), %rax     # 0x29708
movq (%rax), %r14
testq %r14, %r14
je 0xf13a
movq 0x60(%r14), %r15
testq %r15, %r15
je 0xf134
movq 0x30(%r15), %rdi
callq 0x920c
movq %rax, %rbx
testq %rax, %rax
je 0xf12e
movl (%rbx), %edi
callq 0xedf5
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0xf120
movl 0xc(%rax), %edi
callq 0xedf5
movq 0x30(%r15), %rsi
movq %rbx, %rdi
callq 0x926e
jmp 0xf100
movq 0x48(%r15), %r15
jmp 0xf0f2
movq 0x78(%r14), %r14
jmp 0xf0e9
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/pointer.c
// Function: ungrab_buttons
void ungrab_buttons(void)
{
	for (monitor_t *m = mon_head; m != NULL; m = m->next) {
		for (desktop_t *d = m->desk_head; d != NULL; d = d->next) {
			for (node_t *n = first_extrema(d->root); n != NULL; n = next_leaf(n, d->root)) {
				xcb_ungrab_button(dpy, XCB_BUTTON_INDEX_ANY, n->id, XCB_MOD_MASK_ANY);
			}
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x1a5b9(%rip), %rax     # 0x29708
movq (%rax), %r14
testq %r14, %r14
je 0xf1a9
leaq 0x1a56a(%rip), %r15     # 0x296c8
movq 0x60(%r14), %r12
testq %r12, %r12
je 0xf1a0
movq 0x30(%r12), %rdi
callq 0x920c
movq %rax, %rbx
testq %rax, %rax
je 0xf199
movq (%r15), %rdi
movl (%rbx), %edx
xorl %esi, %esi
movl $0x8000, %ecx           # imm = 0x8000
callq 0x4840
movq 0x30(%r12), %rsi
movq %rbx, %rdi
callq 0x926e
jmp 0xf171
movq 0x48(%r12), %r12
jmp 0xf162
movq 0x78(%r14), %r14
testq %r14, %r14
jne 0xf15e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/pointer.c
// Function: get_handle
resize_handle_t get_handle(node_t *n, xcb_point_t pos, pointer_action_t pac)
{
	resize_handle_t rh = HANDLE_BOTTOM_RIGHT;
	xcb_rectangle_t rect = get_rectangle(NULL, NULL, n);
	if (pac == ACTION_RESIZE_SIDE) {
		float W = rect.width;
		float H = rect.height;
		float ratio = W / H;
		float x = pos.x - rect.x;
		float y = pos.y - rect.y;
		float diag_a = ratio * y;
		float diag_b = W - diag_a;
		if (x < diag_a) {
			if (x < diag_b) {
				rh = HANDLE_LEFT;
			} else {
				rh = HANDLE_BOTTOM;
			}
		} else {
			if (x < diag_b) {
				rh = HANDLE_TOP;
			} else {
				rh = HANDLE_RIGHT;
			}
		}
	} else if (pac == ACTION_RESIZE_CORNER) {
		int16_t mid_x = rect.x + (rect.width / 2);
		int16_t mid_y = rect.y + (rect.height / 2);
		if (pos.x > mid_x) {
			if (pos.y > mid_y) {
				rh = HANDLE_BOTTOM_RIGHT;
			} else {
				rh = HANDLE_TOP_RIGHT;
			}
		} else {
			if (pos.y > mid_y) {
				rh = HANDLE_BOTTOM_LEFT;
			} else {
				rh = HANDLE_TOP_LEFT;
			}
		}
	}
	return rh;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %ebx
movq %rdi, %rdx
xorl %edi, %edi
xorl %esi, %esi
callq 0x970b
movl %eax, %edx
shrl $0x10, %edx
cmpl $0x4, %ebp
je 0xf23f
movl $0xc, %ecx
cmpl $0x3, %ebp
jne 0xf281
movq %rax, %rcx
movq %rax, %rsi
shrq $0x20, %rsi
movzwl %si, %esi
cvtsi2ss %esi, %xmm0
shrq $0x30, %rcx
cvtsi2ss %ecx, %xmm1
movswl %bx, %ecx
cwtl
subl %eax, %ecx
cvtsi2ss %ecx, %xmm2
sarl $0x10, %ebx
movswl %dx, %eax
subl %eax, %ebx
cvtsi2ss %ebx, %xmm3
movaps %xmm0, %xmm4
divss %xmm1, %xmm4
mulss %xmm4, %xmm3
subss %xmm3, %xmm0
xorl %eax, %eax
ucomiss %xmm2, %xmm0
movl $0x1, %ecx
movl $0x8, %edx
cmoval %ecx, %edx
setbe %al
ucomiss %xmm2, %xmm3
leal 0x2(%rax,%rax), %ecx
cmoval %edx, %ecx
jmp 0xf281
movq %rax, %rcx
shrq $0x21, %rcx
andl $0x7fff, %ecx           # imm = 0x7FFF
addl %eax, %ecx
shrq $0x31, %rax
addl %eax, %edx
movswl %bx, %esi
movswl %cx, %ecx
sarl $0x10, %ebx
movswl %dx, %eax
cmpl %ecx, %esi
jle 0xf272
cmpl %eax, %ebx
movl $0xc, %eax
movl $0x6, %ecx
jmp 0xf27e
cmpl %eax, %ebx
movl $0x9, %eax
movl $0x3, %ecx
cmovgl %eax, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/window.c
// Function: schedule_window
void schedule_window(xcb_window_t win)
{
	coordinates_t loc;
	uint8_t override_redirect = 0;
	xcb_get_window_attributes_reply_t *wa = xcb_get_window_attributes_reply(dpy, xcb_get_window_attributes(dpy, win), NULL);

	if (wa != NULL) {
		override_redirect = wa->override_redirect;
		free(wa);
	}

	if (override_redirect || locate_window(win, &loc)) {
		return;
	}

	/* ignore pending windows */
	for (pending_rule_t *pr = pending_rule_head; pr != NULL; pr = pr->next) {
		if (pr->win == win) {
			return;
		}
	}

	rule_consequence_t *csq = make_rule_consequence();
	apply_rules(win, csq);
	if (!schedule_rules(win, csq)) {
		manage_window(win, csq, -1);
		free(csq);
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edi, %ebx
leaq 0x19f2b(%rip), %rax     # 0x296c8
movq (%rax), %r14
movq %r14, %rdi
movl %ebx, %esi
callq 0x4810
movq %r14, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x44b0
testq %rax, %rax
je 0xf7cc
movb 0x1b(%rax), %bpl
movq %rax, %rdi
callq 0x4460
testb %bpl, %bpl
jne 0xf82d
leaq 0x8(%rsp), %rsi
movl %ebx, %edi
callq 0x1ae3e
testb %al, %al
jne 0xf82d
leaq 0x19ef5(%rip), %rax     # 0x296d8
movq (%rax), %rax
testq %rax, %rax
je 0xf7f6
cmpl %ebx, 0x4(%rax)
je 0xf82d
movq 0x28(%rax), %rax
jmp 0xf7e6
callq 0x1cc90
movq %rax, %r14
movl %ebx, %edi
movq %rax, %rsi
callq 0x1d6b7
movl %ebx, %edi
movq %r14, %rsi
callq 0x1d7ee
testb %al, %al
jne 0xf82d
movl %ebx, %edi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0xf836
movq %r14, %rdi
callq 0x4460
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/window.c
// Function: initialize_floating_rectangle
void initialize_floating_rectangle(node_t *n)
{
	client_t *c = n->client;

	xcb_get_geometry_reply_t *geo = xcb_get_geometry_reply(dpy, xcb_get_geometry(dpy, n->id), NULL);

	if (geo != NULL) {
		c->floating_rectangle = (xcb_rectangle_t) {geo->x, geo->y, geo->width, geo->height};
	}

	free(geo);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x48(%rdi), %r14
leaq 0x19844(%rip), %rax     # 0x296c8
movq (%rax), %rbx
movl (%rdi), %esi
movq %rbx, %rdi
callq 0x45c0
movq %rbx, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x46a0
testq %rax, %rax
je 0xfead
movq 0xc(%rax), %rcx
movq %rcx, 0x318(%r14)
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4460
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/window.c
// Function: window_center
void window_center(monitor_t *m, client_t *c)
{
	xcb_rectangle_t *r = &c->floating_rectangle;
	xcb_rectangle_t a = m->rectangle;
	if (r->width >= a.width) {
		r->x = a.x;
	} else {
		r->x = a.x + (a.width - r->width) / 2;
	}
	if (r->height >= a.height) {
		r->y = a.y;
	} else {
		r->y = a.y + (a.height - r->height) / 2;
	}
	r->x -= c->border_width;
	r->y -= c->border_width;
}

// Assembly:
movzwl 0x4c(%rdi), %eax
movzwl 0x50(%rdi), %edx
movzwl 0x52(%rdi), %ecx
movzwl 0x31c(%rsi), %r8d
cmpw %dx, %r8w
jae 0xfee9
subl %r8d, %edx
movl %edx, %r8d
shrl $0x1f, %r8d
addl %edx, %r8d
shrl %r8d
addl %r8d, %eax
movzwl 0x4e(%rdi), %edx
movzwl 0x31e(%rsi), %edi
cmpw %cx, %di
jae 0xff06
subl %edi, %ecx
movl %ecx, %edi
shrl $0x1f, %edi
addl %ecx, %edi
shrl %edi
addl %edi, %edx
movl 0x300(%rsi), %ecx
subl %ecx, %eax
movw %ax, 0x318(%rsi)
subl %ecx, %edx
movw %dx, 0x31a(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/window.c
// Function: draw_border
void draw_border(node_t *n, bool focused_node, bool focused_monitor)
{
	if (n == NULL) {
		return;
	}

	uint32_t border_color_pxl = get_border_color(focused_node, focused_monitor);
	for (node_t *f = first_extrema(n); f != NULL; f = next_leaf(f, n)) {
		if (f->client != NULL) {
			window_draw_border(f->id, border_color_pxl);
		}
	}
}

// Assembly:
testq %rdi, %rdi
je 0xfffa
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
testb %dl, %dl
je 0xff86
leaq 0x19c1c(%rip), %rdi     # 0x29ba0
jmp 0xff8d
leaq 0x19b13(%rip), %rdi     # 0x29aa0
testb %sil, %sil
jne 0xff99
leaq 0x19a07(%rip), %rdi     # 0x299a0
callq 0x5c17
movl %eax, %ebp
movq %rbx, %rdi
callq 0x920c
testq %rax, %rax
je 0xffee
movq %rax, %r14
leaq 0x19711(%rip), %r12     # 0x296c8
leaq 0xc(%rsp), %r15
cmpq $0x0, 0x48(%r14)
je 0xffdb
movl (%r14), %esi
movl %ebp, 0xc(%rsp)
movq (%r12), %rdi
movl $0x8, %edx
movq %r15, %rcx
callq 0x4700
movq %r14, %rdi
movq %rbx, %rsi
callq 0x926e
movq %rax, %r14
testq %rax, %rax
jne 0xffbc
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/window.c
// Function: unmanage_window
void unmanage_window(xcb_window_t win)
{
	coordinates_t loc;
	if (locate_window(win, &loc)) {
		put_status(SBSC_MASK_NODE_REMOVE, "node_remove 0x%08X 0x%08X 0x%08X\n", loc.monitor->id, loc.desktop->id, win);
		remove_node(loc.monitor, loc.desktop, loc.node);
		arrange(loc.monitor, loc.desktop);
	} else {
		for (pending_rule_t *pr = pending_rule_head; pr != NULL; pr = pr->next) {
			if (pr->win == win) {
				remove_pending_rule(pr);
				return;
			}
		}
	}
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movl %edi, %ebx
leaq 0x8(%rsp), %rsi
callq 0x1ae3e
testb %al, %al
je 0x1005b
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
movl 0x20(%rax), %edx
movl 0x20(%rcx), %ecx
leaq 0xf746(%rip), %rsi      # 0x1f76d
movl $0x10000, %edi          # imm = 0x10000
movl %ebx, %r8d
xorl %eax, %eax
callq 0x1e6b8
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
callq 0xb924
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x8958
jmp 0x1007a
leaq 0x19676(%rip), %rax     # 0x296d8
movq (%rax), %rdi
testq %rdi, %rdi
je 0x1007a
cmpl %ebx, 0x4(%rdi)
je 0x10075
movq 0x28(%rdi), %rdi
jmp 0x10065
callq 0x1cd1a
addq $0x20, %rsp
popq %rbx
retq