// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: node_matches
bool node_matches(coordinates_t *loc, coordinates_t *ref, node_select_t *sel)
{
	if (loc->node == NULL) {
		return false;
	}

	if (sel->focused != OPTION_NONE &&
	    loc->node != mon->desk->focus
	    ? sel->focused == OPTION_TRUE
	    : sel->focused == OPTION_FALSE) {
		return false;
	}

	if (sel->active != OPTION_NONE &&
	    loc->node != loc->desktop->focus
	    ? sel->active == OPTION_TRUE
	    : sel->active == OPTION_FALSE) {
		return false;
	}

	if (sel->automatic != OPTION_NONE &&
	    loc->node->presel != NULL
	    ? sel->automatic == OPTION_TRUE
	    : sel->automatic == OPTION_FALSE) {
		return false;
	}

	if (sel->local != OPTION_NONE &&
	    loc->desktop != ref->desktop
	    ? sel->local == OPTION_TRUE
	    : sel->local == OPTION_FALSE) {
		return false;
	}

	if (sel->active != OPTION_NONE &&
	    loc->desktop != loc->monitor->desk
	    ? sel->active == OPTION_TRUE
	    : sel->active == OPTION_FALSE) {
		return false;
	}

	if (sel->leaf != OPTION_NONE &&
	    !is_leaf(loc->node)
	    ? sel->leaf == OPTION_TRUE
	    : sel->leaf == OPTION_FALSE) {
		return false;
	}

	if (sel->window != OPTION_NONE &&
	    loc->node->client == NULL
	    ? sel->window == OPTION_TRUE
	    : sel->window == OPTION_FALSE) {
		return false;
	}

#define NFLAG(p) \
	if (sel->p != OPTION_NONE && \
	    !loc->node->p \
	    ? sel->p == OPTION_TRUE \
	    : sel->p == OPTION_FALSE) { \
		return false; \
	}
	NFLAG(hidden)
	NFLAG(sticky)
	NFLAG(private)
	NFLAG(locked)
	NFLAG(marked)
#undef NFLAG

#define NSPLIT(p, e) \
	if (sel->p != OPTION_NONE && \
	    loc->node->split_type != e \
	    ? sel->p == OPTION_TRUE \
	    : sel->p == OPTION_FALSE) { \
		return false; \
	}
	NSPLIT(horizontal, TYPE_HORIZONTAL)
	NSPLIT(vertical, TYPE_VERTICAL)
#undef NSPLIT

	if (sel->descendant_of != OPTION_NONE &&
	    !is_descendant(loc->node, ref->node)
	    ? sel->descendant_of == OPTION_TRUE
	    : sel->descendant_of == OPTION_FALSE) {
		return false;
	}

	if (sel->ancestor_of != OPTION_NONE &&
	    !is_descendant(ref->node, loc->node)
	    ? sel->ancestor_of == OPTION_TRUE
	    : sel->ancestor_of == OPTION_FALSE) {
		return false;
	}

	if (loc->node->client == NULL) {
		if (sel->same_class == OPTION_TRUE ||
		    sel->tiled == OPTION_TRUE ||
		    sel->pseudo_tiled == OPTION_TRUE ||
		    sel->floating == OPTION_TRUE ||
		    sel->fullscreen == OPTION_TRUE ||
		    sel->below == OPTION_TRUE ||
		    sel->normal == OPTION_TRUE ||
		    sel->above == OPTION_TRUE ||
		    sel->urgent == OPTION_TRUE) {
			return false;
		}
		return true;
	}

	if (ref->node != NULL && ref->node->client != NULL &&
	    sel->same_class != OPTION_NONE &&
	    streq(loc->node->client->class_name, ref->node->client->class_name)
	    ? sel->same_class == OPTION_FALSE
	    : sel->same_class == OPTION_TRUE) {
		return false;
	}

#define WSTATE(p, e) \
	if (sel->p != OPTION_NONE && \
	    loc->node->client->state != e \
	    ? sel->p == OPTION_TRUE \
	    : sel->p == OPTION_FALSE) { \
		return false; \
	}
	WSTATE(tiled, STATE_TILED)
	WSTATE(pseudo_tiled, STATE_PSEUDO_TILED)
	WSTATE(floating, STATE_FLOATING)
	WSTATE(fullscreen, STATE_FULLSCREEN)
#undef WSTATE

#define WLAYER(p, e) \
	if (sel->p != OPTION_NONE && \
	    loc->node->client->layer != e \
	    ? sel->p == OPTION_TRUE \
	    : sel->p == OPTION_FALSE) { \
		return false; \
	}
	WLAYER(below, LAYER_BELOW)
	WLAYER(normal, LAYER_NORMAL)
	WLAYER(above, LAYER_ABOVE)
#undef WLAYER

#define WFLAG(p) \
	if (sel->p != OPTION_NONE && \
	    !loc->node->client->p \
	    ? sel->p == OPTION_TRUE \
	    : sel->p == OPTION_FALSE) { \
		return false; \
	}
	WFLAG(urgent)
#undef WFLAG

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r15
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x196ec
movq %rdx, %rbx
movq %rsi, %r14
movl 0x4(%rdx), %eax
testl %eax, %eax
je 0x1931a
leaq 0x10416(%rip), %rcx     # 0x29710
movq (%rcx), %rcx
movq 0x58(%rcx), %rcx
cmpq 0x38(%rcx), %rdi
je 0x19311
cmpl $0x1, %eax
jne 0x1931a
jmp 0x196ec
cmpl $0x2, %eax
je 0x196ec
movl 0x8(%rbx), %eax
testl %eax, %eax
je 0x19335
movq 0x8(%r15), %rcx
cmpq 0x38(%rcx), %rdi
je 0x19335
cmpl $0x1, %eax
jne 0x1933e
jmp 0x196ec
cmpl $0x2, %eax
je 0x196ec
movl (%rbx), %ecx
testl %ecx, %ecx
je 0x1935e
cmpq $0x0, 0x10(%rdi)
je 0x19355
cmpl $0x1, %ecx
jne 0x1935e
jmp 0x196ec
cmpl $0x2, %ecx
je 0x196ec
movl 0xc(%rbx), %ecx
testl %ecx, %ecx
je 0x19382
movq 0x8(%r15), %rdx
cmpq 0x8(%r14), %rdx
je 0x19379
cmpl $0x1, %ecx
jne 0x19382
jmp 0x196ec
cmpl $0x2, %ecx
je 0x196ec
testl %eax, %eax
je 0x1939d
movq (%r15), %rcx
movq 0x8(%r15), %rdx
cmpq 0x58(%rcx), %rdx
je 0x1939d
cmpl $0x1, %eax
jne 0x193a6
jmp 0x196ec
cmpl $0x2, %eax
je 0x196ec
cmpl $0x0, 0x10(%rbx)
je 0x193b5
callq 0x8f55
testb %al, %al
je 0x193c0
cmpl $0x2, 0x10(%rbx)
jne 0x193ca
jmp 0x196ec
cmpl $0x1, 0x10(%rbx)
je 0x196ec
movl 0x14(%rbx), %eax
testl %eax, %eax
je 0x193ef
movq 0x10(%r15), %rcx
cmpq $0x0, 0x48(%rcx)
je 0x193e6
cmpl $0x2, %eax
jne 0x193ef
jmp 0x196ec
cmpl $0x1, %eax
je 0x196ec
movl 0x28(%rbx), %eax
testl %eax, %eax
je 0x19413
movq 0x10(%r15), %rcx
cmpb $0x0, 0x25(%rcx)
je 0x1940a
cmpl $0x2, %eax
jne 0x19413
jmp 0x196ec
cmpl $0x1, %eax
je 0x196ec
movl 0x2c(%rbx), %eax
testl %eax, %eax
je 0x19437
movq 0x10(%r15), %rcx
cmpb $0x0, 0x26(%rcx)
je 0x1942e
cmpl $0x2, %eax
jne 0x19437
jmp 0x196ec
cmpl $0x1, %eax
je 0x196ec
movl 0x30(%rbx), %eax
testl %eax, %eax
je 0x1945b
movq 0x10(%r15), %rcx
cmpb $0x0, 0x27(%rcx)
je 0x19452
cmpl $0x2, %eax
jne 0x1945b
jmp 0x196ec
cmpl $0x1, %eax
je 0x196ec
movl 0x34(%rbx), %eax
testl %eax, %eax
je 0x1947f
movq 0x10(%r15), %rcx
cmpb $0x0, 0x28(%rcx)
je 0x19476
cmpl $0x2, %eax
jne 0x1947f
jmp 0x196ec
cmpl $0x1, %eax
je 0x196ec
movl 0x38(%rbx), %eax
testl %eax, %eax
je 0x194a3
movq 0x10(%r15), %rcx
cmpb $0x0, 0x29(%rcx)
je 0x1949a
cmpl $0x2, %eax
jne 0x194a3
jmp 0x196ec
cmpl $0x1, %eax
je 0x196ec
movl 0x58(%rbx), %eax
testl %eax, %eax
je 0x194c7
movq 0x10(%r15), %rcx
cmpl $0x0, 0x4(%rcx)
je 0x194be
cmpl $0x1, %eax
jne 0x194c7
jmp 0x196ec
cmpl $0x2, %eax
je 0x196ec
movl 0x5c(%rbx), %eax
testl %eax, %eax
je 0x194eb
movq 0x10(%r15), %rcx
cmpl $0x1, 0x4(%rcx)
jne 0x194e2
cmpl $0x2, %eax
jne 0x194eb
jmp 0x196ec
cmpl $0x1, %eax
je 0x196ec
cmpl $0x0, 0x44(%rbx)
je 0x19502
movq 0x10(%r15), %rdi
movq 0x10(%r14), %rsi
callq 0x9da7
testb %al, %al
je 0x1950d
cmpl $0x2, 0x44(%rbx)
jne 0x19517
jmp 0x196ec
cmpl $0x1, 0x44(%rbx)
je 0x196ec
cmpl $0x0, 0x48(%rbx)
je 0x1952e
movq 0x10(%r14), %rdi
movq 0x10(%r15), %rsi
callq 0x9da7
testb %al, %al
je 0x19539
cmpl $0x2, 0x48(%rbx)
jne 0x19543
jmp 0x196ec
cmpl $0x1, 0x48(%rbx)
je 0x196ec
movq 0x10(%r15), %rax
movq 0x48(%rax), %r15
testq %r15, %r15
je 0x1959e
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x19579
movq 0x48(%rax), %rsi
testq %rsi, %rsi
je 0x19579
movl 0x40(%rbx), %ebp
testl %ebp, %ebp
je 0x19579
movq %r15, %rdi
callq 0x4820
testl %eax, %eax
je 0x19642
cmpl $0x1, 0x40(%rbx)
je 0x196ec
movl 0x18(%rbx), %eax
testl %eax, %eax
je 0x19603
cmpl $0x0, 0x308(%r15)
je 0x195fa
cmpl $0x1, %eax
jne 0x19603
jmp 0x196ec
cmpl $0x1, 0x40(%rbx)
je 0x196ec
cmpl $0x1, 0x18(%rbx)
je 0x196ec
cmpl $0x1, 0x1c(%rbx)
je 0x196ec
cmpl $0x1, 0x20(%rbx)
je 0x196ec
cmpl $0x1, 0x24(%rbx)
je 0x196ec
cmpl $0x1, 0x4c(%rbx)
je 0x196ec
cmpl $0x1, 0x50(%rbx)
je 0x196ec
cmpl $0x1, 0x54(%rbx)
je 0x196ec
cmpl $0x1, 0x3c(%rbx)
setne %al
jmp 0x196ee
cmpl $0x2, %eax
je 0x196ec
movl 0x1c(%rbx), %eax
testl %eax, %eax
je 0x19627
cmpl $0x1, 0x308(%r15)
jne 0x1961e
cmpl $0x2, %eax
jne 0x19627
jmp 0x196ec
cmpl $0x1, %eax
je 0x196ec
movl 0x20(%rbx), %eax
testl %eax, %eax
je 0x19659
cmpl $0x2, 0x308(%r15)
jne 0x19650
cmpl $0x2, %eax
jne 0x19659
jmp 0x196ec
cmpl $0x2, %ebp
jne 0x19583
jmp 0x196ec
cmpl $0x1, %eax
je 0x196ec
movl 0x24(%rbx), %eax
testl %eax, %eax
je 0x19676
cmpl $0x3, 0x308(%r15)
jne 0x19671
cmpl $0x2, %eax
jne 0x19676
jmp 0x196ec
cmpl $0x1, %eax
je 0x196ec
movl 0x4c(%rbx), %eax
testl %eax, %eax
je 0x19693
cmpl $0x0, 0x310(%r15)
je 0x1968e
cmpl $0x1, %eax
jne 0x19693
jmp 0x196ec
cmpl $0x2, %eax
je 0x196ec
movl 0x50(%rbx), %eax
testl %eax, %eax
je 0x196b0
cmpl $0x1, 0x310(%r15)
jne 0x196ab
cmpl $0x2, %eax
jne 0x196b0
jmp 0x196ec
cmpl $0x1, %eax
je 0x196ec
movl 0x54(%rbx), %eax
testl %eax, %eax
je 0x196cd
cmpl $0x2, 0x310(%r15)
jne 0x196c8
cmpl $0x2, %eax
jne 0x196cd
jmp 0x196ec
cmpl $0x1, %eax
je 0x196ec
movl 0x3c(%rbx), %eax
testl %eax, %eax
je 0x196e3
cmpb $0x0, 0x304(%r15)
je 0x196e7
cmpl $0x2, %eax
je 0x196ec
movb $0x1, %al
jmp 0x196ee
cmpl $0x1, %eax
jne 0x196e3
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq