// File: /workspace/github_c_makefile_star2_O3/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 0x19604
movq %rdx, %rbx
movq %rsi, %r14
movl 0x4(%rdx), %eax
testl %eax, %eax
je 0x1922f
leaq 0x10501(%rip), %rcx     # 0x29710
movq (%rcx), %rcx
movq 0x58(%rcx), %rcx
cmpq 0x38(%rcx), %rdi
je 0x19226
cmpl $0x1, %eax
jne 0x1922f
jmp 0x19604
cmpl $0x2, %eax
je 0x19604
movl 0x8(%rbx), %eax
testl %eax, %eax
je 0x19253
movq 0x8(%r15), %rcx
cmpq 0x38(%rcx), %rdi
je 0x1924a
cmpl $0x1, %eax
jne 0x19253
jmp 0x19604
cmpl $0x2, %eax
je 0x19604
movl (%rbx), %ecx
testl %ecx, %ecx
je 0x19273
cmpq $0x0, 0x10(%rdi)
je 0x1926a
cmpl $0x1, %ecx
jne 0x19273
jmp 0x19604
cmpl $0x2, %ecx
je 0x19604
movl 0xc(%rbx), %ecx
testl %ecx, %ecx
je 0x19297
movq 0x8(%r15), %rdx
cmpq 0x8(%r14), %rdx
je 0x1928e
cmpl $0x1, %ecx
jne 0x19297
jmp 0x19604
cmpl $0x2, %ecx
je 0x19604
testl %eax, %eax
je 0x192bb
movq (%r15), %rcx
movq 0x8(%r15), %rdx
cmpq 0x58(%rcx), %rdx
je 0x192b2
cmpl $0x1, %eax
jne 0x192bb
jmp 0x19604
cmpl $0x2, %eax
je 0x19604
cmpl $0x0, 0x10(%rbx)
je 0x192e0
callq 0x8e3d
movl 0x10(%rbx), %ecx
testb %al, %al
je 0x192d7
cmpl $0x2, %ecx
jne 0x192e0
jmp 0x19604
cmpl $0x1, %ecx
je 0x19604
movl 0x14(%rbx), %eax
testl %eax, %eax
je 0x19305
movq 0x10(%r15), %rcx
cmpq $0x0, 0x48(%rcx)
je 0x192fc
cmpl $0x2, %eax
jne 0x19305
jmp 0x19604
cmpl $0x1, %eax
je 0x19604
movl 0x28(%rbx), %eax
testl %eax, %eax
je 0x19329
movq 0x10(%r15), %rcx
cmpb $0x0, 0x25(%rcx)
je 0x19320
cmpl $0x2, %eax
jne 0x19329
jmp 0x19604
cmpl $0x1, %eax
je 0x19604
movl 0x2c(%rbx), %eax
testl %eax, %eax
je 0x1934d
movq 0x10(%r15), %rcx
cmpb $0x0, 0x26(%rcx)
je 0x19344
cmpl $0x2, %eax
jne 0x1934d
jmp 0x19604
cmpl $0x1, %eax
je 0x19604
movl 0x30(%rbx), %eax
testl %eax, %eax
je 0x19371
movq 0x10(%r15), %rcx
cmpb $0x0, 0x27(%rcx)
je 0x19368
cmpl $0x2, %eax
jne 0x19371
jmp 0x19604
cmpl $0x1, %eax
je 0x19604
movl 0x34(%rbx), %eax
testl %eax, %eax
je 0x19395
movq 0x10(%r15), %rcx
cmpb $0x0, 0x28(%rcx)
je 0x1938c
cmpl $0x2, %eax
jne 0x19395
jmp 0x19604
cmpl $0x1, %eax
je 0x19604
movl 0x38(%rbx), %eax
testl %eax, %eax
je 0x193b9
movq 0x10(%r15), %rcx
cmpb $0x0, 0x29(%rcx)
je 0x193b0
cmpl $0x2, %eax
jne 0x193b9
jmp 0x19604
cmpl $0x1, %eax
je 0x19604
movl 0x58(%rbx), %eax
testl %eax, %eax
je 0x193dd
movq 0x10(%r15), %rcx
cmpl $0x0, 0x4(%rcx)
je 0x193d4
cmpl $0x1, %eax
jne 0x193dd
jmp 0x19604
cmpl $0x2, %eax
je 0x19604
movl 0x5c(%rbx), %eax
testl %eax, %eax
je 0x19401
movq 0x10(%r15), %rcx
cmpl $0x1, 0x4(%rcx)
jne 0x193f8
cmpl $0x2, %eax
jne 0x19401
jmp 0x19604
cmpl $0x1, %eax
je 0x19604
cmpl $0x0, 0x44(%rbx)
je 0x1942e
movq 0x10(%r15), %rdi
movq 0x10(%r14), %rsi
callq 0x9dbb
movl 0x44(%rbx), %ecx
testb %al, %al
je 0x19425
cmpl $0x2, %ecx
jne 0x1942e
jmp 0x19604
cmpl $0x1, %ecx
je 0x19604
cmpl $0x0, 0x48(%rbx)
je 0x1945b
movq 0x10(%r14), %rdi
movq 0x10(%r15), %rsi
callq 0x9dbb
movl 0x48(%rbx), %ecx
testb %al, %al
je 0x19452
cmpl $0x2, %ecx
jne 0x1945b
jmp 0x19604
cmpl $0x1, %ecx
je 0x19604
movq 0x10(%r15), %rax
movq 0x48(%rax), %r15
testq %r15, %r15
je 0x194b6
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x19491
movq 0x48(%rax), %rsi
testq %rsi, %rsi
je 0x19491
movl 0x40(%rbx), %ebp
testl %ebp, %ebp
je 0x19491
movq %r15, %rdi
callq 0x4820
testl %eax, %eax
je 0x1955a
cmpl $0x1, 0x40(%rbx)
je 0x19604
movl 0x18(%rbx), %eax
testl %eax, %eax
je 0x1951b
cmpl $0x0, 0x308(%r15)
je 0x19512
cmpl $0x1, %eax
jne 0x1951b
jmp 0x19604
cmpl $0x1, 0x40(%rbx)
je 0x19604
cmpl $0x1, 0x18(%rbx)
je 0x19604
cmpl $0x1, 0x1c(%rbx)
je 0x19604
cmpl $0x1, 0x20(%rbx)
je 0x19604
cmpl $0x1, 0x24(%rbx)
je 0x19604
cmpl $0x1, 0x4c(%rbx)
je 0x19604
cmpl $0x1, 0x50(%rbx)
je 0x19604
cmpl $0x1, 0x54(%rbx)
je 0x19604
cmpl $0x1, 0x3c(%rbx)
setne %al
jmp 0x19606
cmpl $0x2, %eax
je 0x19604
movl 0x1c(%rbx), %eax
testl %eax, %eax
je 0x1953f
cmpl $0x1, 0x308(%r15)
jne 0x19536
cmpl $0x2, %eax
jne 0x1953f
jmp 0x19604
cmpl $0x1, %eax
je 0x19604
movl 0x20(%rbx), %eax
testl %eax, %eax
je 0x19571
cmpl $0x2, 0x308(%r15)
jne 0x19568
cmpl $0x2, %eax
jne 0x19571
jmp 0x19604
cmpl $0x2, %ebp
jne 0x1949b
jmp 0x19604
cmpl $0x1, %eax
je 0x19604
movl 0x24(%rbx), %eax
testl %eax, %eax
je 0x1958e
cmpl $0x3, 0x308(%r15)
jne 0x19589
cmpl $0x2, %eax
jne 0x1958e
jmp 0x19604
cmpl $0x1, %eax
je 0x19604
movl 0x4c(%rbx), %eax
testl %eax, %eax
je 0x195ab
cmpl $0x0, 0x310(%r15)
je 0x195a6
cmpl $0x1, %eax
jne 0x195ab
jmp 0x19604
cmpl $0x2, %eax
je 0x19604
movl 0x50(%rbx), %eax
testl %eax, %eax
je 0x195c8
cmpl $0x1, 0x310(%r15)
jne 0x195c3
cmpl $0x2, %eax
jne 0x195c8
jmp 0x19604
cmpl $0x1, %eax
je 0x19604
movl 0x54(%rbx), %eax
testl %eax, %eax
je 0x195e5
cmpl $0x2, 0x310(%r15)
jne 0x195e0
cmpl $0x2, %eax
jne 0x195e5
jmp 0x19604
cmpl $0x1, %eax
je 0x19604
movl 0x3c(%rbx), %eax
testl %eax, %eax
je 0x195fb
cmpb $0x0, 0x304(%r15)
je 0x195ff
cmpl $0x2, %eax
je 0x19604
movb $0x1, %al
jmp 0x19606
cmpl $0x1, %eax
jne 0x195fb
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq