LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/parse.c
// Function: parse_state_transition
bool parse_state_transition(char *s, state_transition_t *m)
{
	if (streq("none", s)) {
		*m = 0;
		return true;
	} else if (streq("all", s)) {
		*m = STATE_TRANSITION_ENTER | STATE_TRANSITION_EXIT;
		return true;
	} else {
		state_transition_t w = 0;
		char *x = copy_string(s, strlen(s));
		char *key = strtok(x, ",");
		while (key != NULL) {
			if (streq("enter", key)) {
				w |= STATE_TRANSITION_ENTER;
			} else if (streq("exit", key)) {
				w |= STATE_TRANSITION_EXIT;
			} else {
				free(x);
				return false;
			}
			key = strtok(NULL, ",");
		}
		free(x);
		if (w != 0) {
			*m = w;
			return true;
		} else {
			return false;
		}
	}
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x993d(%rip), %rdi      # 0x20ad1
movq %r14, %rsi
callq 0x4820
testl %eax, %eax
je 0x17242
leaq 0x9945(%rip), %rdi      # 0x20af0
movq %r14, %rsi
callq 0x4820
testl %eax, %eax
je 0x1724a
movq %r14, %rdi
callq 0x4470
movq %r14, %rdi
movq %rax, %rsi
callq 0x5e6e
leaq 0x9e61(%rip), %rsi      # 0x21036
movq %rax, (%rsp)
movq %rax, %rdi
callq 0x4850
testq %rax, %rax
je 0x17252
movq %rax, %rbp
xorl %r14d, %r14d
leaq 0xa3db(%rip), %r15      # 0x215ce
leaq 0x9e3c(%rip), %r12      # 0x21036
leaq 0x9f98(%rip), %r13      # 0x21199
movq %r15, %rdi
movq %rbp, %rsi
callq 0x4820
testl %eax, %eax
je 0x17226
movq %r13, %rdi
movq %rbp, %rsi
callq 0x4820
movl $0x2, %ecx
testl %eax, %eax
je 0x1722b
jmp 0x1726a
movl $0x1, %ecx
orl %ecx, %r14d
xorl %edi, %edi
movq %r12, %rsi
callq 0x4850
movq %rax, %rbp
testq %rax, %rax
jne 0x17201
jmp 0x17255
movl $0x0, (%rbx)
jmp 0x17266
movl $0x3, (%rbx)
jmp 0x17266
xorl %r14d, %r14d
movq (%rsp), %rdi
callq 0x4460
testl %r14d, %r14d
je 0x17273
movl %r14d, (%rbx)
movb $0x1, %al
jmp 0x17275
movq (%rsp), %rdi
callq 0x4460
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/parse.c
// Function: parse_degree
bool parse_degree(char *s, int *d)
{
	int i = atoi(s);
	while (i < 0)
		i += 360;
	while (i > 359)
		i -= 360;
	if ((i % 90) != 0) {
		return false;
	} else {
		*d = i;
		return true;
	}
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
callq 0x46b0
movl %eax, %ecx
shrl $0x1f, %ecx
xorl %edx, %edx
testl %eax, %eax
cmovgl %eax, %edx
subl %eax, %edx
subl %ecx, %edx
shrl $0x3, %edx
imulq $0x16c16c17, %rdx, %rdx # imm = 0x16C16C17
shrq $0x22, %rdx
addl %ecx, %edx
imull $0x168, %edx, %ecx      # imm = 0x168
addl %eax, %ecx
cmpl $0x168, %ecx            # imm = 0x168
movl $0x167, %edx            # imm = 0x167
cmovgel %ecx, %edx
movl $0xb60b60b7, %esi       # imm = 0xB60B60B7
movq %rdx, %rax
imulq %rsi, %rax
shrq $0x28, %rax
imull $0x168, %eax, %edi      # imm = 0x168
movl %edx, %eax
subl %edi, %eax
subl %edx, %eax
addl %ecx, %eax
movl %eax, %ecx
shrl %ecx
imulq %rsi, %rcx
shrq $0x25, %rcx
imull $0x5a, %ecx, %edx
movl %eax, %ecx
subl %edx, %ecx
jne 0x1733f
movl %eax, (%rbx)
testl %ecx, %ecx
sete %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/parse.c
// Function: parse_id
bool parse_id(char *s, uint32_t *id)
{
	char *end;
	errno = 0;
	uint32_t v = strtol(s, &end, 0);
	if (errno != 0 || *end != '\0') {
		return false;
	}
	*id = v;
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x47a0
movq %rax, %r15
movl $0x0, (%rax)
movq %rsp, %rsi
xorl %ebp, %ebp
movq %r14, %rdi
xorl %edx, %edx
callq 0x4680
cmpl $0x0, (%r15)
jne 0x17388
movq (%rsp), %rcx
cmpb $0x0, (%rcx)
je 0x17383
xorl %ebp, %ebp
jmp 0x17388
movl %eax, (%rbx)
movb $0x1, %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/parse.c
// Function: parse_bool_declaration
bool parse_bool_declaration(char *s, char **key, bool *value, alter_state_t *state)
{
	*key = strtok(s, EQL_TOK);
	char *v = strtok(NULL, EQL_TOK);
	if (v == NULL) {
		*state = ALTER_TOGGLE;
		return true;
	} else {
		if (parse_bool(v, value)) {
			*state = ALTER_SET;
			return true;
		} else {
			return false;
		}
	}
	return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
leaq 0x89ff(%rip), %r12      # 0x1fdac
movq %r12, %rsi
callq 0x4850
movq %rax, (%r15)
xorl %r15d, %r15d
xorl %edi, %edi
movq %r12, %rsi
callq 0x4850
testq %rax, %rax
je 0x173df
movq %rax, %rdi
movq %r14, %rsi
callq 0x169bc
movl $0x1, %r15d
testb %al, %al
je 0x173e6
movl %r15d, (%rbx)
movb $0x1, %al
jmp 0x173e8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/parse.c
// Function: parse_rectangle
bool parse_rectangle(char *s, xcb_rectangle_t *r)
{
	uint16_t w, h;
	int16_t x, y;
	if (sscanf(s, "%hux%hu+%hi+%hi", &w, &h, &x, &y) != 4) {
		return false;
	}
	r->width = w;
	r->height = h;
	r->x = x;
	r->y = y;
	return true;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
leaq 0x96dc(%rip), %rsi      # 0x20af9
leaq 0xe(%rsp), %rdx
leaq 0xc(%rsp), %rcx
leaq 0xa(%rsp), %r8
leaq 0x8(%rsp), %r9
xorl %eax, %eax
callq 0x41c0
cmpl $0x4, %eax
jne 0x17460
movzwl 0xe(%rsp), %ecx
movw %cx, 0x4(%rbx)
movzwl 0xc(%rsp), %ecx
movw %cx, 0x6(%rbx)
movzwl 0xa(%rsp), %ecx
movw %cx, (%rbx)
movzwl 0x8(%rsp), %ecx
movw %cx, 0x2(%rbx)
cmpl $0x4, %eax
sete %al
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/parse.c
// Function: parse_monitor_modifiers
bool parse_monitor_modifiers(char *desc, monitor_select_t *sel)
{
	char *tok;
	while ((tok = strrchr(desc, CAT_CHR)) != NULL) {
		tok[0] = '\0';
		tok++;
		if (streq("occupied", tok)) {
			sel->occupied = OPTION_TRUE;
		} else if (streq("!occupied", tok)) {
			sel->occupied = OPTION_FALSE;
		GET_MOD(focused)
		} else {
			return false;
		}
	}
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x2e, %esi
callq 0x4560
testq %rax, %rax
sete %bpl
je 0x17930
movq %rax, %r13
leaq 0x93d7(%rip), %r15      # 0x20c77
leaq 0x93cf(%rip), %r12      # 0x20c76
movb $0x0, (%r13)
incq %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x4820
testl %eax, %eax
je 0x178fc
movq %r12, %rdi
movq %r13, %rsi
callq 0x4820
testl %eax, %eax
je 0x17904
leaq 0x93ad(%rip), %rdi      # 0x20c81
movq %r13, %rsi
callq 0x4820
testl %eax, %eax
je 0x1790c
leaq 0x9399(%rip), %rdi      # 0x20c80
movq %r13, %rsi
callq 0x4820
testl %eax, %eax
jne 0x17930
movl $0x2, 0x4(%rbx)
jmp 0x17913
movl $0x1, (%rbx)
jmp 0x17913
movl $0x2, (%rbx)
jmp 0x17913
movl $0x1, 0x4(%rbx)
movq %r14, %rdi
movl $0x2e, %esi
callq 0x4560
movq %rax, %r13
testq %rax, %rax
sete %bpl
jne 0x178a7
andb $0x1, %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: query_state
void query_state(FILE *rsp)
{
	fprintf(rsp, "{");
	fprintf(rsp, "\"focusedMonitorId\":%u,", mon->id);
	if (pri_mon != NULL) {
		fprintf(rsp, "\"primaryMonitorId\":%u,", pri_mon->id);
	}
	fprintf(rsp, "\"clientsCount\":%i,", clients_count);
	fprintf(rsp, "\"monitors\":");
	fprintf(rsp, "[");
	for (monitor_t *m = mon_head; m != NULL; m = m->next) {
		query_monitor(m, rsp);
		if (m->next != NULL) {
			fprintf(rsp, ",");
		}
	}
	fprintf(rsp, "]");
	fprintf(rsp,",");
	fprintf(rsp, "\"focusHistory\":");
	query_history(rsp);
	fprintf(rsp,",");
	fprintf(rsp, "\"stackingList\":");
	query_stack(rsp);
	if (restart) {
		fprintf(rsp,",");
		fprintf(rsp, "\"eventSubscribers\":");
		query_subscribers(rsp);
	}
	fprintf(rsp, "}");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x7b, %edi
movq %rbx, %rsi
callq 0x4420
leaq 0x11435(%rip), %rax     # 0x29710
movq (%rax), %rax
movl 0x20(%rax), %edx
leaq 0x8af0(%rip), %rsi      # 0x20dd8
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4a30
leaq 0x113ff(%rip), %rax     # 0x296f8
movq (%rax), %rax
testq %rax, %rax
je 0x18315
movl 0x20(%rax), %edx
leaq 0x8ae4(%rip), %rsi      # 0x20def
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4a30
leaq 0x113d8(%rip), %rax     # 0x296f4
movl (%rax), %edx
leaq 0x8ae1(%rip), %rsi      # 0x20e06
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4a30
leaq 0x8ae3(%rip), %rdi      # 0x20e19
movl $0xb, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x49e0
movl $0x5b, %edi
movq %rbx, %rsi
callq 0x4420
leaq 0x113ac(%rip), %rax     # 0x29708
movq (%rax), %r14
testq %r14, %r14
je 0x18389
movq %r14, %rdi
movq %rbx, %rsi
callq 0x18440
cmpq $0x0, 0x78(%r14)
je 0x18383
movl $0x2c, %edi
movq %rbx, %rsi
callq 0x4420
movq 0x78(%r14), %r14
jmp 0x1835f
movl $0x5d, %edi
movq %rbx, %rsi
callq 0x4420
movl $0x2c, %edi
movq %rbx, %rsi
callq 0x4420
leaq 0x8a7b(%rip), %rdi      # 0x20e25
movl $0xf, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x49e0
movq %rbx, %rdi
callq 0x18626
movl $0x2c, %edi
movq %rbx, %rsi
callq 0x4420
leaq 0x8a5d(%rip), %rdi      # 0x20e35
movl $0xf, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x49e0
movq %rbx, %rdi
callq 0x18682
leaq 0x112e7(%rip), %rax     # 0x296e0
cmpb $0x0, (%rax)
je 0x1842c
movl $0x2c, %edi
movq %rbx, %rsi
callq 0x4420
leaq 0x8a33(%rip), %rdi      # 0x20e45
movl $0x13, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x49e0
movq %rbx, %rdi
callq 0x186ee
movl $0x7d, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4420
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: query_history
void query_history(FILE *rsp)
{
	fprintf(rsp, "[");
	for (history_t *h = history_head; h != NULL; h = h->next) {
		query_coordinates(&h->loc, rsp);
		if (h->next != NULL) {
			fprintf(rsp, ",");
		}
	}
	fprintf(rsp, "]");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x5b, %edi
movq %rbx, %rsi
callq 0x4420
leaq 0x110e7(%rip), %rax     # 0x29728
movq (%rax), %r14
testq %r14, %r14
je 0x1866e
movq %r14, %rdi
movq %rbx, %rsi
callq 0x18f1b
cmpq $0x0, 0x28(%r14)
je 0x18668
movl $0x2c, %edi
movq %rbx, %rsi
callq 0x4420
movq 0x28(%r14), %r14
jmp 0x18644
movl $0x5d, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4420
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: query_stack
void query_stack(FILE *rsp)
{
	fprintf(rsp, "[");
	for (stacking_list_t *s = stack_head; s != NULL; s = s->next) {
		fprintf(rsp, "%u", s->node->id);
		if (s->next != NULL) {
			fprintf(rsp, ",");
		}
	}
	fprintf(rsp, "]");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x5b, %edi
movq %rbx, %rsi
callq 0x4420
leaq 0x110aa(%rip), %rax     # 0x29748
movq (%rax), %r15
testq %r15, %r15
je 0x186dc
leaq 0x7f6e(%rip), %r14      # 0x2061b
movq (%r15), %rax
movl (%rax), %edx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x4a30
cmpq $0x0, 0x10(%r15)
je 0x186d3
movl $0x2c, %edi
movq %rbx, %rsi
callq 0x4420
movq 0x10(%r15), %r15
testq %r15, %r15
jne 0x186ad
movl $0x5d, %edi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x4420
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: query_subscribers
void query_subscribers(FILE *rsp)
{
	fprintf(rsp, "[");
	for (subscriber_list_t *s = subscribe_head; s != NULL; s = s->next) {
		fprintf(rsp, "{\"fileDescriptor\": %i", fileno(s->stream));
		if (s->fifo_path != NULL) {
			fprintf(rsp, ",\"fifoPath\":\"%s\"", s->fifo_path);
		}
		fprintf(rsp, ",\"field\":%i,\"count\":%i}", s->field, s->count);
		if (s->next != NULL) {
			fprintf(rsp, ",");
		}
	}
	fprintf(rsp, "]");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl $0x5b, %edi
movq %rbx, %rsi
callq 0x4420
leaq 0x1104a(%rip), %rax     # 0x29758
movq (%rax), %r13
testq %r13, %r13
je 0x1878b
leaq 0x8a3b(%rip), %r14      # 0x21158
leaq 0x8a5b(%rip), %r15      # 0x2117f
leaq 0x8a43(%rip), %r12      # 0x2116e
movq (%r13), %rdi
callq 0x4060
movq %rbx, %rdi
movq %r14, %rsi
movl %eax, %edx
xorl %eax, %eax
callq 0x4a30
movq 0x8(%r13), %rdx
testq %rdx, %rdx
je 0x18759
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x4a30
movl 0x10(%r13), %edx
movl 0x14(%r13), %ecx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x4a30
cmpq $0x0, 0x20(%r13)
je 0x18782
movl $0x2c, %edi
movq %rbx, %rsi
callq 0x4420
movq 0x20(%r13), %r13
testq %r13, %r13
jne 0x1872b
movl $0x5d, %edi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x4420
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: query_desktop
void query_desktop(desktop_t *d, FILE *rsp)
{
	fprintf(rsp, "{");
	fprintf(rsp, "\"name\":\"%s\",", d->name);
	fprintf(rsp, "\"id\":%u,", d->id);
	fprintf(rsp, "\"layout\":\"%s\",", LAYOUT_STR(d->layout));
	fprintf(rsp, "\"userLayout\":\"%s\",", LAYOUT_STR(d->user_layout));
	fprintf(rsp, "\"windowGap\":%i,", d->window_gap);
	fprintf(rsp, "\"borderWidth\":%u,", d->border_width);
	fprintf(rsp, "\"focusedNodeId\":%u,", d->focus != NULL ? d->focus->id : 0);
	fprintf(rsp, "\"padding\":");
	query_padding(d->padding, rsp);
	fprintf(rsp,",");
	fprintf(rsp, "\"root\":");
	query_node(d->root, rsp);
	fprintf(rsp, "}");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x7b, %edi
callq 0x4420
leaq 0x8640(%rip), %rsi      # 0x20e59
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x4a30
movl 0x20(%r14), %edx
leaq 0x8633(%rip), %rsi      # 0x20e66
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4a30
cmpl $0x0, 0x24(%r14)
leaq 0x8458(%rip), %r12      # 0x20ca1
leaq 0x8458(%rip), %r15      # 0x20ca8
movq %r15, %rdx
cmoveq %r12, %rdx
leaq 0x869a(%rip), %rsi      # 0x20ef8
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4a30
cmpl $0x0, 0x28(%r14)
cmoveq %r12, %r15
leaq 0x868f(%rip), %rsi      # 0x20f07
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x4a30
movl 0x60(%r14), %edx
leaq 0x860b(%rip), %rsi      # 0x20e9b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4a30
movl 0x64(%r14), %edx
leaq 0x8606(%rip), %rsi      # 0x20eab
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4a30
movq 0x38(%r14), %rax
testq %rax, %rax
je 0x188ba
movl (%rax), %ebp
leaq 0x8659(%rip), %rsi      # 0x20f1a
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x4a30
leaq 0x8600(%rip), %rdi      # 0x20ed4
movl $0xa, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x49e0
movq 0x50(%r14), %rdx
movq 0x58(%r14), %r8
movq %rdx, %rcx
shrq $0x20, %rcx
movq %r8, %r9
shrq $0x20, %r9
leaq 0x87fd(%rip), %rsi      # 0x21100
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4a30
movl $0x2c, %edi
movq %rbx, %rsi
callq 0x4420
leaq 0x860d(%rip), %rdi      # 0x20f2e
movl $0x7, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x49e0
movq 0x30(%r14), %rdi
movq %rbx, %rsi
callq 0x18954
movl $0x7d, %edi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4420
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: query_presel
void query_presel(presel_t *p, FILE *rsp)
{
	if (p == NULL) {
		fprintf(rsp, "null");
	} else {
		fprintf(rsp, "{\"splitDir\":\"%s\",\"splitRatio\":%lf}", SPLIT_DIR_STR(p->split_dir), p->split_ratio);
	}
}

// Assembly:
movq %rsi, %rcx
testq %rdi, %rdi
je 0x18c2e
movl 0x8(%rdi), %eax
testl %eax, %eax
je 0x18c44
cmpl $0x1, %eax
jne 0x18c4d
leaq 0x8661(%rip), %rdx      # 0x2128d
jmp 0x18c62
leaq 0x8301(%rip), %rdi      # 0x20f36
movl $0x4, %esi
movl $0x1, %edx
jmp 0x49e0
leaq 0x6a2e(%rip), %rdx      # 0x1f679
jmp 0x18c62
cmpl $0x2, %eax
leaq 0x6a28(%rip), %rax      # 0x1f67f
leaq 0x6a27(%rip), %rdx      # 0x1f685
cmoveq %rax, %rdx
movsd (%rdi), %xmm0
leaq 0x8381(%rip), %rsi      # 0x20fee
movq %rcx, %rdi
movb $0x1, %al
jmp 0x4a30
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: query_node_ids
int query_node_ids(coordinates_t *mon_ref, coordinates_t *desk_ref, coordinates_t* ref, coordinates_t *trg, monitor_select_t *mon_sel, desktop_select_t *desk_sel, node_select_t *sel, FILE *rsp)
{
	int count = 0;
	for (monitor_t *m = mon_head; m != NULL; m = m->next) {
		coordinates_t loc = {m, NULL, NULL};
		if ((trg->monitor != NULL && m != trg->monitor) ||
		    (mon_sel != NULL && !monitor_matches(&loc, mon_ref, mon_sel))) {
			continue;
		}
		for (desktop_t *d = m->desk_head; d != NULL; d = d->next) {
			coordinates_t loc = {m, d, NULL};
			if ((trg->desktop != NULL && d != trg->desktop) ||
			    (desk_sel != NULL && !desktop_matches(&loc, desk_ref, desk_sel))) {
				continue;
			}
			count += query_node_ids_in(d->root, d, m, ref, trg, sel, rsp);
		}
	}
	return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, 0x10(%rsp)
leaq 0x107a1(%rip), %rax     # 0x29708
movq (%rax), %rbp
testq %rbp, %rbp
je 0x19049
movq %r9, %rbx
movq %rcx, %r15
movq %rdx, %r12
movq %r8, 0x8(%rsp)
xorl %r14d, %r14d
movq %rbp, 0x30(%rsp)
leaq 0x38(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq (%r15), %rax
testq %rax, %rax
setne %cl
cmpq %rax, %rbp
setne %al
testb %al, %cl
jne 0x1903a
movq 0x8(%rsp), %rdx
testq %rdx, %rdx
je 0x18fc3
leaq 0x30(%rsp), %rdi
callq 0x1905e
testb %al, %al
je 0x1903a
movq 0x60(%rbp), %r13
testq %r13, %r13
je 0x1903a
movq %rbp, 0x18(%rsp)
movq %r13, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
movq 0x8(%r15), %rax
testq %rax, %rax
je 0x18fed
cmpq %rax, %r13
jne 0x19034
testq %rbx, %rbx
je 0x19008
leaq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0x190a4
testb %al, %al
je 0x19034
movq 0x30(%r13), %rdi
movq 0x88(%rsp), %rax
movq %rax, (%rsp)
movq %r13, %rsi
movq %rbp, %rdx
movq %r12, %rcx
movq %r15, %r8
movq 0x80(%rsp), %r9
callq 0x191f6
addl %eax, %r14d
movq 0x48(%r13), %r13
jmp 0x18fc7
movq 0x78(%rbp), %rbp
testq %rbp, %rbp
jne 0x18f84
jmp 0x1904c
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: monitor_matches
bool monitor_matches(coordinates_t *loc, __attribute__((unused)) coordinates_t *ref, monitor_select_t *sel)
{
	if (sel->occupied != OPTION_NONE &&
	    loc->monitor->desk->root == NULL
	    ? sel->occupied == OPTION_TRUE
	    : sel->occupied == OPTION_FALSE) {
		return false;
	}

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

	return true;
}

// Assembly:
movl (%rdx), %eax
testl %eax, %eax
je 0x1907e
movq (%rdi), %rcx
movq 0x58(%rcx), %rcx
cmpq $0x0, 0x30(%rcx)
je 0x19079
cmpl $0x2, %eax
jne 0x1907e
jmp 0x19099
cmpl $0x1, %eax
je 0x19099
movl 0x4(%rdx), %eax
testl %eax, %eax
je 0x190a1
movq (%rdi), %rcx
leaq 0x10681(%rip), %rdx     # 0x29710
cmpq (%rdx), %rcx
je 0x1909c
cmpl $0x1, %eax
jne 0x190a1
xorl %eax, %eax
retq
cmpl $0x2, %eax
je 0x19099
movb $0x1, %al
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: query_node_ids_in
int query_node_ids_in(node_t *n, desktop_t *d, monitor_t *m, coordinates_t *ref, coordinates_t *trg, node_select_t *sel, FILE *rsp)
{
	int count = 0;
	if (n == NULL) {
		return 0;
	} else {
		coordinates_t loc = {m, d, n};
		if ((trg->node == NULL || n == trg->node) &&
		    (sel == NULL || node_matches(&loc, ref, sel))) {
			fprintf(rsp, "0x%08X\n", n->id);
			count++;
		}
		count += query_node_ids_in(n->first_child, d, m, ref, trg, sel, rsp);
		count += query_node_ids_in(n->second_child, d, m, ref, trg, sel, rsp);
	}
	return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, 0x10(%rsp)
movq %r8, %r14
movq %rcx, 0x18(%rsp)
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
xorl %ebx, %ebx
testq %rbp, %rbp
je 0x192be
movq %r12, 0x20(%rsp)
movq %r13, 0x28(%rsp)
movq %rbp, 0x30(%rsp)
movq 0x10(%r14), %rax
testq %rax, %rax
setne %cl
cmpq %rbp, %rax
setne %al
xorl %r15d, %r15d
testb %al, %cl
jne 0x19287
cmpq $0x0, 0x10(%rsp)
je 0x1926b
leaq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq 0x192cf
testb %al, %al
je 0x19287
movl (%rbp), %edx
movq 0x70(%rsp), %rdi
leaq 0x6552(%rip), %rsi      # 0x1f7cc
xorl %eax, %eax
callq 0x4a30
movl $0x1, %r15d
movq 0x30(%rbp), %rdi
movq 0x70(%rsp), %rax
movq %rax, (%rsp)
movq %r13, %rsi
movq %r12, %rdx
movq 0x18(%rsp), %rcx
movq %r14, %r8
movq 0x10(%rsp), %r9
callq 0x191f6
movq 0x38(%rbp), %rbp
addl %ebx, %r15d
addl %eax, %r15d
movl %r15d, %ebx
jmp 0x1921c
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: query_desktop_ids
int query_desktop_ids(coordinates_t* mon_ref, coordinates_t *ref, coordinates_t *trg, monitor_select_t *mon_sel, desktop_select_t *sel, desktop_printer_t printer, FILE *rsp)
{
	int count = 0;
	for (monitor_t *m = mon_head; m != NULL; m = m->next) {
		coordinates_t loc = {m, NULL, NULL};
		if ((trg->monitor != NULL && m != trg->monitor) ||
		    (mon_sel != NULL && !monitor_matches(&loc, mon_ref, mon_sel))) {
			continue;
		}
		for (desktop_t *d = m->desk_head; d != NULL; d = d->next) {
			coordinates_t loc = {m, d, NULL};
			if ((trg->desktop != NULL && d != trg->desktop) ||
			    (sel != NULL && !desktop_matches(&loc, ref, sel))) {
				continue;
			}
			printer(d, rsp);
			count++;
		}
	}
	return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, 0x10(%rsp)
leaq 0xfff5(%rip), %rax      # 0x29708
movq (%rax), %r13
testq %r13, %r13
je 0x197d5
movq %r9, %rbx
movq %r8, %r14
movq %rdx, %r12
movq %rcx, 0x8(%rsp)
xorl %ebp, %ebp
movq %r13, 0x30(%rsp)
leaq 0x38(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq (%r12), %rax
testq %rax, %rax
setne %cl
cmpq %rax, %r13
setne %al
testb %al, %cl
jne 0x197c6
movq 0x8(%rsp), %rdx
testq %rdx, %rdx
je 0x1976b
leaq 0x30(%rsp), %rdi
callq 0x1905e
testb %al, %al
je 0x197c6
movq 0x60(%r13), %r15
testq %r15, %r15
je 0x197c6
movq %r13, 0x18(%rsp)
movq %r15, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
movq 0x8(%r12), %rax
testq %rax, %rax
je 0x19796
cmpq %rax, %r15
jne 0x197c0
testq %r14, %r14
je 0x197b1
leaq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %r14, %rdx
callq 0x190a4
testb %al, %al
je 0x197c0
movq %r15, %rdi
movq 0x80(%rsp), %rsi
callq *%rbx
incl %ebp
movq 0x48(%r15), %r15
jmp 0x1976f
movq 0x78(%r13), %r13
testq %r13, %r13
jne 0x1972f
jmp 0x197d7
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: query_monitor_ids
int query_monitor_ids(coordinates_t *ref, coordinates_t *trg, monitor_select_t *sel, monitor_printer_t printer, FILE *rsp)
{
	int count = 0;
	for (monitor_t *m = mon_head; m != NULL; m = m->next) {
		coordinates_t loc = {m, NULL, NULL};
		if ((trg->monitor != NULL && m != trg->monitor) ||
		    (sel != NULL && !monitor_matches(&loc, ref, sel))) {
			continue;
		}
		printer(m, rsp);
		count++;
	}
	return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, 0x8(%rsp)
leaq 0xff06(%rip), %rax      # 0x29708
movq (%rax), %r13
testq %r13, %r13
je 0x1986a
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
xorl %ebp, %ebp
leaq 0x18(%rsp), %rbx
xorps %xmm0, %xmm0
movq %r13, 0x10(%rsp)
movups %xmm0, (%rbx)
movq (%r12), %rax
testq %rax, %rax
setne %cl
cmpq %rax, %r13
setne %al
testb %al, %cl
jne 0x1985f
testq %r15, %r15
je 0x1984f
leaq 0x10(%rsp), %rdi
movq %r15, %rdx
callq 0x1905e
testb %al, %al
je 0x1985c
movq %r13, %rdi
movq 0x8(%rsp), %rsi
callq *%r14
incl %ebp
xorps %xmm0, %xmm0
movq 0x78(%r13), %r13
testq %r13, %r13
jne 0x1981d
jmp 0x1986c
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: print_ignore_request
void print_ignore_request(state_transition_t st, FILE *rsp)
{
	if (st == 0) {
		fprintf(rsp, "none");
	} else {
		unsigned int cnt = 0;
		if (st & STATE_TRANSITION_ENTER) {
			fprintf(rsp, "enter");
			cnt++;
		}
		if (st & STATE_TRANSITION_EXIT) {
			fprintf(rsp, "%sexit", cnt > 0 ? "," : "");
		}
	}
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
testl %edi, %edi
je 0x19911
movl %edi, %ebp
testb $0x1, %bpl
je 0x19904
leaq 0x7cdc(%rip), %rdi      # 0x215ce
movl $0x5, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x49e0
testb $0x2, %bpl
jne 0x19930
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x71b9(%rip), %rdi      # 0x20ad1
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x49e0
testb $0x1, %bpl
leaq 0x7c69(%rip), %rax      # 0x215a4
leaq 0x76f4(%rip), %rdx      # 0x21036
cmoveq %rax, %rdx
leaq 0x784a(%rip), %rsi      # 0x21197
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x4a30
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: print_modifier_mask
void print_modifier_mask(uint16_t m, FILE *rsp)
{
	switch (m) {
		case XCB_MOD_MASK_SHIFT:
			fprintf(rsp, "shift");
			break;
		case XCB_MOD_MASK_CONTROL:
			fprintf(rsp, "control");
			break;
		case XCB_MOD_MASK_LOCK:
			fprintf(rsp, "lock");
			break;
		case XCB_MOD_MASK_1:
			fprintf(rsp, "mod1");
			break;
		case XCB_MOD_MASK_2:
			fprintf(rsp, "mod2");
			break;
		case XCB_MOD_MASK_3:
			fprintf(rsp, "mod3");
			break;
		case XCB_MOD_MASK_4:
			fprintf(rsp, "mod4");
			break;
		case XCB_MOD_MASK_5:
			fprintf(rsp, "mod5");
			break;
	}
}

// Assembly:
movq %rsi, %rcx
cmpl $0xf, %edi
jg 0x1998e
decl %edi
cmpl $0x7, %edi
ja 0x199fb
leaq 0x740d(%rip), %rax      # 0x20d84
movslq (%rax,%rdi,4), %rdx
addq %rax, %rdx
jmpq *%rdx
leaq 0x7102(%rip), %rdi      # 0x20a89
movl $0x5, %esi
jmp 0x199f1
cmpl $0x3f, %edi
jg 0x199a6
cmpl $0x10, %edi
je 0x199dc
cmpl $0x20, %edi
jne 0x199fb
leaq 0x7102(%rip), %rdi      # 0x20aa6
jmp 0x199ec
cmpl $0x40, %edi
je 0x199e5
cmpl $0x80, %edi
jne 0x199fb
leaq 0x70f6(%rip), %rdi      # 0x20ab0
jmp 0x199ec
leaq 0x70d9(%rip), %rdi      # 0x20a9c
jmp 0x199ec
leaq 0x70cb(%rip), %rdi      # 0x20a97
jmp 0x199ec
leaq 0x70ba(%rip), %rdi      # 0x20a8f
movl $0x7, %esi
jmp 0x199f1
leaq 0x70be(%rip), %rdi      # 0x20aa1
jmp 0x199ec
leaq 0x70bf(%rip), %rdi      # 0x20aab
movl $0x4, %esi
movl $0x1, %edx
jmp 0x49e0
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: print_button_index
void print_button_index(int8_t b, FILE *rsp)
{
	switch (b) {
		case XCB_BUTTON_INDEX_ANY:
			fprintf(rsp, "any");
			break;
		case XCB_BUTTON_INDEX_1:
			fprintf(rsp, "button1");
			break;
		case XCB_BUTTON_INDEX_2:
			fprintf(rsp, "button2");
			break;
		case XCB_BUTTON_INDEX_3:
			fprintf(rsp, "button3");
			break;
		case -1:
			fprintf(rsp, "none");
			break;
	}
}

// Assembly:
incl %edi
cmpl $0x4, %edi
ja 0x19a5a
movq %rsi, %rcx
leaq 0x7397(%rip), %rax      # 0x20da4
movslq (%rax,%rdi,4), %rdx
addq %rax, %rdx
jmpq *%rdx
leaq 0x70b4(%rip), %rdi      # 0x20ad1
movl $0x4, %esi
jmp 0x19a50
leaq 0x709e(%rip), %rdi      # 0x20ac9
jmp 0x19a3d
leaq 0x7085(%rip), %rdi      # 0x20ab9
jmp 0x19a3d
leaq 0x7084(%rip), %rdi      # 0x20ac1
movl $0x7, %esi
jmp 0x19a50
leaq 0x706a(%rip), %rdi      # 0x20ab5
movl $0x3, %esi
movl $0x1, %edx
jmp 0x49e0
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: print_pointer_action
void print_pointer_action(pointer_action_t a, FILE *rsp)
{
	switch (a) {
		case ACTION_MOVE:
			fprintf(rsp, "move");
			break;
		case ACTION_RESIZE_SIDE:
			fprintf(rsp, "resize_side");
			break;
		case ACTION_RESIZE_CORNER:
			fprintf(rsp, "resize_corner");
			break;
		case ACTION_FOCUS:
			fprintf(rsp, "focus");
			break;
		case ACTION_NONE:
			fprintf(rsp, "none");
			break;
	}
}

// Assembly:
cmpl $0x4, %edi
ja 0x19abe
movq %rsi, %rcx
movl %edi, %eax
leaq 0x734c(%rip), %rdx      # 0x20db8
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
leaq 0x7055(%rip), %rdi      # 0x20ad1
jmp 0x19a93
leaq 0x7051(%rip), %rdi      # 0x20ad6
movl $0xd, %esi
jmp 0x19ab4
leaq 0x63b3(%rip), %rdi      # 0x1fe46
movl $0x4, %esi
jmp 0x19ab4
leaq 0x7043(%rip), %rdi      # 0x20ae4
movl $0xb, %esi
jmp 0x19ab4
leaq 0x6226(%rip), %rdi      # 0x1fcd5
movl $0x5, %esi
movl $0x1, %edx
jmp 0x49e0
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: resolve_rule_consequence
void resolve_rule_consequence(rule_consequence_t *csq)
{
	coordinates_t ref = {mon, mon->desk, mon->desk->focus};
	coordinates_t dst = {NULL, NULL, NULL};
	monitor_t *monitor = monitor_from_desc(csq->monitor_desc, &ref, &dst) != SELECTOR_OK ? NULL : dst.monitor;
	desktop_t *desktop = desktop_from_desc(csq->desktop_desc, &ref, &dst) != SELECTOR_OK ? NULL : dst.desktop;
	node_t *node = node_from_desc(csq->node_desc, &ref, &dst) != SELECTOR_OK ? NULL : dst.node;

#define PRINT_OBJECT_ID(name) \
	if (name == NULL) { \
		csq->name##_desc[0] = '\0'; \
	} else { \
		snprintf(csq->name##_desc, 11, "0x%08X", name->id); \
	}
	PRINT_OBJECT_ID(monitor)
	PRINT_OBJECT_ID(desktop)
	PRINT_OBJECT_ID(node)
#undef PRINT_OBJECT_ID
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0xfc39(%rip), %rax      # 0x29710
movq (%rax), %rax
leaq 0x30(%rsp), %r12
movq %rax, (%r12)
movq 0x58(%rax), %rax
movq %rax, 0x8(%r12)
movq 0x38(%rax), %rax
movq %rax, 0x10(%r12)
xorl %eax, %eax
leaq 0x10(%rsp), %r13
movq %rax, 0x10(%r13)
xorps %xmm0, %xmm0
movaps %xmm0, (%r13)
addq $0x300, %rdi            # imm = 0x300
movq %rdi, (%rsp)
movq %r12, %rsi
movq %r13, %rdx
callq 0x19c02
testl %eax, %eax
setne %r15b
movq (%r13), %rbp
leaq 0x400(%rbx), %rdi
movq %rdi, 0x8(%rsp)
movq %r12, %rsi
movq %r13, %rdx
callq 0x19fc7
movl $0x0, %r14d
testl %eax, %eax
jne 0x19b4e
movq 0x18(%rsp), %r14
addq $0x500, %rbx            # imm = 0x500
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x1a436
testl %eax, %eax
movl $0x0, %r12d
jne 0x19b72
movq 0x20(%rsp), %r12
testq %rbp, %rbp
sete %al
orb %al, %r15b
cmpb $0x1, %r15b
jne 0x19b8a
movq (%rsp), %rax
movb $0x0, (%rax)
jmp 0x19ba4
movl 0x20(%rbp), %ecx
leaq 0x760a(%rip), %rdx      # 0x2119e
movl $0xb, %esi
movq (%rsp), %rdi
xorl %eax, %eax
callq 0x4110
testq %r14, %r14
je 0x19bc7
movl 0x20(%r14), %ecx
leaq 0x75ea(%rip), %rdx      # 0x2119e
movl $0xb, %esi
movq 0x8(%rsp), %rdi
xorl %eax, %eax
callq 0x4110
jmp 0x19bcf
movq 0x8(%rsp), %rax
movb $0x0, (%rax)
testq %r12, %r12
je 0x19bf0
movl (%r12), %ecx
leaq 0x75bf(%rip), %rdx      # 0x2119e
movl $0xb, %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4110
jmp 0x19bf3
movb $0x0, (%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: locate_leaf
bool locate_leaf(xcb_window_t win, coordinates_t *loc)
{
	for (monitor_t *m = mon_head; m != NULL; m = m->next) {
		for (desktop_t *d = m->desk_head; d != NULL; d = d->next) {
			for (node_t *n = first_extrema(d->root); n != NULL; n = next_leaf(n, d->root)) {
				if (n->id == win) {
					loc->monitor = m;
					loc->desktop = d;
					loc->node = n;
					return true;
				}
			}
		}
	}
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0xe98b(%rip), %rax      # 0x29708
movq (%rax), %r15
testq %r15, %r15
setne %r14b
je 0x1ade9
movq %rsi, %rbx
movl %edi, %ebp
movq 0x60(%r15), %r12
testq %r12, %r12
sete %r13b
je 0x1addc
movq 0x30(%r12), %rdi
callq 0x92fd
testq %rax, %rax
sete %cl
je 0x1adcf
cmpl %ebp, (%rax)
je 0x1adc0
movq 0x30(%r12), %rsi
movq %rax, %rdi
callq 0x9363
jmp 0x1ada5
movq %r15, (%rbx)
movq %r12, 0x8(%rbx)
movq %rax, 0x10(%rbx)
testb %cl, %cl
je 0x1add6
movq 0x48(%r12), %r12
jmp 0x1ad92
testb $0x1, %r13b
je 0x1ade9
movq 0x78(%r15), %r15
testq %r15, %r15
setne %r14b
jne 0x1ad8e
andb $0x1, %r14b
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: locate_desktop
bool locate_desktop(char *name, coordinates_t *loc)
{
	for (monitor_t *m = mon_head; m != NULL; m = m->next) {
		for (desktop_t *d = m->desk_head; d != NULL; d = d->next) {
			if (streq(d->name, name)) {
				loc->monitor = m;
				loc->desktop = d;
				return true;
			}
		}
	}
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0xe8f7(%rip), %rax      # 0x29708
movq (%rax), %r12
testq %r12, %r12
setne %bpl
je 0x1ae60
movq %rsi, %rbx
movq %rdi, %r14
movq 0x60(%r12), %r15
testq %r15, %r15
sete %r13b
je 0x1ae52
movq %r15, %rdi
movq %r14, %rsi
callq 0x4820
testl %eax, %eax
je 0x1ae46
movq 0x48(%r15), %r15
jmp 0x1ae28
movq %r12, (%rbx)
movq %r15, 0x8(%rbx)
testb %r13b, %r13b
je 0x1ae60
movq 0x78(%r12), %r12
testq %r12, %r12
setne %bpl
jne 0x1ae23
andb $0x1, %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: desktop_from_index
bool desktop_from_index(uint16_t idx, coordinates_t *loc, monitor_t *mm)
{
	for (monitor_t *m = mon_head; m != NULL; m = m->next) {
		if (mm != NULL && m != mm) {
			continue;
		}
		for (desktop_t *d = m->desk_head; d != NULL; d = d->next, idx--) {
			if (idx == 1) {
				loc->monitor = m;
				loc->desktop = d;
				loc->node = NULL;
				return true;
			}
		}
	}
	return false;
}

// Assembly:
leaq 0xe88c(%rip), %rax      # 0x29708
movq (%rax), %rcx
testq %rcx, %rcx
setne %al
je 0x1aedf
testq %rdx, %rdx
setne %r8b
cmpq %rdx, %rcx
setne %r9b
testb %r9b, %r8b
jne 0x1aed9
movq 0x60(%rcx), %r8
testq %r8, %r8
sete %r9b
je 0x1aed9
cmpw $0x1, %di
je 0x1aec1
decl %edi
movq 0x48(%r8), %r8
testq %r8, %r8
sete %r9b
je 0x1aed9
decw %di
jne 0x1aeaf
movq %rcx, (%rsi)
movq %r8, 0x8(%rsi)
movq $0x0, 0x10(%rsi)
movw $0x1, %di
testb %r9b, %r9b
je 0x1aedf
movq 0x78(%rcx), %rcx
jmp 0x1ae7f
andb $0x1, %al
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: desktop_from_id
bool desktop_from_id(uint32_t id, coordinates_t *loc, monitor_t *mm)
{
	for (monitor_t *m = mon_head; m != NULL; m = m->next) {
		if (mm != NULL && m != mm) {
			continue;
		}
		for (desktop_t *d = m->desk_head; d != NULL; d = d->next) {
			if (d->id == id) {
				loc->monitor = m;
				loc->desktop = d;
				loc->node = NULL;
				return true;
			}
		}
	}
	return false;
}

// Assembly:
leaq 0xe81f(%rip), %rax      # 0x29708
movq (%rax), %rcx
testq %rcx, %rcx
setne %al
je 0x1af3a
testq %rdx, %rdx
setne %r8b
cmpq %rdx, %rcx
setne %r9b
testb %r9b, %r8b
jne 0x1af34
movq 0x60(%rcx), %r8
testq %r8, %r8
sete %r9b
je 0x1af34
cmpl %edi, 0x20(%r8)
je 0x1af20
movq 0x48(%r8), %r8
jmp 0x1af0b
movq %rcx, (%rsi)
movq %r8, 0x8(%rsi)
movq $0x0, 0x10(%rsi)
testb %r9b, %r9b
je 0x1af3a
movq 0x78(%rcx), %rcx
jmp 0x1aeec
andb $0x1, %al
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: desktop_from_name
bool desktop_from_name(char *name, coordinates_t *ref, coordinates_t *dst, desktop_select_t *sel, int *hits)
{
	for (monitor_t *m = mon_head; m != NULL; m = m->next) {
		for (desktop_t *d = m->desk_head; d != NULL; d = d->next) {
			if (streq(d->name, name)) {
				if (hits != NULL) {
					(*hits)++;
				}
				coordinates_t loc = {m, d, NULL};
				if (desktop_matches(&loc, ref, sel)) {
					dst->monitor = m;
					dst->desktop = d;
					return true;
				}
			}
		}
	}
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
leaq 0xe7ac(%rip), %rax      # 0x29708
movq (%rax), %rbp
testq %rbp, %rbp
setne 0xf(%rsp)
je 0x1afe4
movq %r8, %rbx
movq %rsi, %r12
movq %rdi, %r13
movq 0x60(%rbp), %r15
testq %r15, %r15
sete %r14b
je 0x1afd6
movq %r15, %rdi
movq %r13, %rsi
callq 0x4820
testl %eax, %eax
jne 0x1afbe
testq %rbx, %rbx
je 0x1af95
incl (%rbx)
movq %rbp, 0x20(%rsp)
movq %r15, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
leaq 0x20(%rsp), %rdi
movq %r12, %rsi
movq 0x18(%rsp), %rdx
callq 0x190a4
testb %al, %al
jne 0x1afc4
movq 0x48(%r15), %r15
jmp 0x1af76
movq 0x10(%rsp), %rax
movq %rbp, (%rax)
movq %r15, 0x8(%rax)
testb $0x1, %r14b
je 0x1afe4
movq 0x78(%rbp), %rbp
testq %rbp, %rbp
setne 0xf(%rsp)
jne 0x1af72
movb 0xf(%rsp), %al
andb $0x1, %al
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: locate_monitor
bool locate_monitor(char *name, coordinates_t *loc)
{
	for (monitor_t *m = mon_head; m != NULL; m = m->next) {
		if (streq(m->name, name)) {
			loc->monitor = m;
			return true;
		}
	}
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0xe701(%rip), %rax      # 0x29708
movq (%rax), %r14
testq %r14, %r14
setne %bpl
je 0x1b03a
movq %rsi, %rbx
movq %rdi, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x4820
testl %eax, %eax
je 0x1b037
movq 0x78(%r14), %r14
testq %r14, %r14
setne %bpl
jne 0x1b019
jmp 0x1b03a
movq %r14, (%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: monitor_from_index
bool monitor_from_index(int idx, coordinates_t *loc)
{
	for (monitor_t *m = mon_head; m != NULL; m = m->next, idx--) {
		if (idx == 1) {
			loc->monitor = m;
			loc->desktop = NULL;
			loc->node = NULL;
			return true;
		}
	}
	return false;
}

// Assembly:
leaq 0xe6ba(%rip), %rax      # 0x29708
movq (%rax), %rcx
testq %rcx, %rcx
setne %al
je 0x1b07a
cmpl $0x1, %edi
je 0x1b070
decl %edi
movq 0x78(%rcx), %rcx
testq %rcx, %rcx
setne %al
je 0x1b07a
decl %edi
jne 0x1b060
movq %rcx, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: monitor_from_id
bool monitor_from_id(uint32_t id, coordinates_t *loc)
{
	for (monitor_t *m = mon_head; m != NULL; m = m->next) {
		if (m->id == id) {
			loc->monitor = m;
			loc->desktop = NULL;
			loc->node = NULL;
			return true;
		}
	}
	return false;
}

// Assembly:
leaq 0xe686(%rip), %rax      # 0x29708
movq (%rax), %rcx
testq %rcx, %rcx
setne %al
je 0x1b0a2
cmpl %edi, 0x20(%rcx)
je 0x1b098
movq 0x78(%rcx), %rcx
jmp 0x1b085
movq %rcx, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/query.c
// Function: locate_window
bool locate_window(xcb_window_t win, coordinates_t *loc)
{
	for (monitor_t *m = mon_head; m != NULL; m = m->next) {
		for (desktop_t *d = m->desk_head; d != NULL; d = d->next) {
			for (node_t *n = first_extrema(d->root); n != NULL; n = next_leaf(n, d->root)) {
				if (n->client == NULL) {
					continue;
				}
				if (n->id == win) {
					loc->monitor = m;
					loc->desktop = d;
					loc->node = n;
					return true;
				}
			}
		}
	}
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0xe653(%rip), %rax      # 0x29708
movq (%rax), %r15
testq %r15, %r15
setne %r14b
je 0x1b129
movq %rsi, %rbx
movl %edi, %ebp
movq 0x60(%r15), %r12
testq %r12, %r12
sete %r13b
je 0x1b11c
movq 0x30(%r12), %rdi
callq 0x92fd
testq %rax, %rax
sete %cl
je 0x1b10f
cmpq $0x0, 0x48(%rax)
je 0x1b0f0
cmpl %ebp, (%rax)
je 0x1b0ff
movq 0x30(%r12), %rsi
movq %rax, %rdi
callq 0x9363
jmp 0x1b0dd
movq %r15, (%rbx)
movq %r12, 0x8(%rbx)
movq %rax, 0x10(%rbx)
testb $0x1, %cl
je 0x1b116
movq 0x48(%r12), %r12
jmp 0x1b0ca
testb $0x1, %r13b
je 0x1b129
movq 0x78(%r15), %r15
testq %r15, %r15
setne %r14b
jne 0x1b0c6
andb $0x1, %r14b
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/restore.c
// Function: restore_history
void restore_history(jsmntok_t **t, char *json)
{
	int s = (*t)->size;
	(*t)++;

	for (int i = 0; i < s; i++) {
		coordinates_t loc = {NULL, NULL, NULL};
		restore_coordinates(&loc, t, json);
		if (loc.monitor != NULL && loc.desktop != NULL) {
			history_add(loc.monitor, loc.desktop, loc.node, true);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq (%rdi), %rax
movl 0xc(%rax), %ebp
addq $0x10, %rax
movq %rax, (%rdi)
testl %ebp, %ebp
jle 0x1bad5
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1cadc
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
testq %rdi, %rdi
setne %al
testq %rsi, %rsi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x1bad1
movq 0x10(%rsp), %rdx
movl $0x1, %ecx
callq 0xd40d
decl %ebp
jne 0x1ba88
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/restore.c
// Function: restore_stack
void restore_stack(jsmntok_t **t, char *json)
{
	int s = (*t)->size;
	(*t)++;

	for (int i = 0; i < s; i++) {
		uint32_t id;
		sscanf(json + (*t)->start, "%u", &id);
		coordinates_t loc;
		if (locate_window(id, &loc)) {
			stack_insert_after(stack_tail, loc.node);
		}
		(*t)++;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq (%rdi), %rax
movl 0xc(%rax), %ebp
addq $0x10, %rax
movq %rax, (%rdi)
testl %ebp, %ebp
jle 0x1bb59
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x4b0f(%rip), %r15      # 0x2061b
leaq 0xc(%rsp), %r12
leaq 0x10(%rsp), %r13
movq (%r14), %rax
movslq 0x4(%rax), %rdi
addq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x41c0
movl 0xc(%rsp), %edi
movq %r13, %rsi
callq 0x1b0a3
testb %al, %al
je 0x1bb51
leaq 0xdbfc(%rip), %rax      # 0x29740
movq (%rax), %rdi
movq 0x20(%rsp), %rsi
callq 0xcf1f
addq $0x10, (%r14)
decl %ebp
jne 0x1bb16
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/restore.c
// Function: restore_subscribers
void restore_subscribers(jsmntok_t **t, char *json)
{
	int s = (*t)->size;
	(*t)++;

	for (int i = 0; i < s; i++) {
		subscriber_list_t *s = make_subscriber(NULL, NULL, 0, 0);
		restore_subscriber(s, t, json);
		add_subscriber(s);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %rax
movl 0xc(%rax), %ebp
addq $0x10, %rax
movq %rax, (%rdi)
testl %ebp, %ebp
jle 0x1bbb0
movq %rsi, %rbx
movq %rdi, %r14
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1e788
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1cc14
movq %r15, %rdi
callq 0x1e869
decl %ebp
jne 0x1bb86
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/restore.c
// Function: restore_padding
void restore_padding(padding_t *p, jsmntok_t **t, char *json)
{
	int s = (*t)->size;
	(*t)++;

	for (int i = 0; i < s; i++) {
		if (keyeq("top", *t, json)) {
			(*t)++;
			sscanf(json + (*t)->start, "%i", &p->top);
		} else if (keyeq("right", *t, json)) {
			(*t)++;
			sscanf(json + (*t)->start, "%i", &p->right);
		} else if (keyeq("bottom", *t, json)) {
			(*t)++;
			sscanf(json + (*t)->start, "%i", &p->bottom);
		} else if (keyeq("left", *t, json)) {
			(*t)++;
			sscanf(json + (*t)->start, "%i", &p->left);
		}
		(*t)++;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq (%rsi), %rax
movl 0xc(%rax), %r13d
addq $0x10, %rax
movq %rax, (%rsi)
testl %r13d, %r13d
jle 0x1bce3
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0xc(%rdi), %rax
movq %rax, (%rsp)
leaq 0x8(%rdi), %rax
movq %rax, 0x8(%rsp)
leaq 0x4(%rdi), %rax
movq %rax, 0x10(%rsp)
leaq 0x395d(%rip), %r12      # 0x1f567
movq (%r14), %rbp
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x1b678
testb %al, %al
je 0x1bc3c
leaq 0x10(%rbp), %rax
movq %rax, (%r14)
movslq 0x14(%rbp), %rdi
addq %rbx, %rdi
leaq 0x5537(%rip), %rsi      # 0x2116b
movq %r15, %rdx
jmp 0x1bccf
leaq 0x4e34(%rip), %rdi      # 0x20a77
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x1b678
testb %al, %al
je 0x1bc6e
leaq 0x10(%rbp), %rax
movq %rax, (%r14)
movslq 0x14(%rbp), %rdi
addq %rbx, %rdi
leaq 0x5504(%rip), %rsi      # 0x2116b
movq 0x10(%rsp), %rdx
jmp 0x1bccf
leaq 0x4de1(%rip), %rdi      # 0x20a56
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x1b678
testb %al, %al
je 0x1bca0
leaq 0x10(%rbp), %rax
movq %rax, (%r14)
movslq 0x14(%rbp), %rdi
addq %rbx, %rdi
leaq 0x54d2(%rip), %rsi      # 0x2116b
movq 0x8(%rsp), %rdx
jmp 0x1bccf
leaq 0x4ddd(%rip), %rdi      # 0x20a84
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x1b678
testb %al, %al
je 0x1bcd6
leaq 0x10(%rbp), %rax
movq %rax, (%r14)
movslq 0x14(%rbp), %rdi
addq %rbx, %rdi
leaq 0x54a0(%rip), %rsi      # 0x2116b
movq (%rsp), %rdx
xorl %eax, %eax
callq 0x41c0
addq $0x10, (%r14)
decl %r13d
jne 0x1bc0a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/restore.c
// Function: restore_rectangle
void restore_rectangle(xcb_rectangle_t *r, jsmntok_t **t, char *json)
{
	int s = (*t)->size;
	(*t)++;

	for (int i = 0; i < s; i++) {
		if (keyeq("x", *t, json)) {
			(*t)++;
			sscanf(json + (*t)->start, "%hi", &r->x);
		} else if (keyeq("y", *t, json)) {
			(*t)++;
			sscanf(json + (*t)->start, "%hi", &r->y);
		} else if (keyeq("width", *t, json)) {
			(*t)++;
			sscanf(json + (*t)->start, "%hu", &r->width);
		} else if (keyeq("height", *t, json)) {
			(*t)++;
			sscanf(json + (*t)->start, "%hu", &r->height);
		}
		(*t)++;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq (%rsi), %rax
movl 0xc(%rax), %r13d
addq $0x10, %rax
movq %rax, (%rsi)
testl %r13d, %r13d
jle 0x1be1a
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x6(%rdi), %rax
movq %rax, (%rsp)
leaq 0x4(%rdi), %rax
movq %rax, 0x8(%rsp)
leaq 0x2(%rdi), %rax
movq %rax, 0x10(%rsp)
leaq 0x3598(%rip), %r12      # 0x1f2d9
movq (%r14), %rbp
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x1b678
testb %al, %al
je 0x1bd73
leaq 0x10(%rbp), %rax
movq %rax, (%r14)
movslq 0x14(%rbp), %rdi
addq %rbx, %rdi
leaq 0x4d9a(%rip), %rsi      # 0x20b05
movq %r15, %rdx
jmp 0x1be06
leaq 0x4158(%rip), %rdi      # 0x1fed2
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x1b678
testb %al, %al
je 0x1bda5
leaq 0x10(%rbp), %rax
movq %rax, (%r14)
movslq 0x14(%rbp), %rdi
addq %rbx, %rdi
leaq 0x4d67(%rip), %rsi      # 0x20b05
movq 0x10(%rsp), %rdx
jmp 0x1be06
leaq 0x57aa(%rip), %rdi      # 0x21556
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x1b678
testb %al, %al
je 0x1bdd7
leaq 0x10(%rbp), %rax
movq %rax, (%r14)
movslq 0x14(%rbp), %rdi
addq %rbx, %rdi
leaq 0x4d25(%rip), %rsi      # 0x20af5
movq 0x8(%rsp), %rdx
jmp 0x1be06
leaq 0x5782(%rip), %rdi      # 0x21560
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x1b678
testb %al, %al
je 0x1be0d
leaq 0x10(%rbp), %rax
movq %rax, (%r14)
movslq 0x14(%rbp), %rdi
addq %rbx, %rdi
leaq 0x4cf3(%rip), %rsi      # 0x20af5
movq (%rsp), %rdx
xorl %eax, %eax
callq 0x41c0
addq $0x10, (%r14)
decl %r13d
jne 0x1bd41
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq