// File: /workspace/github_c_makefile_star2_O1/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 0x190d6
movq 0x8(%rbx), %rcx
cmpq $0x0, 0x30(%rcx)
je 0x190cd
cmpl $0x2, %eax
jne 0x190d6
jmp 0x191ee
cmpl $0x1, %eax
je 0x191ee
movl 0x4(%r14), %eax
testl %eax, %eax
je 0x19105
movq 0x8(%rbx), %rcx
leaq 0x10627(%rip), %rdx     # 0x29710
movq (%rdx), %rdx
cmpq 0x58(%rdx), %rcx
je 0x190fc
cmpl $0x1, %eax
jne 0x19105
jmp 0x191ee
cmpl $0x2, %eax
je 0x191ee
movl 0x8(%r14), %eax
testl %eax, %eax
je 0x1912d
movq (%rbx), %rcx
movq 0x8(%rbx), %rdx
cmpq 0x58(%rcx), %rdx
je 0x19124
cmpl $0x1, %eax
jne 0x1912d
jmp 0x191ee
cmpl $0x2, %eax
je 0x191ee
cmpl $0x0, 0xc(%r14)
je 0x19141
movq 0x8(%rbx), %rdi
callq 0x8a20
testb %al, %al
je 0x1914d
cmpl $0x2, 0xc(%r14)
jne 0x19158
jmp 0x191ee
cmpl $0x1, 0xc(%r14)
je 0x191ee
movl 0x10(%r14), %eax
testl %eax, %eax
je 0x19174
movq (%r15), %rcx
cmpq (%rbx), %rcx
je 0x1916f
cmpl $0x1, %eax
jne 0x19174
jmp 0x191ee
cmpl $0x2, %eax
je 0x191ee
movl 0x14(%r14), %eax
testl %eax, %eax
je 0x19192
movq 0x8(%rbx), %rcx
cmpl $0x0, 0x24(%rcx)
je 0x1918d
cmpl $0x1, %eax
jne 0x19192
jmp 0x191ee
cmpl $0x2, %eax
je 0x191ee
movl 0x18(%r14), %eax
testl %eax, %eax
je 0x191b0
movq 0x8(%rbx), %rcx
cmpl $0x1, 0x24(%rcx)
jne 0x191ab
cmpl $0x2, %eax
jne 0x191b0
jmp 0x191ee
cmpl $0x1, %eax
je 0x191ee
movl 0x1c(%r14), %eax
testl %eax, %eax
je 0x191ce
movq 0x8(%rbx), %rcx
cmpl $0x0, 0x28(%rcx)
je 0x191c9
cmpl $0x1, %eax
jne 0x191ce
jmp 0x191ee
cmpl $0x2, %eax
je 0x191ee
movl 0x20(%r14), %eax
testl %eax, %eax
je 0x191e5
movq 0x8(%rbx), %rcx
cmpl $0x1, 0x28(%rcx)
jne 0x191e9
cmpl $0x2, %eax
je 0x191ee
movb $0x1, %al
jmp 0x191f0
cmpl $0x1, %eax
jne 0x191e5
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq