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

	client_t *c = n->client;

	bool was_tiled = IS_TILED(c);

	c->last_state = c->state;
	c->state = s;

	switch (c->last_state) {
		case STATE_TILED:
		case STATE_PSEUDO_TILED:
			break;
		case STATE_FLOATING:
			set_floating(m, d, n, false);
			break;
		case STATE_FULLSCREEN:
			set_fullscreen(m, d, n, false);
			break;
	}

	put_status(SBSC_MASK_NODE_STATE, "node_state 0x%08X 0x%08X 0x%08X %s off\n", m->id, d->id, n->id, STATE_STR(c->last_state));

	switch (c->state) {
		case STATE_TILED:
		case STATE_PSEUDO_TILED:
			break;
		case STATE_FLOATING:
			set_floating(m, d, n, true);
			break;
		case STATE_FULLSCREEN:
			set_fullscreen(m, d, n, true);
			break;
	}

	put_status(SBSC_MASK_NODE_STATE, "node_state 0x%08X 0x%08X 0x%08X %s on\n", m->id, d->id, n->id, STATE_STR(c->state));

	if (n == m->desk->focus) {
		put_status(SBSC_MASK_REPORT);
	}

	if (single_monocle && was_tiled != IS_TILED(c)) {
		if (was_tiled && d->layout != LAYOUT_MONOCLE && tiled_count(d->root, true) <= 1) {
			set_layout(m, d, LAYOUT_MONOCLE, false);
		} else if (!was_tiled && d->layout == LAYOUT_MONOCLE && tiled_count(d->root, true) > 1) {
			set_layout(m, d, d->user_layout, false);
		}
	}

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x10e6f
movq -0x20(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x10e6f
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x308(%rax), %eax
cmpl -0x24(%rbp), %eax
jne 0x10e78
movb $0x0, -0x1(%rbp)
jmp 0x1119e
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rcx
movb $0x1, %al
cmpl $0x0, 0x308(%rcx)
movb %al, -0x32(%rbp)
je 0x10ea7
movq -0x30(%rbp), %rax
cmpl $0x1, 0x308(%rax)
sete %al
movb %al, -0x32(%rbp)
movb -0x32(%rbp), %al
andb $0x1, %al
movb %al, -0x31(%rbp)
movq -0x30(%rbp), %rax
movl 0x308(%rax), %ecx
movl %ecx, 0x30c(%rax)
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x308(%rax)
movq -0x30(%rbp), %rax
movl 0x30c(%rax), %eax
movl %eax, -0x38(%rbp)
subl $0x2, %eax
jb 0x10ef4
jmp 0x10ee0
movl -0x38(%rbp), %eax
subl $0x2, %eax
je 0x10ef6
jmp 0x10eea
movl -0x38(%rbp), %eax
subl $0x3, %eax
je 0x10f0b
jmp 0x10f1e
jmp 0x10f1e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
xorl %ecx, %ecx
callq 0x111b0
jmp 0x10f1e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
xorl %ecx, %ecx
callq 0x11260
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x18(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, 0x30c(%rax)
jne 0x10f55
leaq 0x1dee4(%rip), %rax     # 0x2ee33
movq %rax, -0x50(%rbp)
jmp 0x10f9a
movq -0x30(%rbp), %rax
cmpl $0x2, 0x30c(%rax)
jne 0x10f6f
leaq 0x1df1b(%rip), %rax     # 0x2ee84
movq %rax, -0x58(%rbp)
jmp 0x10f92
movq -0x30(%rbp), %rax
movl 0x30c(%rax), %edx
leaq 0x1def6(%rip), %rax     # 0x2ee76
leaq 0x1df07(%rip), %rcx     # 0x2ee8e
cmpl $0x3, %edx
cmoveq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x50(%rbp)
movl -0x3c(%rbp), %r8d
movl -0x40(%rbp), %ecx
movl -0x44(%rbp), %edx
movq -0x50(%rbp), %r9
leaq 0x1ca1e(%rip), %rsi     # 0x2d9cd
xorl %eax, %eax
movl $0x1000000, %edi        # imm = 0x1000000
callq 0x2c0b0
movq -0x30(%rbp), %rax
movl 0x308(%rax), %eax
movl %eax, -0x5c(%rbp)
subl $0x2, %eax
jb 0x10fe3
jmp 0x10fcf
movl -0x5c(%rbp), %eax
subl $0x2, %eax
je 0x10fe5
jmp 0x10fd9
movl -0x5c(%rbp), %eax
subl $0x3, %eax
je 0x10ffd
jmp 0x11013
jmp 0x11013
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl $0x1, %ecx
callq 0x111b0
jmp 0x11013
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl $0x1, %ecx
callq 0x11260
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x60(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, 0x308(%rax)
jne 0x1104a
leaq 0x1ddef(%rip), %rax     # 0x2ee33
movq %rax, -0x70(%rbp)
jmp 0x1108f
movq -0x30(%rbp), %rax
cmpl $0x2, 0x308(%rax)
jne 0x11064
leaq 0x1de26(%rip), %rax     # 0x2ee84
movq %rax, -0x78(%rbp)
jmp 0x11087
movq -0x30(%rbp), %rax
movl 0x308(%rax), %edx
leaq 0x1de01(%rip), %rax     # 0x2ee76
leaq 0x1de12(%rip), %rcx     # 0x2ee8e
cmpl $0x3, %edx
cmoveq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x70(%rbp)
movl -0x60(%rbp), %r8d
movl -0x64(%rbp), %ecx
movl -0x68(%rbp), %edx
movq -0x70(%rbp), %r9
movl $0x1000000, %edi        # imm = 0x1000000
leaq 0x1c94c(%rip), %rsi     # 0x2d9f5
movb $0x0, %al
callq 0x2c0b0
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
cmpq 0x38(%rcx), %rax
jne 0x110ce
movl $0x1, %edi
movb $0x0, %al
callq 0x2c0b0
leaq 0x24d13(%rip), %rax     # 0x35de8
testb $0x1, (%rax)
je 0x1119a
movb -0x31(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x80(%rbp)
movq -0x30(%rbp), %rcx
movb $0x1, %al
cmpl $0x0, 0x308(%rcx)
movb %al, -0x79(%rbp)
je 0x1110c
movq -0x30(%rbp), %rax
cmpl $0x1, 0x308(%rax)
sete %al
movb %al, -0x79(%rbp)
movl -0x80(%rbp), %eax
movb -0x79(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
je 0x1119a
testb $0x1, -0x31(%rbp)
je 0x11159
movq -0x18(%rbp), %rax
cmpl $0x1, 0x24(%rax)
je 0x11159
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdi
movl $0x1, %esi
callq 0xc8d0
cmpl $0x1, %eax
jg 0x11159
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x9e80
jmp 0x11198
testb $0x1, -0x31(%rbp)
jne 0x11196
movq -0x18(%rbp), %rax
cmpl $0x1, 0x24(%rax)
jne 0x11196
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdi
movl $0x1, %esi
callq 0xc8d0
cmpl $0x1, %eax
jle 0x11196
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x28(%rax), %edx
xorl %ecx, %ecx
callq 0x9e80
jmp 0x11198
jmp 0x1119a
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)