// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/query.c
// Function: desktop_matches
bool desktop_matches(coordinates_t *loc, coordinates_t *ref, desktop_select_t *sel)
{
	if (sel->occupied != OPTION_NONE &&
	    loc->desktop->root == NULL
	    ? sel->occupied == OPTION_TRUE
	    : sel->occupied == OPTION_FALSE) {
		return false;
	}

	if (sel->focused != OPTION_NONE &&
	    loc->desktop != mon->desk
	    ? sel->focused == OPTION_TRUE
	    : sel->focused == 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->urgent != OPTION_NONE &&
	    !is_urgent(loc->desktop)
	    ? sel->urgent == OPTION_TRUE
	    : sel->urgent == OPTION_FALSE) {
		return false;
	}

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

#define DLAYOUT(p, e) \
	if (sel->p != OPTION_NONE && \
	    loc->desktop->layout != e \
	    ? sel->p == OPTION_TRUE \
	    : sel->p == OPTION_FALSE) { \
		return false; \
	}
	DLAYOUT(tiled, LAYOUT_TILED)
	DLAYOUT(monocle, LAYOUT_MONOCLE)
#undef DLAYOUT

#define DUSERLAYOUT(p, e) \
	if (sel->p != OPTION_NONE && \
	    loc->desktop->user_layout != e \
	    ? sel->p == OPTION_TRUE \
	    : sel->p == OPTION_FALSE) { \
		return false; \
	}
	DUSERLAYOUT(user_tiled, LAYOUT_TILED)
	DUSERLAYOUT(user_monocle, LAYOUT_MONOCLE)
#undef DUSERLAYOUT

	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movl (%rdx), %eax
testl %eax, %eax
je 0x18fe6
movq 0x8(%rbx), %rcx
cmpq $0x0, 0x30(%rcx)
je 0x18fdd
cmpl $0x2, %eax
jne 0x18fe6
jmp 0x190fe
cmpl $0x1, %eax
je 0x190fe
movl 0x4(%r14), %eax
testl %eax, %eax
je 0x19015
movq 0x8(%rbx), %rcx
leaq 0x10717(%rip), %rdx     # 0x29710
movq (%rdx), %rdx
cmpq 0x58(%rdx), %rcx
je 0x1900c
cmpl $0x1, %eax
jne 0x19015
jmp 0x190fe
cmpl $0x2, %eax
je 0x190fe
movl 0x8(%r14), %eax
testl %eax, %eax
je 0x1903d
movq (%rbx), %rcx
movq 0x8(%rbx), %rdx
cmpq 0x58(%rcx), %rdx
je 0x19034
cmpl $0x1, %eax
jne 0x1903d
jmp 0x190fe
cmpl $0x2, %eax
je 0x190fe
cmpl $0x0, 0xc(%r14)
je 0x19068
movq 0x8(%rbx), %rdi
callq 0x891e
movl 0xc(%r14), %ecx
testb %al, %al
je 0x1905f
cmpl $0x2, %ecx
jne 0x19068
jmp 0x190fe
cmpl $0x1, %ecx
je 0x190fe
movl 0x10(%r14), %eax
testl %eax, %eax
je 0x19084
movq (%r15), %rcx
cmpq (%rbx), %rcx
je 0x1907f
cmpl $0x1, %eax
jne 0x19084
jmp 0x190fe
cmpl $0x2, %eax
je 0x190fe
movl 0x14(%r14), %eax
testl %eax, %eax
je 0x190a2
movq 0x8(%rbx), %rcx
cmpl $0x0, 0x24(%rcx)
je 0x1909d
cmpl $0x1, %eax
jne 0x190a2
jmp 0x190fe
cmpl $0x2, %eax
je 0x190fe
movl 0x18(%r14), %eax
testl %eax, %eax
je 0x190c0
movq 0x8(%rbx), %rcx
cmpl $0x1, 0x24(%rcx)
jne 0x190bb
cmpl $0x2, %eax
jne 0x190c0
jmp 0x190fe
cmpl $0x1, %eax
je 0x190fe
movl 0x1c(%r14), %eax
testl %eax, %eax
je 0x190de
movq 0x8(%rbx), %rcx
cmpl $0x0, 0x28(%rcx)
je 0x190d9
cmpl $0x1, %eax
jne 0x190de
jmp 0x190fe
cmpl $0x2, %eax
je 0x190fe
movl 0x20(%r14), %eax
testl %eax, %eax
je 0x190f5
movq 0x8(%rbx), %rcx
cmpl $0x1, 0x28(%rcx)
jne 0x190f9
cmpl $0x2, %eax
je 0x190fe
movb $0x1, %al
jmp 0x19100
cmpl $0x1, %eax
jne 0x190f5
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq