// File: /workspace/github_c_makefile_star2_O0/baskerville[P]bspwm/src/tree.c
// Function: set_layer
bool set_layer(monitor_t *m, desktop_t *d, node_t *n, stack_layer_t l)
{
	if (n == NULL || n->client == NULL || n->client->layer == l) {
		return false;
	}

	n->client->last_layer = n->client->layer;
	n->client->layer = l;

	if (l == LAYER_ABOVE) {
		n->client->wm_flags |= WM_FLAG_ABOVE;
		n->client->wm_flags &= ~WM_FLAG_BELOW;
	} else if (l == LAYER_BELOW) {
		n->client->wm_flags |= WM_FLAG_BELOW;
		n->client->wm_flags &= ~WM_FLAG_ABOVE;
	} else {
		n->client->wm_flags &= ~(WM_FLAG_ABOVE | WM_FLAG_BELOW);
	}

	ewmh_wm_state_update(n);

	put_status(SBSC_MASK_NODE_LAYER, "node_layer 0x%08X 0x%08X 0x%08X %s\n", m->id, d->id, n->id, LAYER_STR(l));

	if (d->focus == n) {
		neutralize_occluding_windows(m, d, n);
	}

	stack(d, n, (d->focus == n));

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x10c9c
movq -0x20(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x10c9c
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x310(%rax), %eax
cmpl -0x24(%rbp), %eax
jne 0x10ca5
movb $0x0, -0x1(%rbp)
jmp 0x10e21
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x310(%rax), %ecx
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movl %ecx, 0x314(%rax)
movl -0x24(%rbp), %ecx
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movl %ecx, 0x310(%rax)
cmpl $0x2, -0x24(%rbp)
jne 0x10d0e
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x378(%rax), %ecx
orl $0x200, %ecx            # imm = 0x200
movl %ecx, 0x378(%rax)
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x378(%rax), %ecx
andl $0xfffffbff, %ecx       # imm = 0xFFFFFBFF
movl %ecx, 0x378(%rax)
jmp 0x10d66
cmpl $0x0, -0x24(%rbp)
jne 0x10d4a
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x378(%rax), %ecx
orl $0x400, %ecx            # imm = 0x400
movl %ecx, 0x378(%rax)
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x378(%rax), %ecx
andl $0xfffffdff, %ecx       # imm = 0xFFFFFDFF
movl %ecx, 0x378(%rax)
jmp 0x10d64
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x378(%rax), %ecx
andl $0xfffff9ff, %ecx       # imm = 0xFFFFF9FF
movl %ecx, 0x378(%rax)
jmp 0x10d66
movq -0x20(%rbp), %rdi
callq 0x2b810
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x10d9f
leaq 0x1e152(%rip), %rax     # 0x2eeeb
movq %rax, -0x38(%rbp)
jmp 0x10dbb
movl -0x24(%rbp), %edx
leaq 0x1e151(%rip), %rax     # 0x2eefa
leaq 0x1e142(%rip), %rcx     # 0x2eef2
cmpl $0x1, %edx
cmoveq %rcx, %rax
movq %rax, -0x38(%rbp)
movl -0x28(%rbp), %r8d
movl -0x2c(%rbp), %ecx
movl -0x30(%rbp), %edx
movq -0x38(%rbp), %r9
movl $0x4000000, %edi        # imm = 0x4000000
leaq 0x1cbd4(%rip), %rsi     # 0x2d9a9
movb $0x0, %al
callq 0x2c0b0
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
cmpq -0x20(%rbp), %rax
jne 0x10dfb
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xcf30
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
cmpq -0x20(%rbp), %rax
sete %al
movzbl %al, %edx
andl $0x1, %edx
callq 0x120e0
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)