LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./regex.c
// Function: regex
regex_t*
regex(const char *pattern)
{
	int i = 0;
	unsigned int hash = 0;
	regex_t *re = NULL;
	RegexCache *rc = NULL;

	while (pattern[i])
	{
		hash = 33 * hash + pattern[i++];
	}

	// have we compiled this regex before?
	for (i = 0; i < REGEX_CACHE; i++)
	{
		rc = &regex_cache[i];
		if (rc->hash == hash && rc->pattern && !strcmp(pattern, rc->pattern))
		{
			re = &rc->regex;
			rc->used++;
			break;
		}
	}
	if (!re)
	{
		int slot = 0;
		// look for a free cache slot
		for (i = 0; i < REGEX_CACHE; i++)
		{
			if (!regex_cache[i].pattern)
			{
				slot = i;
				break;
			}
		}
		if (regex_cache[slot].pattern)
		{
			// choose the least used
			for (i = 0; i < REGEX_CACHE; i++)
			{
				if (regex_cache[i].used < regex_cache[slot].used)
				{
					slot = i;
					break;
				}
			}
		}

		rc = &regex_cache[slot];

		if (rc->pattern)
		{
			regfree(&rc->regex);
			free(rc->pattern);
		}

		rc->used = 0;
		rc->hash = 0;
		rc->pattern = NULL;

		re = &rc->regex;

		if (regcomp(re, pattern, REG_EXTENDED) != 0)
		{
			fprintf(stderr, "regex compile failure: %s", pattern);
			re = NULL;
		}
		if (re)
		{
			rc->pattern = strdup(pattern);
			rc->hash = hash;
			rc->used = 1;
		}
	}
	return re;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movb (%rdi), %al
testb %al, %al
je 0x3f8a
leaq 0x1(%rbx), %rcx
xorl %ebp, %ebp
movl %ebp, %edx
shll $0x5, %edx
addl %ebp, %edx
movsbl %al, %ebp
addl %edx, %ebp
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x3f73
jmp 0x3f8c
xorl %ebp, %ebp
xorl %r14d, %r14d
leaq 0xa91a(%rip), %r15      # 0xe8b0
xorl %r12d, %r12d
cmpl %ebp, (%r12,%r15)
jne 0x3fb5
movq 0x8(%r12,%r15), %rsi
testq %rsi, %rsi
je 0x3fb5
movq %rbx, %rdi
callq 0x3470
testl %eax, %eax
je 0x3fc4
addq $0x58, %r12
cmpq $0x2c0, %r12            # imm = 0x2C0
jne 0x3f99
jmp 0x3fd0
leaq (%r12,%r15), %r14
addq $0x10, %r14
incl 0x40(%r14)
testq %r14, %r14
jne 0x409b
leaq 0xa8d8(%rip), %rcx      # 0xe8b8
xorl %eax, %eax
cmpq $0x0, (%rcx)
je 0x3ff7
incq %rax
addq $0x58, %rcx
cmpq $0x8, %rax
jne 0x3fe2
xorl %eax, %eax
movl %eax, %ecx
imulq $0x58, %rcx, %rcx
cmpq $0x0, 0x8(%rcx,%r15)
je 0x4029
addq %r15, %rcx
movl 0x50(%rcx), %edx
leaq 0xa8ee(%rip), %rsi      # 0xe900
xorl %ecx, %ecx
cmpl %edx, (%rsi)
jb 0x4027
incq %rcx
addq $0x58, %rsi
cmpq $0x8, %rcx
jne 0x4014
jmp 0x4029
movl %ecx, %eax
cltq
imulq $0x58, %rax, %rax
leaq (%r15,%rax), %r12
cmpq $0x0, 0x8(%rax,%r15)
je 0x404f
leaq 0x10(%r12), %rdi
callq 0x34d0
movq 0x8(%r12), %rdi
callq 0x3220
xorl %eax, %eax
movl %eax, 0x50(%r12)
movl %eax, (%r12)
movq $0x0, 0x8(%r12)
leaq 0x10(%r12), %r14
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x3360
testl %eax, %eax
jne 0x40a7
testq %r14, %r14
je 0x409b
movq %rbx, %rdi
callq 0x3430
movq %rax, 0x8(%r12)
movl %ebp, (%r12)
movl $0x1, 0x50(%r12)
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x9f3a(%rip), %rax      # 0xdfe8
movq (%rax), %rdi
leaq 0x6028(%rip), %rsi      # 0xa0e0
xorl %r14d, %r14d
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3660
jmp 0x407c
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./regex.c
// Function: regex_cache_empty
void
regex_cache_empty()
{
	for (int i = 0; i < REGEX_CACHE; i++)
	{
		RegexCache *rc = &regex_cache[i];
		if (rc->pattern)
		{
			regfree(&rc->regex);
			free(rc->pattern);
			rc->used = 0;
			rc->hash = 0;
			rc->pattern = NULL;
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
xorl %r14d, %r14d
leaq 0xa7c4(%rip), %r15      # 0xe8b0
xorl %r12d, %r12d
cmpq $0x0, 0x8(%r12,%r15)
je 0x4120
leaq (%r12,%r15), %rbx
addq $0x10, %rbx
movq %rbx, %rdi
callq 0x34d0
movq -0x8(%rbx), %rdi
callq 0x3220
movl %r14d, 0x40(%rbx)
movl %r14d, -0x10(%rbx)
movq $0x0, -0x8(%rbx)
addq $0x58, %r12
cmpq $0x2c0, %r12            # imm = 0x2C0
jne 0x40ef
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./regex.c
// Function: regex_match
int
regex_match(const char *pattern, const char *subject)
{
	int r = 0; regmatch_t pmatch[REGEX_GROUPS];
	regex_t *re = regex(pattern);
	if (re && subject && (r = regexec(re, subject, REGEX_GROUPS, pmatch, 0) == 0))
	{
		for (int i = 0; i < REGEX_GROUPS && pmatch[i].rm_so != (size_t)-1; i++)
		{
			free(regex_matches[i]);
			int len = pmatch[i].rm_eo - pmatch[i].rm_so;
			regex_matches[i] = malloc(len + 1);
			strncpy(regex_matches[i], subject + pmatch[i].rm_so, len);
			regex_matches[i][len] = 0;
		}
	}
	return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
callq 0x3f5c
testq %rax, %rax
sete %cl
testq %rbx, %rbx
sete %dl
orb %cl, %dl
jne 0x41e6
leaq 0x10(%rsp), %rcx
movl $0x8, %edx
movq %rax, %rdi
movq %rbx, %rsi
xorl %r8d, %r8d
callq 0x3180
testl %eax, %eax
sete %al
jne 0x41e8
movl %eax, 0xc(%rsp)
xorl %r13d, %r13d
leaq 0xa9e0(%rip), %rbp      # 0xeb70
cmpl $-0x1, 0x10(%rsp,%r13)
je 0x41e0
movq (%r13,%rbp), %rdi
callq 0x3220
movslq 0x14(%rsp,%r13), %r14
movslq 0x10(%rsp,%r13), %r15
subq %r15, %r14
leaq 0x1(%r14), %rdi
callq 0x3150
movq %rax, %r12
movq %rax, (%r13,%rbp)
addq %rbx, %r15
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3570
movb $0x0, (%r12,%r14)
addq $0x8, %r13
cmpq $0x40, %r13
jne 0x4190
movl 0xc(%rsp), %eax
jmp 0x41e8
xorl %eax, %eax
movzbl %al, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./textbox.c
// Function: textbox_font
void textbox_font(Textbox *tb, char *font, char *fg, char *bg)
{
	if (tb->font) XftFontClose(display, tb->font);
	tb->font = XftFontOpenName(display, DefaultScreen(display), font);

	XftColorAllocName(display, DefaultVisual(display, DefaultScreen(display)), DefaultColormap(display, DefaultScreen(display)), fg, &tb->color_fg);
	XftColorAllocName(display, DefaultVisual(display, DefaultScreen(display)), DefaultColormap(display, DefaultScreen(display)), bg, &tb->color_bg);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movq 0x28(%rdi), %rsi
testq %rsi, %rsi
je 0x43c5
movq 0xa7f0(%rip), %rdi      # 0xebb0
callq 0x30a0
movq 0xa7e4(%rip), %rdi      # 0xebb0
movl 0xe0(%rdi), %esi
movq %r12, %rdx
callq 0x3460
movq %rax, 0x28(%r14)
movq 0xa7cb(%rip), %rdi      # 0xebb0
movq 0xe8(%rdi), %rax
movslq 0xe0(%rdi), %rcx
shlq $0x7, %rcx
movq 0x40(%rax,%rcx), %rsi
movq 0x50(%rax,%rcx), %rdx
leaq 0x30(%r14), %r8
movq %r15, %rcx
callq 0x3390
movq 0xa79c(%rip), %rdi      # 0xebb0
movq 0xe8(%rdi), %rax
movslq 0xe0(%rdi), %rcx
shlq $0x7, %rcx
movq 0x40(%rax,%rcx), %rsi
movq 0x50(%rax,%rcx), %rdx
addq $0x40, %r14
movq %rbx, %rcx
movq %r14, %r8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3390
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./textbox.c
// Function: textbox_text
void textbox_text(Textbox *tb, char *text)
{
	if (tb->text) free(tb->text);
	tb->text = strdup(text ? text: "");
	tb->cursor = MAX(0, MIN(strlen(tb->text), tb->cursor));
	textbox_extents(tb);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x50(%rdi), %rdi
testq %rdi, %rdi
je 0x4462
callq 0x3220
testq %r14, %r14
leaq 0x6266(%rip), %rdi      # 0xa6d2
cmovneq %r14, %rdi
callq 0x3430
movq %rax, 0x50(%rbx)
movq %rax, %rdi
callq 0x3250
movswq 0x20(%rbx), %rcx
cmpq %rcx, %rax
cmovbl %eax, %ecx
movw %cx, 0x20(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x452d
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./textbox.c
// Function: textbox_moveresize
void textbox_moveresize(Textbox *tb, int x, int y, int w, int h)
{
	if (tb->flags & TB_AUTOHEIGHT)
		h = tb->font->ascent + tb->font->descent;

	if (tb->flags & TB_AUTOWIDTH)
		w = tb->extents.width;

	if (x != tb->x || y != tb->y || w != tb->w || h != tb->h)
	{
		tb->x = x; tb->y = y; tb->w = MAX(1, w); tb->h = MAX(1, h);
		XMoveResizeWindow(display, tb->window, tb->x, tb->y, tb->w, tb->h);
	}
}

// Assembly:
movq (%rdi), %rax
testb $0x1, %al
je 0x44b1
movq 0x28(%rdi), %r9
movl 0x4(%r9), %r8d
addl (%r9), %r8d
testb $0x2, %al
je 0x44b9
movzwl 0x70(%rdi), %ecx
movswl 0x18(%rdi), %eax
cmpl %esi, %eax
jne 0x44db
movswl 0x1a(%rdi), %eax
cmpl %edx, %eax
jne 0x44db
movswl 0x1c(%rdi), %eax
cmpl %eax, %ecx
jne 0x44db
movswl 0x1e(%rdi), %eax
cmpl %eax, %r8d
jne 0x44db
retq
pushq %rbx
movw %si, 0x18(%rdi)
movw %dx, 0x1a(%rdi)
cmpl $0x2, %ecx
movl $0x1, %r9d
cmovll %r9d, %ecx
movw %cx, 0x1c(%rdi)
cmpl $0x2, %r8d
cmovgel %r8d, %r9d
movw %r9w, 0x1e(%rdi)
movq 0xa6a7(%rip), %rax      # 0xebb0
movq 0x8(%rdi), %r11
movswl %si, %ebx
movswl %dx, %r10d
movswl %cx, %r8d
movswl %r9w, %r9d
movq %rax, %rdi
movq %r11, %rsi
movl %ebx, %edx
movl %r10d, %ecx
popq %rbx
jmp 0x3300
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./textbox.c
// Function: textbox_extents
void textbox_extents(Textbox *tb)
{
	int length = strlen(tb->text) + strlen(tb->prompt);
	char *line = calloc(length + 1, sizeof(char));
	sprintf(line, "%s%s", tb->prompt, tb->text);
	XftTextExtentsUtf8(display, tb->font, (unsigned char*)line, length, &tb->extents);
	free(line);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x50(%rdi), %r14
movq %r14, %rdi
callq 0x3250
movq %rax, %r15
movq 0x58(%rbx), %r12
movq %r12, %rdi
callq 0x3250
leal (%rax,%r15), %ebp
addl %r15d, %eax
incl %eax
movslq %eax, %rdi
movl $0x1, %esi
callq 0x3500
movq %rax, %r15
leaq 0x5dff(%rip), %rsi      # 0xa372
movq %rax, %rdi
movq %r12, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x32d0
movq 0xa626(%rip), %rdi      # 0xebb0
movq 0x28(%rbx), %rsi
addq $0x70, %rbx
movq %r15, %rdx
movl %ebp, %ecx
movq %rbx, %r8
callq 0x3520
movq %r15, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3220
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./textbox.c
// Function: textbox_free
void textbox_free(Textbox *tb)
{
	if (tb->flags & TB_EDITABLE)
	{
		XDestroyIC(tb->xic);
		XCloseIM(tb->xim);
	}

	if (tb->text) free(tb->text);
	if (tb->prompt) free(tb->prompt);
	if (tb->font) XftFontClose(display, tb->font);

	XDestroyWindow(display, tb->window);
	free(tb);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testb $0x8, 0x2(%rdi)
je 0x4624
movq 0x68(%rbx), %rdi
callq 0x3400
movq 0x60(%rbx), %rdi
callq 0x3680
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x4632
callq 0x3220
movq 0x58(%rbx), %rdi
testq %rdi, %rdi
je 0x4640
callq 0x3220
movq 0x28(%rbx), %rsi
testq %rsi, %rsi
je 0x4655
movq 0xa560(%rip), %rdi      # 0xebb0
callq 0x30a0
movq 0xa554(%rip), %rdi      # 0xebb0
movq 0x8(%rbx), %rsi
callq 0x3280
movq %rbx, %rdi
popq %rbx
jmp 0x3220
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./textbox.c
// Function: textbox_insert
void textbox_insert(Textbox *tb, int pos, char *str)
{
	int len = strlen(tb->text), slen = strlen(str);
	pos = MAX(0, MIN(len, pos));
	// expand buffer
	tb->text = realloc(tb->text, len + slen + 1);
	// move everything after cursor upward
	char *at = tb->text + pos;
	memmove(at + slen, at, len - pos + 1);
	// insert new str
	memmove(at, str, slen);
	textbox_extents(tb);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdx, (%rsp)
movl %esi, %ebp
movq %rdi, %rbx
movq 0x50(%rdi), %r12
movq %r12, %rdi
callq 0x3250
movq %rax, %r15
movq %r14, %rdi
callq 0x3250
movq %rax, %r13
cmpl %ebp, %r15d
cmovll %r15d, %ebp
xorl %r14d, %r14d
testl %ebp, %ebp
cmovgl %ebp, %r14d
addl %r15d, %eax
incl %eax
movslq %eax, %rsi
movq %r12, %rdi
callq 0x3640
movq %rax, 0x50(%rbx)
leaq (%r14,%rax), %r12
movslq %r13d, %r13
leaq (%r12,%r13), %rdi
subl %r14d, %r15d
incl %r15d
movslq %r15d, %rdx
movq %r12, %rsi
callq 0x33a0
movq %r12, %rdi
movq (%rsp), %rsi
movq %r13, %rdx
callq 0x36b0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x452d
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./textbox.c
// Function: textbox_delete
void textbox_delete(Textbox *tb, int pos, int dlen)
{
	int len = strlen(tb->text);
	pos = MAX(0, MIN(len, pos));
	// move everything after pos+dlen down
	char *at = tb->text + pos;
	memmove(at, at + dlen, len - pos);
	textbox_extents(tb);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movq 0x50(%rdi), %r15
movq %r15, %rdi
callq 0x3250
cmpl %ebp, %eax
cmovll %eax, %ebp
xorl %ecx, %ecx
testl %ebp, %ebp
cmovgl %ebp, %ecx
leaq (%rcx,%r15), %rdi
movslq %ebx, %rsi
addq %rdi, %rsi
subl %ecx, %eax
movslq %eax, %rdx
callq 0x33a0
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x452d
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./textbox.c
// Function: textbox_keypress
int textbox_keypress(Textbox *tb, XEvent *ev)
{
	if (!(tb->flags & TB_EDITABLE)) return 0;

	KeySym key; Status stat; char pad[32];

	int len = XmbLookupString(tb->xic, &ev->xkey, pad, sizeof(pad), &key, &stat);
	pad[len] = 0;

	switch (key)
	{
		case XK_Left      : textbox_cursor_dec(tb);   return 1;
		case XK_Right     : textbox_cursor_inc(tb);   return 1;
		case XK_Home      : textbox_cursor_home(tb);  return 1;
		case XK_End       : textbox_cursor_end(tb);   return 1;
		case XK_Delete    : textbox_cursor_del(tb);   return 1;
		case XK_BackSpace : textbox_cursor_bkspc(tb); return 1;
		case XK_Return    : return -1;
		default:
			if (!iscntrl(*pad))
			{
				textbox_insert(tb, tb->cursor, pad);
				textbox_cursor_inc(tb);
				return 1;
			}
	}
	return 0;
}

// Assembly:
xorl %eax, %eax
testb $0x8, 0x2(%rdi)
je 0x4d41
pushq %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
movq 0x68(%rdi), %rdi
leaq 0x10(%rsp), %rdx
leaq 0x38(%rsp), %r14
leaq 0xc(%rsp), %r9
movl $0x20, %ecx
movq %r14, %r8
callq 0x34f0
cltq
movb $0x0, 0x10(%rsp,%rax)
movq (%r14), %rcx
cmpq $0xff4f, %rcx           # imm = 0xFF4F
jle 0x4c68
leaq -0xff50(%rcx), %rax
cmpq $0x7, %rax
ja 0x4c89
leaq 0x53b0(%rip), %rcx      # 0xa004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movw $0x0, 0x20(%rbx)
jmp 0x4d34
cmpq $0xff08, %rcx           # imm = 0xFF08
je 0x4d2c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0xff0d, %rcx           # imm = 0xFF0D
je 0x4d39
jmp 0x4ccd
cmpq $0xffff, %rcx           # imm = 0xFFFF
jne 0x4ccd
movswl 0x20(%rbx), %ebp
movq 0x50(%rbx), %r14
movq %r14, %rdi
callq 0x3250
cmpl %ebp, %eax
cmovll %eax, %ebp
xorl %ecx, %ecx
testl %ebp, %ebp
cmovgl %ebp, %ecx
leaq (%r14,%rcx), %rdi
leaq (%r14,%rcx), %rsi
incq %rsi
subl %ecx, %eax
movslq %eax, %rdx
callq 0x33a0
movq %rbx, %rdi
callq 0x452d
jmp 0x4d34
callq 0x3290
movq (%rax), %rcx
movsbq 0x10(%rsp), %rdx
xorl %eax, %eax
testb $0x2, (%rcx,%rdx,2)
jne 0x4d39
movswl 0x20(%rbx), %esi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x4a16
movswq 0x20(%rbx), %r14
incq %r14
jmp 0x4d06
movswq 0x20(%rbx), %r14
decq %r14
movq 0x50(%rbx), %rdi
callq 0x3250
cmpq %r14, %rax
cmovbq %rax, %r14
movw %r14w, 0x20(%rbx)
jmp 0x4d34
movq 0x50(%rbx), %rdi
callq 0x3250
movw %ax, 0x20(%rbx)
jmp 0x4d34
movq %rbx, %rdi
callq 0x4b7d
movl $0x1, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./menubox.c
// Function: menubox_moveresize
void menubox_moveresize(Menubox *mb, short x, short y, short w, short h)
{
	int ow = w;

	if (mb->flags & MB_AUTOHEIGHT)
		h = (mb->box_count+1) * mb->line_height + (mb->padding*2);

	if (mb->flags & MB_AUTOWIDTH)
	{
		for (uint i = 0; i < mb->box_count; i++)
			w = MAX(mb->boxes[i]->extents.width, w);
		w += (mb->padding*2);
	}

	if (mb->flags & MB_MINWIDTH)
	{
		w = MAX(ow, w);
	}

	if (x != mb->x || y != mb->y || w != mb->w || h != mb->h)
	{
		mb->x = x; mb->y = y; mb->w = MAX(1, w); mb->h = MAX(1, h);
		XMoveResizeWindow(display, mb->window, mb->x, mb->y, mb->w, mb->h);
	}
}

// Assembly:
movq (%rdi), %rax
testb $0x1, %al
jne 0x4f24
movl %r8d, %r9d
jmp 0x4f39
movl 0x50(%rdi), %r8d
incl %r8d
imull 0x20(%rdi), %r8d
movzwl 0x22(%rdi), %r9d
leal (%r8,%r9,2), %r9d
movl %ecx, %r8d
testb $0x2, %al
je 0x4f82
movl 0x50(%rdi), %r8d
movl %ecx, %r10d
testq %r8, %r8
je 0x4f79
pushq %rbp
pushq %r14
pushq %rbx
movq 0x58(%rdi), %r11
xorl %ebx, %ebx
movl %ecx, %r10d
movq (%r11,%rbx,8), %r14
movzwl 0x70(%r14), %ebp
movswl %r10w, %r10d
cmpl %r10d, %ebp
cmovgl %ebp, %r10d
incq %rbx
cmpq %rbx, %r8
jne 0x4f59
popq %rbx
popq %r14
popq %rbp
movzwl 0x22(%rdi), %r8d
leal (%r10,%r8,2), %r8d
cmpw %r8w, %cx
movl %r8d, %r10d
cmovgl %ecx, %r10d
testb $0x8, %al
cmovel %r8d, %r10d
cmpw %si, 0x18(%rdi)
jne 0x4fae
cmpw %dx, 0x1a(%rdi)
jne 0x4fae
cmpw 0x1c(%rdi), %r10w
jne 0x4fae
cmpw 0x1e(%rdi), %r9w
jne 0x4fae
retq
movw %si, 0x18(%rdi)
movw %dx, 0x1a(%rdi)
cmpw $0x2, %r10w
movl $0x1, %eax
movl $0x1, %r8d
cmovgel %r10d, %r8d
movw %r8w, 0x1c(%rdi)
cmpw $0x2, %r9w
cmovll %eax, %r9d
movw %r9w, 0x1e(%rdi)
movq 0x9bcc(%rip), %rax      # 0xebb0
movq 0x8(%rdi), %r11
movswl %si, %r10d
movswl %dx, %ecx
movl $0xffff, %edx           # imm = 0xFFFF
andl %edx, %r8d
andl %edx, %r9d
movq %rax, %rdi
movq %r11, %rsi
movl %r10d, %edx
jmp 0x3300
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./menubox.c
// Function: menubox_add
void menubox_add(Menubox *mb, int id, char *text)
{
	uint slot = mb->box_count++;

	mb->boxes = (Textbox**) realloc(mb->boxes, sizeof(Textbox) * mb->box_count);
	mb->ids   = (int*)      realloc(mb->ids,   sizeof(int)     * mb->box_count);
	mb->show  = (int*)      realloc(mb->show,  sizeof(int)     * mb->box_count);
	
	mb->boxes[slot] = textbox_create(mb->window, TB_AUTOHEIGHT|TB_AUTOWIDTH,
		mb->padding, mb->line_height*(slot+1)+mb->padding, mb->w-(mb->padding*2), 0,
		mb->font, mb->fg_blur, mb->bg_blur, text, NULL);

	mb->ids[slot]   = id;
	mb->show[slot]  = 1;
	
	if (mb->flags & (MB_AUTOWIDTH|MB_AUTOHEIGHT))
		menubox_moveresize(mb, mb->x, mb->y, mb->w, mb->h);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
movl 0x50(%rdi), %r15d
leal 0x1(%r15), %r12d
movl %r12d, 0x50(%rdi)
movq 0x58(%rdi), %rdi
movq %r12, %rsi
shlq $0x7, %rsi
callq 0x3640
movq %rax, 0x58(%rbx)
movq 0x60(%rbx), %rdi
movl 0x50(%rbx), %esi
shlq $0x2, %rsi
callq 0x3640
movq %rax, 0x60(%rbx)
movq 0x68(%rbx), %rdi
movl 0x50(%rbx), %esi
shlq $0x2, %rsi
callq 0x3640
movq %rax, 0x68(%rbx)
movq 0x8(%rbx), %rdi
movswl 0x22(%rbx), %edx
imulw 0x20(%rbx), %r12w
addl %edx, %r12d
movl 0x1c(%rbx), %eax
subl %edx, %eax
subl %edx, %eax
subq $0x8, %rsp
movswl %r12w, %ecx
movswl %ax, %r8d
movl $0x3, %esi
xorl %r9d, %r9d
pushq $0x0
pushq %r14
pushq 0x48(%rbx)
pushq 0x40(%rbx)
pushq 0x28(%rbx)
callq 0x41fa
addq $0x30, %rsp
movq 0x58(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
movq 0x60(%rbx), %rax
movl %ebp, (%rax,%r15,4)
movq 0x68(%rbx), %rax
movl $0x1, (%rax,%r15,4)
testb $0x3, (%rbx)
je 0x50e4
movswl 0x18(%rbx), %esi
movswl 0x1a(%rbx), %edx
movswl 0x1c(%rbx), %ecx
movswl 0x1e(%rbx), %r8d
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4f18
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./menubox.c
// Function: menubox_draw
void menubox_draw(Menubox *mb)
{
	textbox_draw(mb->input);
	int filter = strlen(mb->input->text) > 0;

	for (uint i = 0, n = 0; i < mb->box_count; i++)
	{
		if (!filter || mb->show[i])
		{
			textbox_font(mb->boxes[i], mb->font, mb->box_active == i ? mb->fg_focus: mb->fg_blur, mb->box_active == i ? mb->bg_focus: mb->bg_blur);
			textbox_moveresize(mb->boxes[i], mb->padding, mb->line_height*(n+1)+mb->padding, mb->w-(mb->padding*2), 0);
			textbox_show(mb->boxes[i]);	
			textbox_draw(mb->boxes[i]);
			n++;
		}
		else
		{
			textbox_hide(mb->boxes[i]);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x70(%rdi), %rdi
callq 0x466e
cmpl $0x0, 0x50(%rbx)
je 0x522d
movq 0x70(%rbx), %rax
movq 0x50(%rax), %rax
movb (%rax), %bpl
xorl %r14d, %r14d
xorl %r15d, %r15d
testb %bpl, %bpl
je 0x518d
movq 0x68(%rbx), %rax
cmpl $0x0, (%rax,%r14,4)
je 0x5206
movq 0x58(%rbx), %rax
movq (%rax,%r14,8), %rdi
movq 0x28(%rbx), %rsi
movl 0x54(%rbx), %eax
xorl %ecx, %ecx
cmpq %rax, %r14
setne %cl
shll $0x4, %ecx
movq 0x30(%rcx,%rbx), %rdx
movq 0x38(%rcx,%rbx), %rcx
callq 0x439c
movq 0x58(%rbx), %rax
movq (%rax,%r14,8), %rdi
movswl 0x22(%rbx), %esi
movswl 0x20(%rbx), %edx
incl %r15d
imull %r15d, %edx
addl %esi, %edx
movswl 0x1c(%rbx), %ecx
subl %esi, %ecx
subl %esi, %ecx
xorl %r8d, %r8d
callq 0x449f
movq 0x58(%rbx), %rax
movq (%rax,%r14,8), %rax
movq 0x99c2(%rip), %rdi      # 0xebb0
movq 0x8(%rax), %rsi
callq 0x3350
movq 0x58(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x466e
jmp 0x521e
movq 0x58(%rbx), %rax
movq (%rax,%r14,8), %rax
movq 0x999b(%rip), %rdi      # 0xebb0
movq 0x8(%rax), %rsi
callq 0x32a0
incq %r14
movl 0x50(%rbx), %eax
cmpq %rax, %r14
jb 0x517d
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./menubox.c
// Function: menubox_free
void menubox_free(Menubox *mb)
{
	for (uint i = 0; i < mb->box_count; i++)
		textbox_free(mb->boxes[i]);
	free(mb->boxes);
	free(mb->ids);
	free(mb->show);
	textbox_free(mb->input);
	XDestroyWindow(display, mb->window);
	free(mb);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x50(%rdi)
je 0x529c
xorl %r14d, %r14d
movq 0x58(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x4608
incq %r14
movl 0x50(%rbx), %eax
cmpq %rax, %r14
jb 0x5284
movq 0x58(%rbx), %rdi
callq 0x3220
movq 0x60(%rbx), %rdi
callq 0x3220
movq 0x68(%rbx), %rdi
callq 0x3220
movq 0x70(%rbx), %rdi
callq 0x4608
movq 0x98e9(%rip), %rdi      # 0xebb0
movq 0x8(%rbx), %rsi
callq 0x3280
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3220
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./menubox.c
// Function: menubox_filter
void menubox_filter(Menubox *mb)
{
	int filter = strlen(mb->input->text) > 0;
	char *pattern = strdup(mb->input->text);
	for (char *p = pattern; *p; *p = tolower(*p), p++);

	for (int i = 0; i < mb->box_count; i++)
	{
		char *subject = strdup(mb->boxes[i]->text);
		for (char *p = subject; *p; *p = tolower(*p), p++);
		mb->show[i] = (!filter || regex_match(pattern, subject));
		free(subject);
	}
	free(pattern);

	// active entry maybe filtered. step backward
	while (!mb->show[mb->box_active] && mb->box_active > 0)
		mb->box_active--;

	// active entry maybe filtered. step forward
	while (!mb->show[mb->box_active] && mb->box_active < mb->box_count-1)
		mb->box_active++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x70(%rdi), %rax
movq 0x50(%rax), %rdi
movb (%rdi), %bpl
callq 0x3430
movq %rax, %r14
movb (%rax), %r15b
testb %r15b, %r15b
je 0x5329
callq 0x34e0
leaq 0x1(%r14), %rcx
movq (%rax), %rdx
movsbq %r15b, %rsi
movb (%rdx,%rsi,4), %dl
movb %dl, -0x1(%rcx)
movb (%rcx), %r15b
incq %rcx
testb %r15b, %r15b
jne 0x5311
movl 0x50(%rbx), %r15d
testl %r15d, %r15d
je 0x53a5
xorl %r12d, %r12d
movq 0x58(%rbx), %rax
movq (%rax,%r12,8), %rax
movq 0x50(%rax), %rdi
callq 0x3430
movq %rax, %r15
movb (%rax), %r13b
testb %r13b, %r13b
je 0x5372
callq 0x34e0
leaq 0x1(%r15), %rcx
movq (%rax), %rdx
movsbq %r13b, %rsi
movb (%rdx,%rsi,4), %dl
movb %dl, -0x1(%rcx)
movb (%rcx), %r13b
incq %rcx
testb %r13b, %r13b
jne 0x535a
testb %bpl, %bpl
je 0x5384
movq %r14, %rdi
movq %r15, %rsi
callq 0x4139
jmp 0x5389
movl $0x1, %eax
movq 0x68(%rbx), %rcx
movl %eax, (%rcx,%r12,4)
movq %r15, %rdi
callq 0x3220
incq %r12
movl 0x50(%rbx), %r15d
cmpq %r15, %r12
jb 0x5335
movq %r14, %rdi
callq 0x3220
movq 0x68(%rbx), %rax
movl 0x54(%rbx), %ecx
testq %rcx, %rcx
je 0x53da
cmpl $0x0, (%rax,%rcx,4)
jne 0x53da
decq %rcx
movq %rcx, %rdx
decq %rcx
leal 0x1(%rcx), %esi
movl %esi, 0x54(%rbx)
testl %edx, %edx
je 0x53da
movl %edx, %edx
cmpl $0x0, (%rax,%rdx,4)
je 0x53c2
decl %r15d
movl 0x54(%rbx), %ecx
cmpl %r15d, %ecx
jae 0x5403
cmpl $0x0, (%rax,%rcx,4)
jne 0x5403
movl %r15d, %edx
incq %rcx
movl %ecx, 0x54(%rbx)
cmpq %rdx, %rcx
jae 0x5403
cmpl $0x0, (%rax,%rcx,4)
leaq 0x1(%rcx), %rcx
je 0x53f1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./menubox.c
// Function: menubox_keypress
int menubox_keypress(Menubox *mb, XEvent *ev)
{
	KeySym key; Status stat; char pad[32];

	int len = XmbLookupString(mb->input->xic, &ev->xkey, pad, sizeof(pad), &key, &stat);
	pad[len] = 0;

	int rc = 0;

	switch (key)
	{
		case XK_Up     : { menubox_key_up(mb);   rc = 1; break; }
		case XK_Down   : { menubox_key_down(mb); rc = 1; break; }
		case XK_Escape : { rc = -2; break; }
		case XK_Return : { rc = -1; break; }
		default: rc = textbox_keypress(mb->input, ev);
	}

	menubox_filter(mb);
	return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x70(%rdi), %rax
movq 0x68(%rax), %rdi
leaq 0x10(%rsp), %rdx
leaq 0x8(%rsp), %r15
leaq 0x4(%rsp), %r9
movl $0x20, %ecx
movq %r15, %r8
callq 0x34f0
cltq
movb $0x0, 0x10(%rsp,%rax)
movq (%r15), %rax
cmpq $0xff51, %rax           # imm = 0xFF51
jg 0x548e
cmpq $0xff0d, %rax           # imm = 0xFF0D
je 0x54be
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
cmpq $0xff1b, %rax           # imm = 0xFF1B
je 0x54db
jmp 0x54ae
cmpq $0xff54, %rax           # imm = 0xFF54
je 0x54c5
cmpq $0xff52, %rax           # imm = 0xFF52
jne 0x54ae
movl 0x54(%rbx), %eax
movl $0x1, %ebp
testl %eax, %eax
je 0x54db
decl %eax
jmp 0x54d8
movq 0x70(%rbx), %rdi
movq %r14, %rsi
callq 0x4bf6
movl %eax, %ebp
jmp 0x54db
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x54db
movl 0x50(%rbx), %ecx
movl 0x54(%rbx), %eax
decl %ecx
movl $0x1, %ebp
cmpl %ecx, %eax
jae 0x54db
incl %eax
movl %eax, 0x54(%rbx)
movq %rbx, %rdi
callq 0x52df
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./action.c
// Function: action_move_direction
void action_move_direction(void *data, int num, Client *cli)
{
	if (!cli) return;
	client_place_spot(cli, spot_choose_by_direction(cli->spot, cli->monitor, num), cli->monitor, 1);
	client_raise_family(cli);
	current_spot = cli->spot; current_mon = cli->monitor;
	spot_warp_pointer(cli->spot, cli->monitor);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdx, %rbx
testq %rdx, %rdx
je 0x5588
movl %esi, %edx
movl 0x118(%rbx), %edi
movswl 0x100(%rbx), %ebp
movl %ebp, %esi
callq 0x7ca1
movq %rbx, %rdi
movl %eax, %esi
movl %ebp, %edx
movl $0x1, %ecx
callq 0x6bc5
movq %rbx, %rdi
callq 0x7081
movq 0x118(%rbx), %rdi
movw %di, 0x9cd9(%rip)       # 0xf248
movswl 0x100(%rbx), %esi
movw %si, 0x9ccd(%rip)       # 0xf24a
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x7abe
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./action.c
// Function: action_raise_nth
void action_raise_nth(void *data, int num, Client *cli)
{
	if (!cli) return;
	int i, n = 0; Client *c;
	for_windows(i, c) if (c->manage && c->spot == cli->spot && c->monitor == cli->monitor && num == n++)
		{ client_activate(c); break; }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testq %rdx, %rdx
je 0x55fe
movq %rdx, %rbx
movl %esi, %ebp
callq 0x606d
movswq 0x97f6(%rip), %rax      # 0xeda0
testq %rax, %rax
jle 0x55fe
xorl %ecx, %ecx
leaq 0x97e8(%rip), %rdx      # 0xeda0
xorl %esi, %esi
movq 0x8(%rdx,%rcx,8), %r14
testq %r14, %r14
je 0x55f6
cmpw $0x0, 0x104(%r14)
je 0x55f6
movq 0x118(%r14), %rdi
cmpq 0x118(%rbx), %rdi
jne 0x55f6
movzwl 0x100(%r14), %edi
cmpw 0x100(%rbx), %di
jne 0x55f6
cmpl %ebp, %esi
je 0x5603
incl %esi
incq %rcx
cmpq %rcx, %rax
jne 0x55ba
popq %rbx
popq %r14
popq %rbp
retq
movq %r14, %rdi
callq 0x7081
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x727a
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./action.c
// Function: action_cycle
void action_cycle(void *data, int num, Client *cli)
{
	if (!cli) return;
	STACK_INIT(order);
	if (spot_stack_clients(cli->spot, cli->monitor, &order) > 1)
	{
		int i; Client *c = NULL;
		for_stack_rev(&order, i, c) if (c->manage && c->transient == None && c->window != cli->window)
		{
			client_activate(c);
			break;
		}
	}
}

// Assembly:
testq %rdx, %rdx
je 0x56a0
pushq %r14
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdx, %rbx
movq %rsp, %r14
movl $0x408, %edx            # imm = 0x408
movq %r14, %rdi
xorl %esi, %esi
callq 0x3070
movl 0x118(%rbx), %edi
movswl 0x100(%rbx), %esi
movq %r14, %rdx
callq 0x7d91
cmpl $0x2, %eax
jl 0x5696
movswq (%rsp), %rax
testq %rax, %rax
jle 0x5696
incq %rax
movq -0x8(%rsp,%rax,8), %r14
testq %r14, %r14
je 0x568d
cmpw $0x0, 0x104(%r14)
je 0x568d
cmpq $0x0, 0x90(%r14)
jne 0x568d
movq (%r14), %rcx
cmpq (%rbx), %rcx
jne 0x56a1
decq %rax
cmpq $0x1, %rax
jg 0x5666
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
retq
movq %r14, %rdi
callq 0x7081
movq %r14, %rdi
callq 0x727a
jmp 0x5696
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./action.c
// Function: action_fullscreen
void action_fullscreen(void *data, int num, Client *cli)
{
	if (!cli) return;

	unsigned long spot;
	if (cli->full && GETPROP_LONG(cli->window, atoms[XOAT_SPOT], &spot, 1))
		cli->spot = spot;

	SETPROP_LONG(cli->window, atoms[XOAT_SPOT], &cli->spot, 1);
	client_toggle_state(cli, atoms[_NET_WM_STATE_FULLSCREEN]);
	client_place_spot(cli, cli->full ? SPOT1: cli->spot, cli->monitor, 1);
	client_update_border(cli);
	client_raise_family(cli);
}

// Assembly:
testq %rdx, %rdx
je 0x57d5
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
cmpw $0x0, 0x10a(%rdx)
je 0x5756
movq (%rbx), %rdi
movq 0x9588(%rip), %rsi      # 0xeca0
leaq 0x9a91(%rip), %rdx      # 0xf1b0
leaq 0x9a92(%rip), %rcx      # 0xf1b8
movq %rsp, %r8
movl $0x8, %r9d
callq 0x5d7b
testl %eax, %eax
je 0x5756
cmpq $0x6, 0x9a70(%rip)      # 0xf1b0
jne 0x5756
cmpl $0x0, 0x9a6f(%rip)      # 0xf1b8
je 0x5756
movq (%rsp), %rax
movq %rax, 0x118(%rbx)
movq 0x9453(%rip), %rdi      # 0xebb0
movq (%rbx), %rsi
movq 0x9539(%rip), %rdx      # 0xeca0
leaq 0x118(%rbx), %r14
movl $0x6, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
pushq $0x1
pushq %r14
callq 0x35d0
addq $0x10, %rsp
movq 0x95b8(%rip), %rsi      # 0xed48
movq %rbx, %rdi
callq 0x69b0
movl $0x1, %esi
cmpw $0x0, 0x10a(%rbx)
jne 0x57aa
movl (%r14), %esi
movswl 0x100(%rbx), %edx
movq %rbx, %rdi
movl $0x1, %ecx
callq 0x6bc5
movq %rbx, %rdi
callq 0x6a78
movq %rbx, %rdi
callq 0x7081
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./action.c
// Function: action_maximize
void action_maximize(void *data, int num, Client *cli)
{
	if (!cli) return;
	cli->max = !cli->max;
	SETPROP_LONG(cli->window, atoms[XOAT_MAXIMIZE], &cli->max, 1);
	client_place_spot(cli, cli->spot, cli->monitor, 1);
}

// Assembly:
testq %rdx, %rdx
je 0x58b6
pushq %rbx
movq %rdx, %rbx
leaq 0x120(%rdx), %rax
xorl %ecx, %ecx
cmpq $0x0, 0x120(%rdx)
sete %cl
movq %rcx, 0x120(%rdx)
movq 0x9339(%rip), %rdi      # 0xebb0
movq (%rdx), %rsi
movq 0x9437(%rip), %rdx      # 0xecb8
movl $0x6, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
pushq $0x1
pushq %rax
callq 0x35d0
addq $0x10, %rsp
movl 0x118(%rbx), %esi
movswl 0x100(%rbx), %edx
movq %rbx, %rdi
movl $0x1, %ecx
popq %rbx
jmp 0x6bc5
retq
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/xoat.c
// Function: exec_cmd
void exec_cmd(char *cmd)
{
	signal(SIGCHLD, catch_exit);
	if (!cmd || !cmd[0] || fork()) return;
	setsid();
	EXECSH(cmd);
	exit(EXIT_FAILURE);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq -0x23(%rip), %rsi       # 0x58f7
movl $0x11, %edi
callq 0x3380
testq %rbx, %rbx
je 0x5937
cmpb $0x0, (%rbx)
je 0x5937
callq 0x3610
testl %eax, %eax
je 0x5939
popq %rbx
retq
callq 0x3090
leaq 0x4a3f(%rip), %rdi      # 0xa384
leaq 0x4a3d(%rip), %rsi      # 0xa389
leaq 0x4a39(%rip), %rdx      # 0xa38c
movq %rbx, %rcx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x3190
movl $0x1, %edi
callq 0x3100
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./window.c
// Function: window_get_prop
int window_get_prop(Window w, Atom prop, Atom *type, int *items, void *buffer, int bytes)
{
	memset(buffer, 0, bytes);
	int format; unsigned long nitems, nbytes; unsigned char *ret = NULL;
	if (XGetWindowProperty(display, w, prop, 0, bytes/4, False, AnyPropertyType, type,
		&format, &nitems, &nbytes, &ret) == Success && ret && *type != None && format)
	{
		if (format ==  8) memmove(buffer, ret, MIN(bytes, nitems));
		if (format == 16) memmove(buffer, ret, MIN(bytes, nitems * sizeof(short)));
		if (format == 32) memmove(buffer, ret, MIN(bytes, nitems * sizeof(long)));
		*items = (int)nitems; XFree(ret);
		return 1;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, 0x20(%rsp)
movq %rdx, %rbp
movq %rsi, %r13
movq %rdi, %rbx
movslq %r9d, %r15
xorl %r12d, %r12d
movq %r8, 0x18(%rsp)
movq %r8, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x3070
leaq 0x28(%rsp), %r14
movq %r12, (%r14)
movq 0x8df2(%rip), %rdi      # 0xebb0
leal 0x3(%r15), %eax
testl %r15d, %r15d
cmovnsl %r15d, %eax
sarl $0x2, %eax
movslq %eax, %r8
leaq 0x30(%rsp), %rax
leaq 0x8(%rsp), %r10
leaq 0x14(%rsp), %r11
movq %rbx, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
xorl %r9d, %r9d
pushq %r14
pushq %rax
pushq %r10
pushq %r11
pushq %rbp
pushq %r12
callq 0x3120
addq $0x30, %rsp
testl %eax, %eax
sete %al
movq (%r14), %r13
testq %r13, %r13
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x5e82
cmpq $0x0, (%rbp)
setne %cl
movl 0x14(%rsp), %eax
testl %eax, %eax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x5e82
cmpl $0x20, %eax
je 0x5e49
cmpl $0x10, %eax
je 0x5e3f
cmpl $0x8, %eax
jne 0x5e69
movq 0x8(%rsp), %rax
jmp 0x5e52
movq 0x8(%rsp), %rax
addq %rax, %rax
jmp 0x5e52
movq 0x8(%rsp), %rax
shlq $0x3, %rax
cmpq %r15, %rax
cmovbq %rax, %r15
movq 0x18(%rsp), %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x33a0
movl 0x8(%rsp), %eax
movq 0x20(%rsp), %rcx
movl %eax, (%rcx)
movq %r13, %rdi
callq 0x3050
movl $0x1, %r12d
movl %r12d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./window.c
// Function: window_get_text_prop
char* window_get_text_prop(Window w, Atom atom)
{
	XTextProperty prop; char *res = NULL;
	char **list = NULL; int count;
	if (XGetTextProperty(display, w, &prop, atom) && prop.value && prop.nitems)
	{
		if (prop.encoding == XA_STRING)
		{
			res = malloc(strlen((char*)prop.value)+1);
			strcpy(res, (char*)prop.value);
		}
		else
		if (XmbTextPropertyToTextList(display, &prop, &list, &count) >= Success && count > 0 && *list)
		{
			res = malloc(strlen(*list)+1);
			strcpy(res, *list);
			XFreeStringList(list);
		}
	}
	if (prop.value) XFree(prop.value);
	return res;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %rcx
movq %rdi, %rsi
movq $0x0, 0x8(%rsp)
movq 0x8cfd(%rip), %rdi      # 0xebb0
leaq 0x10(%rsp), %rdx
callq 0x3270
xorl %ebx, %ebx
testl %eax, %eax
je 0x5f6a
movq 0x10(%rsp), %r14
testq %r14, %r14
je 0x5f6a
cmpq $0x0, 0x28(%rsp)
je 0x5f6a
cmpq $0x1f, 0x18(%rsp)
jne 0x5f0a
movq %r14, %rdi
callq 0x3250
leaq 0x1(%rax), %rdi
callq 0x3150
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0x3480
jmp 0x5f6a
movq 0x8c9f(%rip), %rdi      # 0xebb0
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x4(%rsp), %rcx
callq 0x31c0
xorl %ebx, %ebx
testl %eax, %eax
js 0x5f6a
cmpl $0x0, 0x4(%rsp)
jle 0x5f6a
movq 0x8(%rsp), %r14
movq (%r14), %r15
testq %r15, %r15
je 0x5f68
movq %r15, %rdi
callq 0x3250
leaq 0x1(%rax), %rdi
callq 0x3150
movq %rax, %rbx
movq %rax, %rdi
movq %r15, %rsi
callq 0x3480
movq %r14, %rdi
callq 0x34a0
jmp 0x5f6a
xorl %ebx, %ebx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x5f79
callq 0x3050
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./window.c
// Function: window_get_name
char* window_get_name(Window w)
{
	char *name = NULL, *tmp = NULL;
	if (!(name = window_get_text_prop(w, atoms[_NET_WM_NAME])))
		if (XFetchName(display, w, &tmp))
			name = strdup(tmp);
	if (tmp) XFree(tmp);
	return name;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq $0x0, (%rsp)
movq 0x8d54(%rip), %rsi      # 0xecf0
callq 0x5e94
movq %rax, %rbx
testq %rax, %rax
jne 0x5fcf
movq 0x8c00(%rip), %rdi      # 0xebb0
movq %rsp, %rdx
movq %r14, %rsi
callq 0x3510
testl %eax, %eax
je 0x5fcd
movq (%rsp), %rdi
callq 0x3430
movq %rax, %rbx
jmp 0x5fcf
xorl %ebx, %ebx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x5fdd
callq 0x3050
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./window.c
// Function: window_send_clientmessage
int window_send_clientmessage(Window target, Window subject, Atom atom, unsigned long protocol, unsigned long mask)
{
	XEvent e;
	e.xclient.type         = ClientMessage;
	e.xclient.message_type = atom;
	e.xclient.window       = subject;
	e.xclient.data.l[0]    = protocol;
	e.xclient.data.l[1]    = latest_action;
	e.xclient.send_event   = True;
	e.xclient.format       = 32;
	int r = XSendEvent(display, target, False, mask, &e) ?1:0;
	XFlush(display);
	return r;
}

// Assembly:
pushq %rbx
subq $0xc0, %rsp
movq %r8, %r9
movq %rdi, %rax
movq %rsp, %r8
movl $0x21, (%r8)
movq %rdx, 0x28(%r8)
movq %rsi, 0x20(%r8)
movq %rcx, 0x38(%r8)
movq 0x8d85(%rip), %rcx      # 0xed98
movq %rcx, 0x40(%r8)
movl $0x1, 0x10(%r8)
movl $0x20, 0x30(%r8)
movq 0x8b82(%rip), %rdi      # 0xebb0
movq %rax, %rsi
xorl %edx, %edx
movq %r9, %rcx
callq 0x3440
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
movq 0x8b67(%rip), %rdi      # 0xebb0
callq 0x3410
movl %ebx, %eax
addq $0xc0, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./window.c
// Function: query_windows
void query_windows()
{
	unsigned int nwins; int i; Window w1, w2, *wins; Client *c;
	if (windows.depth || !(XQueryTree(display, root, &w1, &w2, &wins, &nwins) && wins))
		return;
	for (i = nwins-1; i > -1 && windows.depth < STACK; i--)
	{
		if ((c = window_build_client(wins[i])) && c->visible)
		{
			windows.clients[windows.depth] = c;
			windows.windows[windows.depth++] = wins[i];
		}
		else client_free(c);
	}
	XFree(wins);
}

// Assembly:
cmpw $0x0, 0x8d2b(%rip)      # 0xeda0
je 0x6078
retq
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq 0x8b2a(%rip), %rdi      # 0xebb0
movq 0x911b(%rip), %rsi      # 0xf1a8
leaq 0x20(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x8(%rsp), %r8
leaq 0x14(%rsp), %r9
callq 0x36a0
testl %eax, %eax
je 0x6140
cmpq $0x0, 0x8(%rsp)
je 0x6140
movl 0x14(%rsp), %eax
decl %eax
js 0x6136
cmpw $0x3f, 0x8cd6(%rip)     # 0xeda0
jg 0x6136
movl %eax, %ebx
leaq 0x8ccb(%rip), %r14      # 0xeda0
movq 0x8(%rsp), %rax
movq (%rax,%rbx,8), %rdi
callq 0x6148
testq %rax, %rax
je 0x611c
cmpw $0x0, 0x102(%rax)
je 0x611c
movswq 0x8ca6(%rip), %rcx      # 0xeda0
movq %rax, 0x8(%r14,%rcx,8)
movq 0x8(%rsp), %rax
movq (%rax,%rbx,8), %rax
leal 0x1(%rcx), %edx
movw %dx, 0x8c8e(%rip)       # 0xeda0
movq %rax, 0x208(%r14,%rcx,8)
jmp 0x6124
movq %rax, %rdi
callq 0x6884
testq %rbx, %rbx
jle 0x6136
decq %rbx
cmpw $0x40, 0x8c6c(%rip)     # 0xeda0
jl 0x60d5
movq 0x8(%rsp), %rdi
callq 0x3050
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./ewmh.c
// Function: ewmh_client_list
void ewmh_client_list()
{
	int i; Client *c; STACK_INIT(wins);
	for_windows_rev(i, c) if (c->manage)
		wins.windows[wins.depth++] = c->window;
	SETPROP_WIND(root, atoms[_NET_CLIENT_LIST_STACKING], wins.windows, wins.depth);
	// hack for now, since we dont track window mapping history
	SETPROP_WIND(root, atoms[_NET_CLIENT_LIST], wins.windows, wins.depth);
}

// Assembly:
pushq %rbx
subq $0x410, %rsp            # imm = 0x410
leaq 0x8(%rsp), %rbx
movl $0x408, %edx            # imm = 0x408
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3070
callq 0x606d
movswq 0x84d4(%rip), %rcx      # 0xeda0
movzwl (%rbx), %eax
testq %rcx, %rcx
jle 0x6912
leaq 0x84c5(%rip), %rdx      # 0xeda0
leaq (%rdx,%rcx,8), %rdx
incq %rcx
movq (%rdx), %rsi
testq %rsi, %rsi
je 0x6905
cmpw $0x0, 0x104(%rsi)
je 0x6905
movq (%rsi), %rsi
movswq %ax, %rdi
incl %eax
movq %rsi, 0x210(%rsp,%rdi,8)
decq %rcx
addq $-0x8, %rdx
cmpq $0x1, %rcx
jg 0x68e2
leaq 0x210(%rsp), %rbx
movw %ax, -0x208(%rbx)
movq 0x8288(%rip), %rdi      # 0xebb0
movq 0x8879(%rip), %rsi      # 0xf1a8
movq 0x83a2(%rip), %rdx      # 0xecd8
cwtl
movl $0x21, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
pushq %rax
pushq %rbx
callq 0x35d0
addq $0x10, %rsp
movq 0x8259(%rip), %rdi      # 0xebb0
movq 0x884a(%rip), %rsi      # 0xf1a8
movq 0x837b(%rip), %rdx      # 0xece0
movswl -0x208(%rbx), %eax
movl $0x21, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
pushq %rax
pushq %rbx
callq 0x35d0
addq $0x420, %rsp            # imm = 0x420
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./client.c
// Function: client_toggle_state
int client_toggle_state(Client *c, Atom state)
{
	int i, j, rc = 0;
	for (i = 0, j = 0; i < ATOMLIST && c->states[i]; i++, j++)
	{
		if (c->states[i] == state) i++;
		c->states[j] = c->states[i];
	}
	if (i == j && j < ATOMLIST)
	{
		c->states[j++] = state;
		rc = 1;
	}
	SETPROP_ATOM(c->window, atoms[_NET_WM_STATE], c->states, j);
	if (state == atoms[_NET_WM_STATE_FULLSCREEN])        c->full   = rc;
	if (state == atoms[_NET_WM_STATE_DEMANDS_ATTENTION]) c->urgent = rc;
	return rc;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
xorl %eax, %eax
xorl %ecx, %ecx
movslq %ecx, %rdx
movq 0xa8(%rbx,%rdx,8), %rdx
testq %rdx, %rdx
je 0x69f9
xorl %esi, %esi
cmpq %r14, %rdx
sete %sil
leal (%rcx,%rsi), %edx
movslq %edx, %rdx
movq 0xa8(%rbx,%rdx,8), %rdi
movq %rdi, 0xa8(%rbx,%rax,8)
addl %esi, %ecx
incl %ecx
incq %rax
cmpl $0x9, %edx
jl 0x69be
cmpl %eax, %ecx
setne %cl
cmpl $0xa, %eax
setae %dl
xorl %ebp, %ebp
orb %cl, %dl
jne 0x6a1f
leal 0x1(%rax), %ecx
andl $0xf, %eax
movq %r14, 0xa8(%rbx,%rax,8)
movl $0x1, %ebp
movl %ecx, %eax
movq 0x818a(%rip), %rdi      # 0xebb0
movq (%rbx), %rsi
movq 0x8310(%rip), %rdx      # 0xed40
leaq 0xa8(%rbx), %r10
movl $0x4, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
pushq %rax
pushq %r10
callq 0x35d0
addq $0x10, %rsp
cmpq %r14, 0x82f0(%rip)      # 0xed48
jne 0x6a61
movw %bp, 0x10a(%rbx)
cmpq %r14, 0x82f8(%rip)      # 0xed60
jne 0x6a71
movw %bp, 0x108(%rbx)
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./client.c
// Function: client_update_border
void client_update_border(Client *c)
{
	XColor color; Colormap map = DefaultColormap(display, DefaultScreen(display));
	char *colorname = c->window == current ? settings.border_focus: (c->urgent ? settings.border_urgent: settings.border_blur);
	XSetWindowBorder(display, c->window, XAllocNamedColor(display, map, colorname, &color, &color) ? color.pixel: None);
	XSetWindowBorderWidth(display, c->window, c->full ? 0: settings.border);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x8123(%rip), %r14      # 0xebb0
movq 0xe8(%r14), %rax
movslq 0xe0(%r14), %rcx
shlq $0x7, %rcx
movq 0x50(%rax,%rcx), %rsi
movq (%rdi), %r15
cmpq 0x810a(%rip), %r15      # 0xebb8
jne 0x6ab9
movq 0x8719(%rip), %rdx      # 0xf1d0
jmp 0x6ad5
xorl %eax, %eax
cmpw $0x0, 0x108(%rbx)
setne %al
leaq 0x86f3(%rip), %rcx      # 0xf1c0
shll $0x4, %eax
movq 0x8(%rax,%rcx), %rdx
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
movq %rcx, %r8
callq 0x31a0
xorl %r12d, %r12d
testl %eax, %eax
je 0x6af3
movq 0x8(%rsp), %rdx
jmp 0x6af5
xorl %edx, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3260
movq 0x80a9(%rip), %rdi      # 0xebb0
movq (%rbx), %rsi
cmpw $0x0, 0x10a(%rbx)
jne 0x6b1b
movl 0x86a5(%rip), %r12d     # 0xf1c0
movl %r12d, %edx
callq 0x34c0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./client.c
// Function: client_send_wm_protocol
int client_send_wm_protocol(Client *c, Atom protocol)
{
	Atom protocols[ATOMLIST]; int i, n;
	if ((n = GETPROP_ATOM(c->window, atoms[WM_PROTOCOLS], protocols, ATOMLIST)))
		for (i = 0; i < n; i++) if (protocols[i] == protocol)
			return window_send_clientmessage(c->window, c->window, atoms[WM_PROTOCOLS], protocol, NoEventMask);
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
movq 0x824a(%rip), %rsi      # 0xed90
leaq 0x8663(%rip), %rdx      # 0xf1b0
leaq 0x8664(%rip), %rcx      # 0xf1b8
movq %rsp, %r8
movl $0x50, %r9d
callq 0x5d7b
testl %eax, %eax
setne %cl
cmpq $0x4, 0x8641(%rip)      # 0xf1b0
sete %dl
movl 0x8640(%rip), %eax      # 0xf1b8
testl %eax, %eax
setg %sil
andb %dl, %sil
andb %cl, %sil
cmpb $0x1, %sil
jne 0x6b9c
movl %eax, %eax
xorl %ecx, %ecx
cmpq %rbx, (%rsp,%rcx,8)
je 0x6ba6
incq %rcx
cmpq %rcx, %rax
jne 0x6b8e
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r14
retq
movq (%r14), %rdi
movq 0x81e0(%rip), %rdx      # 0xed90
movq %rdi, %rsi
movq %rbx, %rcx
xorl %r8d, %r8d
addq $0x58, %rsp
popq %rbx
popq %r14
jmp 0x5fe8
// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./client.c
// Function: client_stack_family
void client_stack_family(Client *c, Stack *raise)
{
	int i; Client *o, *self = NULL;
	for_windows(i, o)
	{
		if (o->manage && o->visible && o->transient == c->window)
			client_stack_family(o, raise);
		else
		if (o->visible && o->window == c->window)
			self = o;
	}
	if (self)
	{
		raise->clients[raise->depth] = self;
		raise->windows[raise->depth++] = self->window;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x606d
cmpw $0x0, 0x7db4(%rip)      # 0xeda0
jle 0x7055
xorl %r12d, %r12d
leaq 0x7da8(%rip), %r13      # 0xeda0
xorl %r15d, %r15d
movq 0x8(%r13,%r12,8), %rdi
testq %rdi, %rdi
je 0x7043
cmpw $0x0, 0x104(%rdi)
je 0x702f
cmpw $0x0, 0x102(%rdi)
je 0x702f
movq 0x90(%rdi), %rax
cmpq (%r14), %rax
jne 0x702f
movq %rbx, %rsi
callq 0x6fd0
jmp 0x7043
cmpw $0x0, 0x102(%rdi)
je 0x7043
movq (%rdi), %rax
cmpq (%r14), %rax
cmoveq %rdi, %r15
incq %r12
movswq 0x7d52(%rip), %rax      # 0xeda0
cmpq %rax, %r12
jl 0x6ffb
jmp 0x7058
xorl %r15d, %r15d
testq %r15, %r15
je 0x7077
movswq (%rbx), %rax
movq %r15, 0x8(%rbx,%rax,8)
movq (%r15), %rcx
leal 0x1(%rax), %edx
movw %dx, (%rbx)
movq %rcx, 0x208(%rbx,%rax,8)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq