// File: /workspace/github_c_makefile_star2_O0/baskerville[P]bspwm/src/events.c
// Function: handle_state
void handle_state(monitor_t *m, desktop_t *d, node_t *n, xcb_atom_t state, unsigned int action)
{
	if (state == ewmh->_NET_WM_STATE_FULLSCREEN) {
		if (action == XCB_EWMH_WM_STATE_ADD && (ignore_ewmh_fullscreen & STATE_TRANSITION_ENTER) == 0) {
			set_state(m, d, n, STATE_FULLSCREEN);
		} else if (action == XCB_EWMH_WM_STATE_REMOVE && (ignore_ewmh_fullscreen & STATE_TRANSITION_EXIT) == 0) {
			if (n->client->state == STATE_FULLSCREEN) {
				set_state(m, d, n, n->client->last_state);
			}
		} else if (action == XCB_EWMH_WM_STATE_TOGGLE) {
			client_state_t next_state = IS_FULLSCREEN(n->client) ? n->client->last_state : STATE_FULLSCREEN;
			if ((next_state == STATE_FULLSCREEN && (ignore_ewmh_fullscreen & STATE_TRANSITION_ENTER) == 0) ||
			    (next_state != STATE_FULLSCREEN && (ignore_ewmh_fullscreen & STATE_TRANSITION_EXIT) == 0)) {
				set_state(m, d, n, next_state);
			}
		}
		arrange(m, d);
	} else if (state == ewmh->_NET_WM_STATE_BELOW) {
		if (action == XCB_EWMH_WM_STATE_ADD) {
			set_layer(m, d, n, LAYER_BELOW);
		} else if (action == XCB_EWMH_WM_STATE_REMOVE) {
			if (n->client->layer == LAYER_BELOW) {
				set_layer(m, d, n, n->client->last_layer);
			}
		} else if (action == XCB_EWMH_WM_STATE_TOGGLE) {
			set_layer(m, d, n, n->client->layer == LAYER_BELOW ? n->client->last_layer : LAYER_BELOW);
		}
	} else if (state == ewmh->_NET_WM_STATE_ABOVE) {
		if (action == XCB_EWMH_WM_STATE_ADD) {
			set_layer(m, d, n, LAYER_ABOVE);
		} else if (action == XCB_EWMH_WM_STATE_REMOVE) {
			if (n->client->layer == LAYER_ABOVE) {
				set_layer(m, d, n, n->client->last_layer);
			}
		} else if (action == XCB_EWMH_WM_STATE_TOGGLE) {
			set_layer(m, d, n, n->client->layer == LAYER_ABOVE ? n->client->last_layer : LAYER_ABOVE);
		}
	} else if (state == ewmh->_NET_WM_STATE_HIDDEN) {
		if (action == XCB_EWMH_WM_STATE_ADD) {
			set_hidden(m, d, n, true);
		} else if (action == XCB_EWMH_WM_STATE_REMOVE) {
			set_hidden(m, d, n, false);
		} else if (action == XCB_EWMH_WM_STATE_TOGGLE) {
			set_hidden(m, d, n, !n->hidden);
		}
	} else if (state == ewmh->_NET_WM_STATE_STICKY) {
		if (action == XCB_EWMH_WM_STATE_ADD) {
			set_sticky(m, d, n, true);
		} else if (action == XCB_EWMH_WM_STATE_REMOVE) {
			set_sticky(m, d, n, false);
		} else if (action == XCB_EWMH_WM_STATE_TOGGLE) {
			set_sticky(m, d, n, !n->sticky);
		}
	} else if (state == ewmh->_NET_WM_STATE_DEMANDS_ATTENTION) {
		if (action == XCB_EWMH_WM_STATE_ADD) {
			set_urgent(m, d, n, true);
		} else if (action == XCB_EWMH_WM_STATE_REMOVE) {
			set_urgent(m, d, n, false);
		} else if (action == XCB_EWMH_WM_STATE_TOGGLE) {
			set_urgent(m, d, n, !n->client->urgent);
		}
#define HANDLE_WM_STATE(s)  \
	} else if (state == ewmh->_NET_WM_STATE_##s) { \
		if (action == XCB_EWMH_WM_STATE_ADD) { \
			n->client->wm_flags |= WM_FLAG_##s; \
		} else if (action == XCB_EWMH_WM_STATE_REMOVE) { \
			n->client->wm_flags &= ~WM_FLAG_##s; \
		} else if (action == XCB_EWMH_WM_STATE_TOGGLE) { \
			n->client->wm_flags ^= WM_FLAG_##s; \
		} \
		ewmh_wm_state_update(n);
	HANDLE_WM_STATE(MODAL)
	HANDLE_WM_STATE(MAXIMIZED_VERT)
	HANDLE_WM_STATE(MAXIMIZED_HORZ)
	HANDLE_WM_STATE(SHADED)
	HANDLE_WM_STATE(SKIP_TASKBAR)
	HANDLE_WM_STATE(SKIP_PAGER)
	}
#undef HANDLE_WM_STATE
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl -0x1c(%rbp), %eax
leaq 0x21adb(%rip), %rcx     # 0x35e20
movq (%rcx), %rcx
cmpl 0x128(%rcx), %eax
jne 0x14466
cmpl $0x1, -0x20(%rbp)
jne 0x14386
leaq 0x21a8f(%rip), %rax     # 0x35df0
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x14386
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl $0x3, %ecx
callq 0x10e30
jmp 0x14454
cmpl $0x0, -0x20(%rbp)
jne 0x143d2
leaq 0x21a5d(%rip), %rax     # 0x35df0
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x143d2
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
cmpl $0x3, 0x308(%rax)
jne 0x143cd
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x30c(%rax), %ecx
callq 0x10e30
jmp 0x14452
cmpl $0x2, -0x20(%rbp)
jne 0x14450
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
cmpl $0x3, 0x308(%rax)
jne 0x143fc
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x30c(%rax), %eax
movl %eax, -0x28(%rbp)
jmp 0x14406
movl $0x3, %eax
movl %eax, -0x28(%rbp)
jmp 0x14406
movl -0x28(%rbp), %eax
movl %eax, -0x24(%rbp)
cmpl $0x3, -0x24(%rbp)
jne 0x14423
leaq 0x219d7(%rip), %rax     # 0x35df0
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1443a
cmpl $0x3, -0x24(%rbp)
je 0x1444e
leaq 0x219c0(%rip), %rax     # 0x35df0
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x1444e
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x24(%rbp), %ecx
callq 0x10e30
jmp 0x14450
jmp 0x14452
jmp 0x14454
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xafd0
jmp 0x14aae
movl -0x1c(%rbp), %eax
leaq 0x219b0(%rip), %rcx     # 0x35e20
movq (%rcx), %rcx
cmpl 0x130(%rcx), %eax
jne 0x1453b
cmpl $0x1, -0x20(%rbp)
jne 0x1449d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
xorl %ecx, %ecx
callq 0x10c60
jmp 0x14536
cmpl $0x0, -0x20(%rbp)
jne 0x144d5
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
cmpl $0x0, 0x310(%rax)
jne 0x144d3
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x314(%rax), %ecx
callq 0x10c60
jmp 0x14534
cmpl $0x2, -0x20(%rbp)
jne 0x14532
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
cmpl $0x0, 0x310(%rax)
jne 0x14517
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x314(%rax), %eax
movl %eax, -0x44(%rbp)
jmp 0x1451e
xorl %eax, %eax
movl %eax, -0x44(%rbp)
jmp 0x1451e
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdi
movl -0x44(%rbp), %ecx
callq 0x10c60
jmp 0x14534
jmp 0x14536
jmp 0x14aac
movl -0x1c(%rbp), %eax
leaq 0x218db(%rip), %rcx     # 0x35e20
movq (%rcx), %rcx
cmpl 0x12c(%rcx), %eax
jne 0x14616
cmpl $0x1, -0x20(%rbp)
jne 0x14575
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl $0x2, %ecx
callq 0x10c60
jmp 0x14611
cmpl $0x0, -0x20(%rbp)
jne 0x145ad
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
cmpl $0x2, 0x310(%rax)
jne 0x145ab
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x314(%rax), %ecx
callq 0x10c60
jmp 0x1460f
cmpl $0x2, -0x20(%rbp)
jne 0x1460d
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
cmpl $0x2, 0x310(%rax)
jne 0x145ef
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x314(%rax), %eax
movl %eax, -0x64(%rbp)
jmp 0x145f9
movl $0x2, %eax
movl %eax, -0x64(%rbp)
jmp 0x145f9
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rsi
movq -0x60(%rbp), %rdi
movl -0x64(%rbp), %ecx
callq 0x10c60
jmp 0x1460f
jmp 0x14611
jmp 0x14aaa
movl -0x1c(%rbp), %eax
leaq 0x21800(%rip), %rcx     # 0x35e20
movq (%rcx), %rcx
cmpl 0x124(%rcx), %eax
jne 0x14693
cmpl $0x1, -0x20(%rbp)
jne 0x14649
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl $0x1, %ecx
callq 0x11460
jmp 0x1468e
cmpl $0x0, -0x20(%rbp)
jne 0x14664
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
xorl %ecx, %ecx
callq 0x11460
jmp 0x1468c
cmpl $0x2, -0x20(%rbp)
jne 0x1468a
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x18(%rbp), %rax
movb 0x25(%rax), %al
xorb $-0x1, %al
movzbl %al, %ecx
andl $0x1, %ecx
callq 0x11460
jmp 0x1468c
jmp 0x1468e
jmp 0x14aa8
movl -0x1c(%rbp), %eax
leaq 0x21783(%rip), %rcx     # 0x35e20
movq (%rcx), %rcx
cmpl 0x10c(%rcx), %eax
jne 0x14710
cmpl $0x1, -0x20(%rbp)
jne 0x146c6
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl $0x1, %ecx
callq 0x11760
jmp 0x1470b
cmpl $0x0, -0x20(%rbp)
jne 0x146e1
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
xorl %ecx, %ecx
callq 0x11760
jmp 0x14709
cmpl $0x2, -0x20(%rbp)
jne 0x14707
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x18(%rbp), %rax
movb 0x26(%rax), %al
xorb $-0x1, %al
movzbl %al, %ecx
andl $0x1, %ecx
callq 0x11760
jmp 0x14709
jmp 0x1470b
jmp 0x14aa6
movl -0x1c(%rbp), %eax
leaq 0x21706(%rip), %rcx     # 0x35e20
movq (%rcx), %rcx
cmpl 0x134(%rcx), %eax
jne 0x14794
cmpl $0x1, -0x20(%rbp)
jne 0x14743
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl $0x1, %ecx
callq 0xdc90
jmp 0x1478f
cmpl $0x0, -0x20(%rbp)
jne 0x1475e
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
xorl %ecx, %ecx
callq 0xdc90
jmp 0x1478d
cmpl $0x2, -0x20(%rbp)
jne 0x1478b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movb 0x304(%rax), %al
xorb $-0x1, %al
movzbl %al, %ecx
andl $0x1, %ecx
callq 0xdc90
jmp 0x1478d
jmp 0x1478f
jmp 0x14aa4
movl -0x1c(%rbp), %eax
leaq 0x21682(%rip), %rcx     # 0x35e20
movq (%rcx), %rcx
cmpl 0x108(%rcx), %eax
jne 0x14816
cmpl $0x1, -0x20(%rbp)
jne 0x147c8
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x378(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x378(%rax)
jmp 0x14808
cmpl $0x0, -0x20(%rbp)
jne 0x147e7
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x378(%rax), %ecx
andl $-0x2, %ecx
movl %ecx, 0x378(%rax)
jmp 0x14806
cmpl $0x2, -0x20(%rbp)
jne 0x14804
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x378(%rax), %ecx
xorl $0x1, %ecx
movl %ecx, 0x378(%rax)
jmp 0x14806
jmp 0x14808
movq -0x18(%rbp), %rdi
callq 0x2b810
jmp 0x14aa2
movl -0x1c(%rbp), %eax
leaq 0x21600(%rip), %rcx     # 0x35e20
movq (%rcx), %rcx
cmpl 0x110(%rcx), %eax
jne 0x14898
cmpl $0x1, -0x20(%rbp)
jne 0x1484a
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x378(%rax), %ecx
orl $0x4, %ecx
movl %ecx, 0x378(%rax)
jmp 0x1488a
cmpl $0x0, -0x20(%rbp)
jne 0x14869
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x378(%rax), %ecx
andl $-0x5, %ecx
movl %ecx, 0x378(%rax)
jmp 0x14888
cmpl $0x2, -0x20(%rbp)
jne 0x14886
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x378(%rax), %ecx
xorl $0x4, %ecx
movl %ecx, 0x378(%rax)
jmp 0x14888
jmp 0x1488a
movq -0x18(%rbp), %rdi
callq 0x2b810
jmp 0x14aa0
movl -0x1c(%rbp), %eax
leaq 0x2157e(%rip), %rcx     # 0x35e20
movq (%rcx), %rcx
cmpl 0x114(%rcx), %eax
jne 0x1491a
cmpl $0x1, -0x20(%rbp)
jne 0x148cc
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x378(%rax), %ecx
orl $0x8, %ecx
movl %ecx, 0x378(%rax)
jmp 0x1490c
cmpl $0x0, -0x20(%rbp)
jne 0x148eb
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x378(%rax), %ecx
andl $-0x9, %ecx
movl %ecx, 0x378(%rax)
jmp 0x1490a
cmpl $0x2, -0x20(%rbp)
jne 0x14908
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x378(%rax), %ecx
xorl $0x8, %ecx
movl %ecx, 0x378(%rax)
jmp 0x1490a
jmp 0x1490c
movq -0x18(%rbp), %rdi
callq 0x2b810
jmp 0x14a9e
movl -0x1c(%rbp), %eax
leaq 0x214fc(%rip), %rcx     # 0x35e20
movq (%rcx), %rcx
cmpl 0x118(%rcx), %eax
jne 0x1499c
cmpl $0x1, -0x20(%rbp)
jne 0x1494e
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x378(%rax), %ecx
orl $0x10, %ecx
movl %ecx, 0x378(%rax)
jmp 0x1498e
cmpl $0x0, -0x20(%rbp)
jne 0x1496d
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x378(%rax), %ecx
andl $-0x11, %ecx
movl %ecx, 0x378(%rax)
jmp 0x1498c
cmpl $0x2, -0x20(%rbp)
jne 0x1498a
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x378(%rax), %ecx
xorl $0x10, %ecx
movl %ecx, 0x378(%rax)
jmp 0x1498c
jmp 0x1498e
movq -0x18(%rbp), %rdi
callq 0x2b810
jmp 0x14a9c
movl -0x1c(%rbp), %eax
leaq 0x2147a(%rip), %rcx     # 0x35e20
movq (%rcx), %rcx
cmpl 0x11c(%rcx), %eax
jne 0x14a1b
cmpl $0x1, -0x20(%rbp)
jne 0x149d0
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x378(%rax), %ecx
orl $0x20, %ecx
movl %ecx, 0x378(%rax)
jmp 0x14a10
cmpl $0x0, -0x20(%rbp)
jne 0x149ef
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x378(%rax), %ecx
andl $-0x21, %ecx
movl %ecx, 0x378(%rax)
jmp 0x14a0e
cmpl $0x2, -0x20(%rbp)
jne 0x14a0c
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x378(%rax), %ecx
xorl $0x20, %ecx
movl %ecx, 0x378(%rax)
jmp 0x14a0e
jmp 0x14a10
movq -0x18(%rbp), %rdi
callq 0x2b810
jmp 0x14a9a
movl -0x1c(%rbp), %eax
leaq 0x213fb(%rip), %rcx     # 0x35e20
movq (%rcx), %rcx
cmpl 0x120(%rcx), %eax
jne 0x14a98
cmpl $0x1, -0x20(%rbp)
jne 0x14a4f
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x378(%rax), %ecx
orl $0x40, %ecx
movl %ecx, 0x378(%rax)
jmp 0x14a8f
cmpl $0x0, -0x20(%rbp)
jne 0x14a6e
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x378(%rax), %ecx
andl $-0x41, %ecx
movl %ecx, 0x378(%rax)
jmp 0x14a8d
cmpl $0x2, -0x20(%rbp)
jne 0x14a8b
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x378(%rax), %ecx
xorl $0x40, %ecx
movl %ecx, 0x378(%rax)
jmp 0x14a8d
jmp 0x14a8f
movq -0x18(%rbp), %rdi
callq 0x2b810
jmp 0x14a9a
jmp 0x14a9c
jmp 0x14a9e
jmp 0x14aa0
jmp 0x14aa2
jmp 0x14aa4
jmp 0x14aa6
jmp 0x14aa8
jmp 0x14aaa
jmp 0x14aac
jmp 0x14aae
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop