// File: /workspace/github_c_makefile_star2_O0/baskerville[P]bspwm/src/tree.c
// Function: activate_node
bool activate_node(monitor_t *m, desktop_t *d, node_t *n)
{
	if (n == NULL && d->root != NULL) {
		n = d->focus;
		if (n == NULL) {
			n = history_last_node(d, NULL);
		}
		if (n == NULL) {
			n = first_focusable_leaf(d->root);
		}
	}

	if (d == mon->desk || (n != NULL && !is_focusable(n))) {
		return false;
	}

	if (n != NULL) {
		if (d->focus != NULL && n != d->focus) {
			neutralize_occluding_windows(m, d, n);
		}
		stack(d, n, true);
		if (d->focus != n) {
			for (node_t *f = first_extrema(d->focus); f != NULL; f = next_leaf(f, d->focus)) {
				if (f->client != NULL && !is_descendant(f, n)) {
					window_draw_border(f->id, get_border_color(false, (m == mon)));
				}
			}
		}
		draw_border(n, true, (m == mon));
	}

	d->focus = n;
	history_add(m, d, n, false);

	put_status(SBSC_MASK_REPORT);

	if (n == NULL) {
		return true;
	}

	put_status(SBSC_MASK_NODE_ACTIVATE, "node_activate 0x%08X 0x%08X 0x%08X\n", m->id, d->id, n->id);

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0xcd14
movq -0x18(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0xcd14
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0xccfa
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x12990
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0xcd12
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xcec0
movq %rax, -0x20(%rbp)
jmp 0xcd14
movq -0x18(%rbp), %rax
leaq 0x289e1(%rip), %rcx     # 0x35700
movq (%rcx), %rcx
cmpq 0x58(%rcx), %rax
je 0xcd3c
cmpq $0x0, -0x20(%rbp)
je 0xcd45
movq -0x20(%rbp), %rdi
callq 0xcb80
testb $0x1, %al
jne 0xcd45
movb $0x0, -0x1(%rbp)
jmp 0xcea9
cmpq $0x0, -0x20(%rbp)
je 0xce45
movq -0x18(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0xcd7a
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x38(%rcx), %rax
je 0xcd7a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xcf30
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0x1, %edx
callq 0x120e0
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
cmpq -0x20(%rbp), %rax
je 0xce20
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0xbe70
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xce1e
movq -0x28(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0xce05
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xd040
testb $0x1, %al
jne 0xce05
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
leaq 0x2891a(%rip), %rcx     # 0x35700
cmpq (%rcx), %rax
sete %al
xorl %ecx, %ecx
movzbl %al, %esi
andl $0x1, %esi
xorl %edi, %edi
callq 0x17110
movl -0x2c(%rbp), %edi
movl %eax, %esi
callq 0x17180
jmp 0xce07
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0xbf80
movq %rax, -0x28(%rbp)
jmp 0xcdaf
jmp 0xce20
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
leaq 0x288d1(%rip), %rcx     # 0x35700
cmpq (%rcx), %rax
sete %al
movzbl %al, %edx
andl $0x1, %edx
movl $0x1, %esi
callq 0x167c0
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
xorl %ecx, %ecx
callq 0x12420
movl $0x1, %edi
movb $0x0, %al
callq 0x2c0b0
cmpq $0x0, -0x20(%rbp)
jne 0xce7d
movb $0x1, -0x1(%rbp)
jmp 0xcea9
movq -0x10(%rbp), %rax
movl 0x20(%rax), %edx
movq -0x18(%rbp), %rax
movl 0x20(%rax), %ecx
movq -0x20(%rbp), %rax
movl (%rax), %r8d
movl $0x400000, %edi         # imm = 0x400000
leaq 0x209ff(%rip), %rsi     # 0x2d89d
movb $0x0, %al
callq 0x2c0b0
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)