LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/almk277[P]ROSE/lib/symtbl.c
// Function: symtbl_clear
void symtbl_clear(SymbolTable *tbl)
{
	int i;
	FOREACH(i, tbl) {
		SymbolSlistHead *head = &tbl->heads[i];
		while(!SLIST_EMPTY(head)) {
			//TODO delete symbol?
			mm_free(SymbolEntry, SLIST_FIRST(head));
			SLIST_REMOVE_HEAD(head, le);
		}
	}
	tbl->size = 0;
}

// Assembly:
xorl %eax, %eax
movq (%rdi,%rax,8), %rcx
testq %rcx, %rcx
je 0x3072
movq 0x408e(%rip), %rdx      # 0x70e8
movq %rdx, (%rcx)
movq (%rdi,%rax,8), %rcx
movq %rcx, 0x4080(%rip)      # 0x70e8
movq 0x10(%rcx), %rcx
movq %rcx, (%rdi,%rax,8)
jmp 0x304e
incq %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0x304a
movl $0x0, 0x800(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/almk277[P]ROSE/lib/symtbl.c
// Function: symtbl_foreach
void symtbl_foreach(const SymbolTable *tbl,
		void (*fn)(Symbol *sym, const SymbolValue *val))
{
	int i;
	FOREACH(i, tbl) {
		const SymbolSlistHead *head = &tbl->heads[i];
		const SymbolEntry *ent;
		SLIST_FOREACH(ent, head, le)
			fn(ent->symbol, &ent->value);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movq (%r14,%r15,8), %r12
testq %r12, %r12
je 0x30b4
movq (%r12), %rdi
leaq 0x8(%r12), %rsi
callq *%rbx
movq 0x10(%r12), %r12
jmp 0x309d
incq %r15
cmpq $0x100, %r15            # imm = 0x100
jne 0x3099
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/almk277[P]ROSE/lib/mm.c
// Function: mm_pool_alloc
void mm_pool_alloc(struct mm_pool_struct *pool)
{
	const unsigned size = pool->el_size;
	unsigned poolsize = pool->size;
	char *mem = malloc(size * poolsize);
#ifdef TEST
	++alloc_count;
#endif
	if(unlikely(mem == NULL)) {
		poolsize = MM_MIN_SIZE;
		mem = malloc(size * MM_MIN_SIZE);
		if(unlikely(mem == NULL)) {
			if(mm_on_error)
				mem = mm_on_error(pool);
			else {
				fputs(__FILE__ ": ERROR: Out of memory", stderr);
				exit(1);
			}
		}
	}

	pool->head = mem;
	for(--poolsize; poolsize != 0; --poolsize, mem += size)
		*(void **)mem = mem + size;
	*(void **)mem = NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x8(%rdi), %ebp
movl 0xc(%rdi), %r15d
movl %r15d, %edi
imull %ebp, %edi
callq 0x1130
testq %rax, %rax
je 0x3119
movq %rax, (%rbx)
decl %ebp
je 0x3104
leaq (%rax,%r15), %rcx
movq %rcx, (%rax)
movq %rcx, %rax
decl %ebp
jne 0x30f4
jmp 0x3107
movq %rax, %rcx
movq $0x0, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leal (,%r15,4), %edi
callq 0x1130
movl $0x4, %ebp
testq %rax, %rax
jne 0x30ed
movq %rsp, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x132f
movq (%r14), %rax
jmp 0x30ed
nop
// File: /workspace/github_c_makefile_star2_O1/almk277[P]ROSE/lib/loader.c
// Function: add
static int add(const char *path, int length)
{
	StdPath *sp;
	if(length == 0 || length > 255)
		return 0;
	sp = mm_alloc(StdPath);
	sp->length = length;
	memcpy(sp->buffer, path, length);
	if(path[length - 1] != '/')
		sp->buffer[sp->length++] = '/';
	SIMPLEQ_INSERT_TAIL(&stdpath_list, sp, pe);
	return 1;
}

// Assembly:
testl %esi, %esi
sete %cl
cmpl $0x100, %esi            # imm = 0x100
setge %dl
xorl %eax, %eax
orb %cl, %dl
jne 0x31fa
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
cmpq $0x0, 0x3f86(%rip)      # 0x7108
je 0x31fb
movq 0x3f7d(%rip), %r12      # 0x7108
movq (%r12), %rax
movq %rax, 0x3f72(%rip)      # 0x7108
movb %bl, (%r12)
leaq 0x1(%r12), %rdi
movslq %ebx, %r15
movq %r14, %rsi
movq %r15, %rdx
callq 0x1120
cmpb $0x2f, -0x1(%r14,%r15)
je 0x31c5
leal 0x1(%rbx), %eax
movb %al, (%r12)
movzbl %bl, %eax
movb $0x2f, 0x1(%r12,%rax)
leaq 0x108(%r12), %rax
movq $0x0, 0x108(%r12)
movq 0x3f20(%rip), %rcx      # 0x7100
movq %r12, (%rcx)
movq %rax, 0x3f16(%rip)      # 0x7100
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x3f06(%rip), %rdi      # 0x7108
callq 0x30cc
jmp 0x3184
// File: /workspace/github_c_makefile_star2_O1/almk277[P]ROSE/lib/loader.c
// Function: loader_add_dirs_from_env
void loader_add_dirs_from_env()
{
	const char *rosepath = getenv("ROSEPATH");
	if(rosepath) {
		const char *start, *end;
		for(start = rosepath, end = strchr(rosepath, ':'); end;
				start = end + 1, end = strchr(start, ':')) {
			add(start, end - start);
		}
		add(start, strlen(start));
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x104f(%rip), %rdi      # 0x4266
callq 0x1030
testq %rax, %rax
je 0x327a
movq %rax, %rbx
movq %rax, %rdi
movl $0x3a, %esi
callq 0x10b0
testq %rax, %rax
je 0x3261
movq %rax, %r14
movl %r14d, %esi
subl %ebx, %esi
movq %rbx, %rdi
callq 0x3155
movq %r14, %rbx
incq %rbx
movq %rbx, %rdi
movl $0x3a, %esi
callq 0x10b0
movq %rax, %r14
testq %rax, %rax
jne 0x3239
movq %rbx, %rdi
callq 0x10a0
movq %rbx, %rdi
movl %eax, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3155
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/almk277[P]ROSE/lib/loader.c
// Function: loader_add_dir_from_file
int loader_add_dir_from_file(const char *fname)
{
	const char *slash = strrchr(fname, '/');
	return slash ?
		add(fname, slash - fname + 1) : /* cut out last path component */
		add("./", 2);                   /* use current directory */
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x2f, %esi
callq 0x10d0
testq %rax, %rax
je 0x32a4
subl %ebx, %eax
incl %eax
movq %rbx, %rdi
movl %eax, %esi
popq %rbx
jmp 0x3155
leaq 0xfc4(%rip), %rdi       # 0x426f
movl $0x2, %esi
popq %rbx
jmp 0x3155
// File: /workspace/github_c_makefile_star2_O1/almk277[P]ROSE/lib/loader.c
// Function: loader_find_module
FILE *loader_find_module(Symbol *name)
{
	StdPath *ent;
	const int flen = strlen(name);
	SIMPLEQ_FOREACH(ent, &stdpath_list, pe) {
		FILE *f;
		static const char suffix[] = ".rmd";
		char *const buf = ent->buffer;
		const int dlen = ent->length;
		const int len = dlen + flen;
		if(len + sizeof suffix > 255)
			continue;
		strcpy(buf + dlen, name);
		memcpy(buf + len, suffix, sizeof suffix);
		f = fopen(buf, "rb");
		if(f)
			return f;
	}
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x10a0
movq 0x3e28(%rip), %rbp      # 0x70f8
testq %rbp, %rbp
je 0x3347
movq %rax, %r14
movzbl (%rbp), %eax
leal (%r14,%rax), %ecx
movslq %ecx, %r12
leaq -0xfb(%r12), %rdx
movl $0x4, %ecx
cmpq $-0x100, %rdx
jb 0x3336
leaq 0x1(%rbp), %r13
leaq (%rax,%rbp), %rdi
incq %rdi
movq %rbx, %rsi
callq 0x1070
movl $0x646d722e, 0x1(%rbp,%r12) # imm = 0x646D722E
movb $0x0, 0x5(%rbp,%r12)
movq %r13, %rdi
leaq 0xcec(%rip), %rsi       # 0x4011
callq 0x1150
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
cmovneq %rax, %r15
testb $0x3, %cl
jne 0x334a
movq 0x108(%rbp), %rbp
testq %rbp, %rbp
jne 0x32d8
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/almk277[P]ROSE/lib/loader.c
// Function: loader_print_pathes
void loader_print_pathes()
{
	StdPath *ent;
	SIMPLEQ_FOREACH(ent, &stdpath_list, pe) {
		fwrite(ent->buffer, ent->length, 1, stdout);
		putchar('\n');
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x3d91(%rip), %rbx      # 0x70f8
testq %rbx, %rbx
je 0x339d
movq 0x3c55(%rip), %r14      # 0x6fc8
leaq 0x1(%rbx), %rdi
movzbl (%rbx), %esi
movq (%r14), %rcx
movl $0x1, %edx
callq 0x1170
movl $0xa, %edi
callq 0x1050
movq 0x108(%rbx), %rbx
testq %rbx, %rbx
jne 0x3373
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/stv0g[P]c11-queues/spsc_ub_test_default.c
// Function: thread_func_push
int thread_func_push(void *ctx)
{
	struct spsc_ub_queue *q = (struct spsc_ub_queue *) ctx;

	srand((unsigned) time(0) + thread_get_id());
	size_t pause = rand() % 1000;

	/* Wait for global start signal */
	while (g_start == 0)
		thrd_yield();

	/* Wait for a random time */
	for (size_t i = 0; i != pause; i += 1)
		nop();

	for (int iter = 0; iter != iter_count; ++iter) {
		for (size_t i = 0; i != batch_size; i += 1) {
			void *ptr = (void *) i;
			spsc_ub_queue_push(q, ptr);	//FIXME
		}
	}
	thrd_yield();

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %edi, %edi
callq 0x1090
leal -0x1(%rax), %edi
callq 0x1080
callq 0x10f0
movslq %eax, %r14
imulq $0x10624dd3, %r14, %rax # imm = 0x10624DD3
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x26, %rax
addl %ecx, %eax
imull $0x3e8, %eax, %eax      # imm = 0x3E8
subl %eax, %r14d
cmpl $0x0, 0x2e4d(%rip)      # 0x4094
jne 0x1250
callq 0x1070
jmp 0x1240
testl %r14d, %r14d
je 0x125f
movslq %r14d, %rax
pause
decq %rax
jne 0x1258
xorl %r15d, %r15d
xorl %r14d, %r14d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x14e4
incq %r14
cmpq $0xa, %r14
jne 0x1265
incl %r15d
cmpl $0x1312d00, %r15d       # imm = 0x1312D00
jne 0x1262
callq 0x1070
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/stv0g[P]c11-queues/spsc_ub_test_default.c
// Function: thread_func_pull
int thread_func_pull(void *ctx)
{
	struct spsc_ub_queue *q = (struct spsc_ub_queue *) ctx;

	srand((unsigned) time(0) + thread_get_id());
	size_t pause = rand() % 1000;

	/* Wait for global start signal */
	while (g_start == 0)
		thrd_yield();

	/* Wait for a random time */
	for (size_t i = 0; i != pause; i += 1)
		nop();

	for (int iter = 0; iter != iter_count; ++iter) {
		for (size_t i = 0; i != batch_size; i += 1) {
			void *ptr;
			while (!spsc_ub_queue_pull(q, &ptr)){
				continue;
			}	//FIXME
		}
	}
	thrd_yield(); // queue empty
	
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %edi, %edi
callq 0x1090
leal -0x1(%rax), %edi
callq 0x1080
callq 0x10f0
movslq %eax, %r14
imulq $0x10624dd3, %r14, %rax # imm = 0x10624DD3
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x26, %rax
addl %ecx, %eax
imull $0x3e8, %eax, %eax      # imm = 0x3E8
subl %eax, %r14d
cmpl $0x0, 0x2dbc(%rip)      # 0x4094
jne 0x12e1
callq 0x1070
jmp 0x12d1
testl %r14d, %r14d
je 0x12f0
movslq %r14d, %rax
pause
decq %rax
jne 0x12e9
xorl %r15d, %r15d
movq %rsp, %r14
xorl %r12d, %r12d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x151c
testl %eax, %eax
je 0x12f9
incq %r12
cmpq $0xa, %r12
jne 0x12f9
incl %r15d
cmpl $0x1312d00, %r15d       # imm = 0x1312D00
jne 0x12f6
callq 0x1070
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/stv0g[P]c11-queues/spsc_ub_test_default.c
// Function: main
int main()
{
	struct spsc_ub_queue queue;
	thrd_t threads[thread_count + 1];
	int ret;
	
	spsc_ub_queue_init(&queue, batch_size * iter_count, &memtype_heap);

	printf("spsc_ub_queue_init successful\n");
	//for (int i = 0; i != thread_count; ++i)
	thrd_create(&threads[0], thread_func_push, &queue);
	thrd_create(&threads[1], thread_func_pull, &queue);

	sleep(1);

	uint64_t start = rdtscp();
	g_start = 1;

	//for (int i = 0; i != thread_count; ++i)
	thrd_join(threads[0], NULL);
	thrd_join(threads[1], NULL);

	uint64_t end = rdtscp();
	
	printf("cycles/op = %lu\n", (end - start) / (batch_size * iter_count * 2 * thread_count));

	if (queue._tail->_next != NULL)
		printf("slots in use? There is something wrong with the test\n");
	
	ret = spsc_ub_queue_destroy(&queue);
	if (ret)
		printf("Failed to destroy queue: %d", ret);
	
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rsp, %r12
leaq 0x2a38(%rip), %rdx      # 0x3d80
leaq 0x20(%rsp), %rbx
movl $0xbebc200, %esi        # imm = 0xBEBC200
movq %rbx, %rdi
callq 0x144c
leaq 0xcec(%rip), %rdi       # 0x204d
callq 0x1040
leaq -0x169(%rip), %rdx      # 0x1204
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
movq %rbx, %rcx
callq 0x10c0
leaq 0x18(%rsp), %r14
leaq -0xf6(%rip), %rdx       # 0x1292
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rcx
callq 0x10c0
movl $0x1, %edi
callq 0x10e0
rdtscp
shlq $0x20, %rdx
orq %rdx, %rax
movq %rax, %r15
movl $0x1, 0x2cde(%rip)      # 0x4094
movq -0x8(%r14), %rdi
leaq 0x8(%rsp), %rsi
callq 0x10d0
movq (%r14), %rdi
leaq 0x8(%rsp), %rsi
callq 0x10d0
rdtscp
shlq $0x20, %rdx
orq %rdx, %rax
subq %r15, %rax
movabsq $-0x543388ee7b9e3103, %rcx # imm = 0xABCC77118461CEFD
mulq %rcx
shrq $0x1c, %rdx
leaq 0xc2a(%rip), %rdi       # 0x2020
movq %rdx, %rsi
xorl %eax, %eax
callq 0x1060
movq 0x48(%rbx), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x1418
leaq 0xc58(%rip), %rdi       # 0x206b
callq 0x1040
leaq 0x20(%rsp), %rdi
callq 0x154a
testl %eax, %eax
je 0x1436
leaq 0xc04(%rip), %rdi       # 0x2031
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %r12, %rsp
xorl %eax, %eax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: luaopen__cqueues_condition
int luaopen__cqueues_condition(lua_State *L) {
	lua_pushnil(L); /* initial upvalue */
	cqs_newmetatable(L, CQS_CONDITION, cond_methods, cond_metatable, 1);
	lua_pushvalue(L, -1); /* push self as replacement upvalue */
	cqs_setmetaupvalue(L, -2, 1); /* insert self as 1st upvalue  */

	/* capture metatable here, too. */
	luaL_newlibtable(L, cond_globals);
	lua_pushvalue(L, -2);
	luaL_setfuncs(L, cond_globals, 1);

	return 1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xf980
leaq 0x24115(%rip), %rsi     # 0x35050
leaq 0x3304e(%rip), %rdx     # 0x43f90
leaq 0x330a7(%rip), %rcx     # 0x43ff0
movq %rbx, %rdi
movl $0x1, %r8d
callq 0x11015
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf9c0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf280
movl %eax, %ebp
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf9c0
movq %rbx, %rdi
movl %ebp, %esi
movl $0x1, %edx
callq 0x1191c
leaq 0x24191(%rip), %rdx     # 0x35127
movq %rbx, %rdi
movl %ebp, %esi
callq 0xf1e0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf9c0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl $0x1, %edx
callq 0x1191c
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x10640
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x10640
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x101e0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf9c0
leaq 0x33024(%rip), %rsi     # 0x44020
movq %rbx, %rdi
movl $0x1, %edx
callq 0x10240
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.h
// Function: cqs_newmetatable
static inline void cqs_newmetatable(lua_State *L, const char *name, const luaL_Reg *methods, const luaL_Reg *metamethods, int nup) {
	int i;

	luaL_newmetatable(L, name);
	for (i = 0; i < nup; i++) /* copy upvalues */
		lua_pushvalue(L, -nup - 1);
	luaL_setfuncs(L, metamethods, nup);

	lua_createtable(L, 0, cqs_regcount(methods));
	for (i = 0; i < nup; i++) /* copy upvalues */
		lua_pushvalue(L, -nup - 2);
	luaL_setfuncs(L, methods, nup);
	lua_setfield(L, -2, "__index");

	for (i = 0; i < nup; i++) /* remove the upvalues */
		lua_remove(L, -2);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebx
movq %rcx, %r12
movq %rdx, %r15
movq %rdi, %r14
callq 0x10180
testl %ebx, %ebx
jle 0x1104b
movl %ebx, %ebp
notl %ebp
movl %ebx, %r13d
movq %r14, %rdi
movl %ebp, %esi
callq 0xf9c0
decl %r13d
jne 0x1103c
movq %r14, %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0x10240
leaq 0x8(%r15), %rax
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
incl %edx
cmpq $0x0, (%rax)
leaq 0x10(%rax), %rax
jne 0x11061
movq %r14, %rdi
xorl %esi, %esi
callq 0x101e0
testl %ebx, %ebx
jle 0x11094
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
subl %ebx, %ebp
movl %ebx, %r12d
movq %r14, %rdi
movl %ebp, %esi
callq 0xf9c0
decl %r12d
jne 0x11085
movq %r14, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x10240
leaq 0x2407f(%rip), %rdx     # 0x35127
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf530
testl %ebx, %ebx
jle 0x110dc
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0xf0e0
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x10640
decl %ebx
jne 0x110b9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: cqs_sigmask
cqs_error_t cqs_sigmask(int how, const sigset_t *set, sigset_t *oset) {
	if (oset)
		sigemptyset(oset);

#if (defined _REENTRANT || defined _THREAD_SAFE) && _POSIX_THREADS > 0
	return pthread_sigmask(how, set, oset);
#else
	return sigprocmask(how, set, oset)? errno : 0;
#endif
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
testq %rdx, %rdx
je 0x11104
movq %rbx, %rdi
callq 0x10010
movl %ebp, %edi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %rbp
jmp 0xf350
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: cstack_self
static struct cstack *cstack_self(lua_State *L) {
	static const int index = 47;
	struct cstack *CS;

	lua_rawgetp(L, LUA_REGISTRYINDEX, CQS_UNIQUE_LIGHTUSERDATA_MASK(&index));

	CS = lua_touserdata(L, -1);

	lua_pop(L, 1);

	if (CS)
		return CS;

	CS = lua_newuserdata(L, sizeof *CS);
	memset(CS, 0, sizeof *CS);

	LIST_INIT(&CS->cqueues);

	lua_rawsetp(L, LUA_REGISTRYINDEX, CQS_UNIQUE_LIGHTUSERDATA_MASK(&index));

	return CS;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x243af(%rip), %rdx     # 0x35500
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0xf080
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x10350
movq %rax, %r14
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x10640
testq %r14, %r14
jne 0x111a7
movl $0x10, %esi
movq %rbx, %rdi
callq 0xfb00
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
leaq 0x24366(%rip), %rdx     # 0x35500
movq %rbx, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0xf160
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.h
// Function: cqs_requiref
static void cqs_requiref(lua_State *L, const char *modname, lua_CFunction openf, int glb) {
	luaL_getsubtable(L, LUA_REGISTRYINDEX, "_LOADED");
	lua_getfield(L, -1, modname);
	lua_remove(L, -2);

	if (lua_isnil(L, -1)) {
		lua_pop(L, 1);
		luaL_requiref(L, modname, openf, glb);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x23c8a(%rip), %rdx     # 0x35157
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x10430
movq %r15, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r14, %rdx
callq 0xf1e0
movq %r15, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0xf0e0
movq %r15, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x10640
movq %r15, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf260
testl %eax, %eax
je 0x1151d
popq %rbx
popq %r14
popq %r15
retq
movq %r15, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x10640
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
popq %rbx
popq %r14
popq %r15
jmp 0xfdb0
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: luaopen__cqueues_debug
int luaopen__cqueues_debug(lua_State *L) {
	luaL_newlib(L, dbg_globals);

	lua_pushinteger(L, INT_MAX);
	lua_setfield(L, -2, "INT_MAX");

	lua_pushinteger(L, LONG_MAX);
	lua_setfield(L, -2, "LONG_MAX");

	return 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movsd 0x23ab5(%rip), %xmm0    # 0x35000
movl $0x88, %esi
callq 0x10530
movq %rbx, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x101e0
leaq 0x367f5(%rip), %rsi     # 0x47d60
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10240
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq %rbx, %rdi
callq 0xf910
leaq 0x23b7b(%rip), %rdx     # 0x35104
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf530
movabsq $0x7fffffffffffffff, %rsi # imm = 0x7FFFFFFFFFFFFFFF
movq %rbx, %rdi
callq 0xf910
leaq 0x23b5d(%rip), %rdx     # 0x3510c
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf530
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: auxlib_tostring
static int auxlib_tostring(lua_State *L) {
	luaL_checkany(L, 1);

	if (luaL_getmetafield(L, 1, "__tostring")) {
		lua_insert(L, 1);
		lua_settop(L, 2);
		lua_callk(L, 1, 1, 0, &auxlib_tostringk);

		return auxlib_tostringk(L, LUA_OK, 0);
	} else {
		luaL_tolstring(L, 1, NULL);

		return 1;
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x1, %esi
callq 0x105d0
leaq 0x23b3d(%rip), %rdx     # 0x35115
movq %rbx, %rdi
movl $0x1, %esi
callq 0xfdc0
testl %eax, %eax
je 0x1162d
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0xf0e0
movq %rbx, %rdi
movl $0x2, %esi
callq 0x10640
leaq 0x34(%rip), %r8         # 0x11643
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0xf670
movq %rbx, %rdi
callq 0x11643
jmp 0x1163c
movq %rbx, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0xfcb0
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: auxlib_tostringk
LUA_KFUNCTION(auxlib_tostringk) {
	if (luaL_getmetafield(L, 1, "__tostring")) {
		lua_pushfstring(L, "%s: %p", luaL_typename(L, 1), lua_topointer(L, 1));
	} else {
		luaL_tolstring(L, 1, NULL);
	}

	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x23ac4(%rip), %rdx     # 0x35115
movl $0x1, %esi
callq 0xfdc0
testl %eax, %eax
je 0x1169f
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf260
movq %rbx, %rdi
movl %eax, %esi
callq 0xfa50
movq %rax, %r14
movq %rbx, %rdi
movl $0x1, %esi
callq 0x10080
leaq 0x23a93(%rip), %rsi     # 0x35120
movq %rbx, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xfff0
jmp 0x116ae
movq %rbx, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0xfcb0
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: cond_wait
static int cond_wait(lua_State *L) {
	cond_checkself(L, 1);

	lua_pushlightuserdata(L, CQUEUE__POLL);
	lua_insert(L, 1);

	return lua_yield(L, lua_gettop(L));
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x2398a(%rip), %rsi     # 0x35050
callq 0x11835
movq 0x3588e(%rip), %rsi     # 0x46f60
movq %rbx, %rdi
callq 0x10150
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0xf0e0
movq %rbx, %rdi
callq 0xf920
movq %rbx, %rdi
movl %eax, %esi
xorl %edx, %edx
xorl %ecx, %ecx
popq %rbx
jmp 0xf0b0
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: cond_signal
static int cond_signal(lua_State *L) {
	struct condition *cv = cond_checkself(L, 1);
	int i, n = luaL_optint(L, 2, INT_MAX);
	struct wakecb *cb;
	int error;

	for (i = 0; i < n && !TAILQ_EMPTY(&cv->waiting); i++) {
		cb = TAILQ_FIRST(&cv->waiting);
		wakecb_del(cb);

		if ((error = cb->fn(cb)))
			goto error;
	}

	lua_pushinteger(L, i);

	return 1;
error:
	lua_pushnil(L);
	lua_pushstring(L, cqs_strerror(error));
	lua_pushinteger(L, error);

	return 3;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
leaq 0x23932(%rip), %rsi     # 0x35050
callq 0x11835
movq %rax, %r15
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq %rbx, %rdi
movl $0x2, %esi
callq 0xf400
movq %rax, %r12
movl $0x1, %ebp
xorl %r14d, %r14d
testl %r12d, %r12d
jle 0x117ec
movq 0x8(%r15), %rdi
testq %rdi, %rdi
je 0x11797
movq (%rdi), %rax
testq %rax, %rax
je 0x11785
movq 0x28(%rdi), %rcx
movq 0x30(%rdi), %rdx
addq $0x10, %rax
leaq 0x30(%rcx), %rsi
testq %rcx, %rcx
cmoveq %rax, %rsi
movq %rdx, (%rsi)
movq 0x30(%rdi), %rax
movq %rcx, (%rax)
movq $0x0, (%rdi)
callq *0x8(%rdi)
testl %eax, %eax
jne 0x1179c
incl %r14d
cmpl %r14d, %r12d
jne 0x1174c
movl %r12d, %r14d
movl %r14d, %r14d
jmp 0x117ec
movl %eax, %r13d
movq %rbx, %rdi
callq 0xf980
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, 0x70(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
movl $0x80, %edx
movl %r13d, %edi
callq 0xf250
movq %rbx, %rdi
movq %rax, %rsi
callq 0xfbd0
movslq %r13d, %r14
movl $0x3, %ebp
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf910
movl %ebp, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.h
// Function: cqs_checkudata
static inline void *cqs_checkudata(lua_State *L, int index, int upvalue, const char *tname) {
	void *ud;

	if (!(ud = cqs_testudata(L, index, upvalue))) {
		index = lua_absindex(L, index);

		luaL_argerror(L, index, lua_pushfstring(L, "%s expected, got %s", tname, luaL_typename(L, index)));

		NOTREACHED;
	}

	return ud;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x1, %esi
callq 0x10350
testq %rax, %rax
je 0x11890
movq %rax, %r15
movq %r14, %rdi
movl $0x1, %esi
callq 0xf900
testl %eax, %eax
je 0x11890
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xfff0b9d7, %edx       # imm = 0xFFF0B9D7
callq 0xf6b0
movl %eax, %ebp
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x10640
xorl %eax, %eax
testl %ebp, %ebp
cmoveq %rax, %r15
jmp 0x11893
xorl %r15d, %r15d
testq %r15, %r15
je 0x118a6
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10a90
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.h
// Function: cqs_setfuncsupvalue
static inline void cqs_setfuncsupvalue(lua_State *L, int tindex, int n) {
	tindex = lua_absindex(L, tindex);

	lua_pushnil(L);
	while (lua_next(L, tindex)) {
		if (lua_iscfunction(L, -1)) {
			lua_pushvalue(L, -3);
			lua_setupvalue(L, -2, n);
		}

		lua_pop(L, 1); /* pop field value (leaving key) */
	}

	lua_pop(L, 1); /* pop upvalue */
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rdi, %r14
callq 0xf280
movl %eax, %ebp
movq %r14, %rdi
callq 0xf980
movq %r14, %rdi
movl %ebp, %esi
callq 0x10760
testl %eax, %eax
je 0x1197e
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf120
testl %eax, %eax
je 0x1196f
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0xf9c0
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl %ebx, %edx
callq 0xf370
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x10640
jmp 0x11934
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
popq %rbx
popq %r14
popq %rbp
jmp 0x10640
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: cond_new
static int cond_new(lua_State *L) {
	_Bool lifo = lua_toboolean(L, 1);
	struct condition *cv;

	cv = lua_newuserdata(L, sizeof *cv);
	cv->lifo = lifo;
	TAILQ_INIT(&cv->waiting);
	luaL_setmetatable(L, CQS_CONDITION);

	return 1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %esi
callq 0xf540
movl %eax, %ebp
movl $0x18, %esi
movq %rbx, %rdi
callq 0xfb00
testl %ebp, %ebp
setne (%rax)
leaq 0x8(%rax), %rcx
movq $0x0, 0x8(%rax)
movq %rcx, 0x10(%rax)
leaq 0x23686(%rip), %rsi     # 0x35050
movq %rbx, %rdi
callq 0x101f0
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: cond_type
static int cond_type(lua_State *L) {
	if (cond_testself(L, 1)) {
		lua_pushstring(L, "condition");
	} else {
		lua_pushnil(L);
	}

	return 1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %esi
callq 0x10350
testq %rax, %rax
je 0x11a3a
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf900
testl %eax, %eax
je 0x11a3a
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xfff0b9d7, %edx       # imm = 0xFFF0B9D7
callq 0xf6b0
movl %eax, %ebp
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x10640
testl %ebp, %ebp
je 0x11a3a
leaq 0x23652(%rip), %rsi     # 0x35082
movq %rbx, %rdi
callq 0xfbd0
jmp 0x11a42
movq %rbx, %rdi
callq 0xf980
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: cqueue_cancelfd
static cqs_error_t cqueue_cancelfd(struct cqueue *Q, int fd) {
	struct fileno *fileno;
	int error = 0, _error;

	if (!(fileno = fileno_find(Q, fd)))
		return 0;

	if ((_error = fileno_signal(Q, fileno, POLLIN|POLLOUT|POLLPRI)))
		error = _error;
	if ((_error = fileno_ctl(Q, fileno, 0)))
		error = _error;

	return error;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x1a0(%rdi), %rax
testq %rax, %rax
je 0x11b04
movl (%rax), %edx
movl $0x10, %ecx
cmpl %esi, %edx
jg 0x11af8
movl $0x18, %ecx
jne 0x11af8
xorl %ecx, %ecx
movq %rax, %r14
jmp 0x11afe
movq (%rax,%rcx), %rax
movb $0x1, %cl
testb %cl, %cl
jne 0x11ada
jmp 0x11b07
xorl %r14d, %r14d
testq %r14, %r14
je 0x11b2d
movq %rbx, %rdi
movq %r14, %rsi
movl $0x7, %edx
callq 0x11b35
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x11b95
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: fileno_signal
static cqs_error_t fileno_signal(struct cqueue *Q, struct fileno *fileno, short events) {
	struct event *event;
	int error = 0, _error;

	LIST_FOREACH(event, &fileno->events, fle) {
		/* XXX: If POLLPRI should we always mark as pending? */
		if (event->events & events)
			event->pending = 1;

		thread_move(event->thread, &Q->thread.pending);

		if ((_error = cqueue_tryalert(Q)))
			error = _error;
	}

	return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x8(%rsi), %r12
testq %r12, %r12
je 0x11b88
movl %edx, %ebx
movq %rdi, %r14
leaq 0x210(%rdi), %r15
xorl %ebp, %ebp
testw %bx, 0x4(%r12)
je 0x11b62
movb $0x1, 0x10(%r12)
movq 0x18(%r12), %rdi
movq %r15, %rsi
callq 0x11c11
movq %r14, %rdi
callq 0x11c4f
testl %eax, %eax
cmovnel %eax, %ebp
movq 0x38(%r12), %r12
testq %r12, %r12
jne 0x11b54
jmp 0x11b8a
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: fileno_ctl
static int fileno_ctl(struct cqueue *Q, struct fileno *fileno, short events) {
	int error;

	if ((error = kpoll_ctl(&Q->kp, fileno->fd, &fileno->state, events, fileno)))
		return error; /* XXX: Should we call fileno_signal? */

	LIST_REMOVE(fileno, le);

	if (fileno->state)
		LIST_INSERT_HEAD(&Q->fileno.polling, fileno, le);
	else
		LIST_INSERT_HEAD(&Q->fileno.inactive, fileno, le);

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ecx
movq %rsi, %rbx
movq %rdi, %r14
movl (%rsi), %esi
leaq 0x4(%rbx), %rdx
movq %rbx, %r8
callq 0x11d6c
testl %eax, %eax
jne 0x11c09
movq 0x30(%rbx), %rcx
testq %rcx, %rcx
je 0x11bc4
movq 0x38(%rbx), %rax
movq %rax, 0x38(%rcx)
leaq 0x30(%rbx), %rax
movq 0x38(%rbx), %rdx
movq %rcx, (%rdx)
cmpw $0x0, 0x4(%rbx)
je 0x11be6
movq 0x1a8(%r14), %rcx
addq $0x1a8, %r14            # imm = 0x1A8
jmp 0x11bf4
movq 0x1b8(%r14), %rcx
addq $0x1b8, %r14            # imm = 0x1B8
movq %rcx, (%rax)
testq %rcx, %rcx
je 0x11c00
movq %rax, 0x38(%rcx)
movq %rbx, (%r14)
movq %r14, 0x38(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: thread_move
static void thread_move(struct thread *T, struct threads *list) {
	if (T->threads != list) {
		LIST_REMOVE(T, le);
		LIST_INSERT_HEAD(list, T, le);
		T->threads = list;
	}
}

// Assembly:
cmpq %rsi, 0x20(%rdi)
je 0x11c4e
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x11c28
movq 0x30(%rdi), %rcx
movq %rcx, 0x30(%rax)
movq 0x30(%rdi), %rcx
movq %rax, (%rcx)
movq (%rsi), %rax
movq %rax, 0x28(%rdi)
testq %rax, %rax
je 0x11c43
leaq 0x28(%rdi), %rcx
movq %rcx, 0x30(%rax)
movq %rdi, (%rsi)
movq %rsi, 0x30(%rdi)
movq %rsi, 0x20(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: cqueue_tryalert
static cqs_error_t cqueue_tryalert(struct cqueue *Q) {
	if (!cstack_isrunning(Q->cstack, Q) || LIST_EMPTY(&Q->thread.pending)) {
		return kpoll_alert(&Q->kp);
	} else {
		return 0;
	}
}

// Assembly:
movq 0x230(%rdi), %rax
movq 0x8(%rax), %rax
testq %rax, %rax
setne %cl
je 0x11c6d
cmpq %rdi, (%rax)
je 0x11c6d
movq 0x20(%rax), %rax
jmp 0x11c5a
testb %cl, %cl
je 0x11c7e
cmpq $0x0, 0x210(%rdi)
je 0x11c7e
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: kpoll_alert
static int kpoll_alert(struct kpoll *kp) {
	int error;

	if (kp->alert.pending)
		return 0;

	/* initialization may have been delayed */
	if ((error = alert_init(kp)))
		return error;
#if ENABLE_PORTS
	if (0 != port_send(kp->fd, POLLIN, &kp->alert)) {
		if (errno != EBUSY)
			return errno;
	}
#elif HAVE_EVENTFD
	static const uint64_t one = 1;

	while (-1 == write(kp->alert.fd[0], &one, sizeof one)) {
		if (errno == EAGAIN) {
			break;
		} else if (errno != EINTR) {
			return errno;
		}
	}
#else
	while (-1 == write(kp->alert.fd[1], "!", 1)) {
		if (errno == EAGAIN) {
			break;
		} else if (errno != EINTR) {
			return errno;
		}
	}
#endif
	if ((error = alert_rearm(kp)))
		return error;

	kp->alert.pending = 1;

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
xorl %ebx, %ebx
cmpl $0x0, 0x19c(%rdi)
jne 0x11cf6
movq %rdi, %r14
callq 0x11d11
testl %eax, %eax
jne 0x11cf4
leaq 0x190(%r14), %r15
leaq 0x2384d(%rip), %r12     # 0x354f8
movl (%r15), %edi
movl $0x8, %edx
movq %r12, %rsi
callq 0xf4a0
cmpq $-0x1, %rax
jne 0x11cd2
callq 0xf0a0
movl (%rax), %eax
cmpl $0x4, %eax
je 0x11cab
cmpl $0xb, %eax
jne 0x11cf4
movl 0x190(%r14), %esi
leaq 0x198(%r14), %rdx
movq %r14, %rdi
movl $0x1, %ecx
movq %r15, %r8
callq 0x11d6c
testl %eax, %eax
je 0x11d04
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0x1, 0x19c(%r14)
jmp 0x11cf6
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: alert_init
static int alert_init(struct kpoll *kp) {
#if ENABLE_PORTS
	(void)kp;
	return 0;
#elif HAVE_EVENTFD
	if (kp->alert.fd[0] != -1)
		return 0;

	if (-1 == (kp->alert.fd[0] = eventfd(0, O_CLOEXEC|O_NONBLOCK)))
		return errno;

	return alert_rearm(kp);
#else
	int error;

	if (kp->alert.fd[0] != -1)
		return 0;

	if ((error = cqs_pipe(kp->alert.fd, O_CLOEXEC|O_NONBLOCK)))
		return error;

	return alert_rearm(kp);
#endif
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
xorl %eax, %eax
cmpl $-0x1, 0x190(%rdi)
je 0x11d28
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rdi, %rbx
leaq 0x190(%rdi), %r14
xorl %edi, %edi
movl $0x80800, %esi          # imm = 0x80800
callq 0xffe0
movl %eax, (%r14)
cmpl $-0x1, %eax
je 0x11d63
leaq 0x198(%rbx), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl $0x1, %ecx
movq %r14, %r8
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x11d6c
callq 0xf0a0
movl (%rax), %eax
jmp 0x11d20
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: cqueue_attach
static int cqueue_attach(lua_State *L) {
	struct callinfo I;
	struct cqueue *Q;
	int error;

	lua_settop(L, 2);

	Q = cqueue_enter(L, &I, 1);
	luaL_checktype(L, 2, LUA_TTHREAD);

	thread_add(L, Q, &I, 2);

	if ((error = cqueue_tryalert(Q)))
		goto error;

	lua_pushvalue(L, 1); /* return self */

	return 1;
error:
	lua_pushnil(L);
	lua_pushstring(L, cqs_strerror(error));
	lua_pushinteger(L, error);

	return 3;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rbx
movl $0x2, %esi
callq 0x10640
movq %rbx, %rdi
callq 0x12e12
movq %rax, %r14
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf280
leaq 0x8(%rsp), %r15
movl %eax, (%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%r15)
movl $0xffffffff, 0x14(%r15) # imm = 0xFFFFFFFF
movq %rbx, %rdi
movl $0x2, %esi
movl $0x8, %edx
callq 0xf6c0
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movl $0x2, %ecx
callq 0x14bd7
movq %r14, %rdi
callq 0x11c4f
testl %eax, %eax
je 0x1234e
movl %eax, %r14d
movq %rbx, %rdi
callq 0xf980
leaq 0x20(%rsp), %rsi
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
movl $0x80, %edx
movl %r14d, %edi
callq 0xf250
movq %rbx, %rdi
movq %rax, %rsi
callq 0xfbd0
movslq %r14d, %rsi
movq %rbx, %rdi
callq 0xf910
movl $0x3, %ebp
jmp 0x1235b
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf9c0
movl %ebp, %eax
addq $0xa8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: cqueue_wrap
static int cqueue_wrap(lua_State *L) {
	struct callinfo I;
	struct cqueue *Q;
	struct lua_State *newL;
	int top, error;

	top = lua_gettop(L);

	Q = cqueue_enter(L, &I, 1);
	luaL_checktype(L, 2, LUA_TFUNCTION);

	newL = lua_newthread(L);
	lua_insert(L, 2);
	luaL_checkstack(newL, top - 1, "too many arguments");
	lua_xmove(L, newL, top - 1);

	thread_add(L, Q, &I, -1);

	if ((error = cqueue_tryalert(Q)))
		goto error;

	lua_pushvalue(L, 1); /* return self */

	return 1;
error:
	lua_pushnil(L);
	lua_pushstring(L, cqs_strerror(error));
	lua_pushinteger(L, error);

	return 3;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rbx
callq 0xf920
movl %eax, %r15d
movq %rbx, %rdi
callq 0x12e12
movq %rax, %r14
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf280
leaq 0x8(%rsp), %r12
movl %eax, (%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%r12)
movl $0xffffffff, 0x14(%r12) # imm = 0xFFFFFFFF
movq %rbx, %rdi
movl $0x2, %esi
movl $0x6, %edx
callq 0xf6c0
movq %rbx, %rdi
callq 0x10a40
movq %rax, %r13
movq %rbx, %rdi
movl $0x2, %esi
movl $0x1, %edx
callq 0xf0e0
decl %r15d
leaq 0x22d67(%rip), %rdx     # 0x3515f
movq %r13, %rdi
movl %r15d, %esi
callq 0xfca0
movq %rbx, %rdi
movq %r13, %rsi
movl %r15d, %edx
callq 0x10230
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x14bd7
movq %r14, %rdi
callq 0x11c4f
testl %eax, %eax
je 0x1248c
movl %eax, %r14d
movq %rbx, %rdi
callq 0xf980
leaq 0x20(%rsp), %rsi
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
movl $0x80, %edx
movl %r14d, %edi
callq 0xf250
movq %rbx, %rdi
movq %rax, %rsi
callq 0xfbd0
movslq %r14d, %rsi
movq %rbx, %rdi
callq 0xf910
movl $0x3, %ebp
jmp 0x12499
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf9c0
movl %ebp, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: cqueue_alert
static int cqueue_alert(lua_State *L) {
	struct cqueue *Q = cqueue_checkself(L, 1);
	int error;

	if ((error = kpoll_alert(&Q->kp)))
		goto error;

	lua_pushvalue(L, 1);

	return 1;
error:
	lua_pushnil(L);
	lua_pushstring(L, cqs_strerror(error));
	lua_pushinteger(L, error);

	return 3;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
callq 0x12e12
movq %rax, %rdi
callq 0x11c7e
testl %eax, %eax
je 0x12522
movl %eax, %ebp
movq %rbx, %rdi
callq 0xf980
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, 0x70(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
movl $0x80, %edx
movl %ebp, %edi
callq 0xf250
movq %rbx, %rdi
movq %rax, %rsi
callq 0xfbd0
movslq %ebp, %rsi
movq %rbx, %rdi
callq 0xf910
movl $0x3, %ebp
jmp 0x12534
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf9c0
movl %ebp, %eax
addq $0x88, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: cqueue_cancel
static int cqueue_cancel(lua_State *L) {
	struct callinfo I;
	int top = lua_gettop(L);
	struct cqueue *Q = cqueue_enter(L, &I, 1);
	int index;

	for (index = 2; index <= top; index++)
		cqueue_cancelfd(Q, cqueue_checkfd(L, &I, index));

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
callq 0xf920
movl %eax, %r14d
movq %rbx, %rdi
callq 0x12e12
movq %rax, %r15
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf280
movl %eax, 0x8(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0xc(%rsp)
movl $0xffffffff, 0x1c(%rsp) # imm = 0xFFFFFFFF
cmpl $0x2, %r14d
jl 0x12606
negl %r14d
movl $0x2, %r13d
leaq 0x8(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
movl %r13d, %edx
callq 0x14cd9
movq %r15, %rdi
movl %eax, %esi
callq 0x11acc
leal (%r14,%r13), %eax
incl %eax
movl %r13d, %ecx
incl %ecx
movl %ecx, %r13d
cmpl $0x1, %eax
jne 0x125db
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: cqueue_reset
static int cqueue_reset(lua_State *L) {
	struct cqueue *Q = cqueue_checkself(L, 1);
	int error;

	if ((error = cqueue_reboot(Q, 1, 1)))
		return luaL_error(L, "unable to reset continuation queue: %s", cqs_strerror(error));

	return 0;
}

// Assembly:
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
callq 0x12e12
movq %rax, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x14d88
testl %eax, %eax
jne 0x12647
xorl %eax, %eax
addq $0x80, %rsp
popq %rbx
retq
movq %rsp, %rdi
movl %eax, %esi
movq %rbx, %rdx
callq 0x10adc
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: cqueue_timeout
static int cqueue_timeout(lua_State *L) {
	struct cqueue *Q = cqueue_checkself(L, 1);

	if (!LIST_EMPTY(&Q->thread.pending)) {
		lua_pushnumber(L, 0.0);
	} else {
		double timeout = cqueue_timeout_(Q);

		if (isfinite(timeout))
			lua_pushnumber(L, timeout);
		else
			lua_pushnil(L);
	}

	return 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x12e12
cmpq $0x0, 0x210(%rax)
je 0x1291f
pxor %xmm0, %xmm0
jmp 0x1294a
movq %rax, %rdi
callq 0x129e2
movq %xmm0, %rax
btrq $0x3f, %rax
movabsq $0x7fefffffffffffff, %rcx # imm = 0x7FEFFFFFFFFFFFFF
cmpq %rcx, %rax
jle 0x1294a
movq %rbx, %rdi
callq 0xf980
jmp 0x12952
movq %rbx, %rdi
callq 0xf2c0
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: cqueue_close
static int cqueue_close(lua_State *L) {
	struct cqueue *Q = cqs_checkudata(L, 1, 1, CQUEUE_CLASS);
	struct callinfo I;

	/* disallow :close when invoked from a thread resumed by cqueue_step */
	luaL_argcheck(L, !Q->cstack || !cstack_isrunning(Q->cstack, Q), 1, "cqueue running");

	cqueue_enter_nothrow(L, &I, 1, Q);
	cqueue_destroy(L, Q, &I);

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x22722(%rip), %rsi     # 0x3508c
callq 0x11835
movq %rax, %r14
movq 0x230(%rax), %rax
testq %rax, %rax
je 0x129ad
movq 0x8(%rax), %rax
testq %rax, %rax
setne %cl
je 0x12995
cmpq %r14, (%rax)
je 0x12995
movq 0x20(%rax), %rax
jmp 0x12982
testb %cl, %cl
je 0x129ad
leaq 0x22b0e(%rip), %rdx     # 0x354ae
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf3f0
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf280
movq %rsp, %rdx
movl %eax, (%rdx)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rdx)
movl $0xffffffff, 0x14(%rdx) # imm = 0xFFFFFFFF
movq %rbx, %rdi
movq %r14, %rsi
callq 0x14f2b
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: cqueue_timeout_
static double cqueue_timeout_(struct cqueue *Q) {
	struct timer *timer;
	double curtime;

	if (!(timer = LLRB_MIN(timers, &Q->timers)))
		return NAN;

	curtime = monotime();

	return (islessequal(timer->timeout, curtime))? 0.0 : timer->timeout - curtime;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq 0x228(%rdi), %rax
movsd 0x22610(%rip), %xmm0    # 0x35008
testq %rax, %rax
je 0x12a50
movq %rax, %r14
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0x129f8
testq %r14, %r14
je 0x12a50
leaq 0x8(%rsp), %rbx
movl $0x1, %edi
movq %rbx, %rsi
callq 0xfbf0
xorps %xmm0, %xmm0
cvtsi2sdq (%rbx), %xmm0
cvtsi2sdq 0x8(%rbx), %xmm1
divsd 0x225ea(%rip), %xmm1    # 0x35020
addsd %xmm0, %xmm1
movsd (%r14), %xmm0
movapd %xmm0, %xmm2
subsd %xmm1, %xmm2
cmpnlesd %xmm1, %xmm0
andpd %xmm2, %xmm0
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: err_setfstring
static void err_setfstring(lua_State *L, struct callinfo *I, const char *fmt, ...) {
	va_list ap;

	va_start(ap, fmt);
	err_setvfstring(L, I, fmt, ap);
	va_end(ap);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rsp), %rsi
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x12ab4
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rax
movq %rsi, 0x10(%rax)
leaq 0xf0(%rsp), %rcx
movq %rcx, 0x8(%rax)
movabsq $0x3000000018, %rcx     # imm = 0x3000000018
movq %rcx, (%rax)
movq %rdx, %rsi
movq %rax, %rdx
callq 0x10600
movq %r14, %rdi
callq 0xf920
movl %eax, 0x4(%rbx)
addq $0xd8, %rsp
popq %rbx
popq %r14
retq