// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
leaq 0x22b6e(%rip), %rcx     # 0x35e20
movq (%rcx), %rcx
cmpl 0x38(%rcx), %eax
jne 0x132ea
movq -0x10(%rbp), %rax
movl 0xc(%rax), %edi
leaq -0x28(%rbp), %rsi
callq 0x2adc0
testb $0x1, %al
jne 0x132d0
jmp 0x132e5
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rdx
callq 0xd720
jmp 0x1347e
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edi
leaq -0x40(%rbp), %rsi
callq 0x26b20
testb $0x1, %al
jne 0x13347
leaq 0x223c3(%rip), %rax     # 0x356c8
movq (%rax), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x13342
movq -0x48(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x13332
movq -0x48(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x29b60
jmp 0x13342
jmp 0x13334
movq -0x48(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x1330c
jmp 0x1347e
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
leaq 0x22acb(%rip), %rcx     # 0x35e20
movq (%rcx), %rcx
cmpl 0x84(%rcx), %eax
jne 0x133a5
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x10(%rbp), %rax
movl 0xc(%rax), %r8d
callq 0x14320
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x10(%rbp), %rax
movl 0x14(%rax), %ecx
movq -0x10(%rbp), %rax
movl 0xc(%rax), %r8d
callq 0x14320
jmp 0x1347e
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
leaq 0x22a6d(%rip), %rcx     # 0x35e20
movq (%rcx), %rcx
cmpl 0x40(%rcx), %eax
jne 0x13401
leaq 0x22a2d(%rip), %rax     # 0x35def
testb $0x1, (%rax)
je 0x133d1
movq -0x10(%rbp), %rax
cmpl $0x1, 0xc(%rax)
je 0x133e9
movq -0x30(%rbp), %rax
leaq 0x22324(%rip), %rcx     # 0x35700
movq (%rcx), %rcx
movq 0x58(%rcx), %rcx
cmpq 0x38(%rcx), %rax
jne 0x133ee
jmp 0x1347e
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0xd720
jmp 0x1347c
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
leaq 0x22a11(%rip), %rcx     # 0x35e20
movq (%rcx), %rcx
cmpl 0x7c(%rcx), %eax
jne 0x13459
movq -0x10(%rbp), %rax
movl 0xc(%rax), %edi
leaq -0x60(%rbp), %rsi
callq 0x2adc0
testb $0x1, %al
jne 0x1342d
jmp 0x13457
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x60(%rbp), %rcx
movq -0x58(%rbp), %r8
movq -0x58(%rbp), %rax
movq 0x38(%rax), %r9
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0xd180
jmp 0x1347a
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
leaq 0x229b9(%rip), %rcx     # 0x35e20
movq (%rcx), %rcx
cmpl 0x58(%rcx), %eax
jne 0x13478
movq -0x30(%rbp), %rdi
callq 0xf980
jmp 0x1347a
jmp 0x1347c
jmp 0x1347e
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)