LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 $0x178, %rsp            # imm = 0x178
movq %rsp, %r12
leaq 0x2a56(%rip), %rdx      # 0x3d80
leaq 0x10(%rsp), %rbx
movl $0xbebc200, %esi        # imm = 0xBEBC200
movq %rbx, %rdi
callq 0x142c
leaq 0xd0a(%rip), %rdi       # 0x204d
callq 0x1040
leaq -0x14f(%rip), %rsi      # 0x1200
movq %rsp, %rdi
movq %rbx, %rdx
callq 0x1413
leaq 0x8(%rsp), %r14
leaq -0xe5(%rip), %rsi       # 0x1281
movq %r14, %rdi
movq %rbx, %rdx
callq 0x1413
pushq $0x1
popq %rdi
callq 0x10e0
rdtscp
shlq $0x20, %rdx
orq %rdx, %rax
movq %rax, %r15
movl $0x1, 0x2d04(%rip)      # 0x4094
movq -0x8(%r14), %rdi
callq 0x1420
movq (%r14), %rdi
callq 0x1420
rdtscp
shlq $0x20, %rdx
orq %rdx, %rax
subq %r15, %rax
movl $0x17d78400, %ecx       # imm = 0x17D78400
xorl %edx, %edx
divq %rcx
leaq 0xc61(%rip), %rdi       # 0x2020
movq %rax, %rsi
xorl %eax, %eax
callq 0x1060
movq 0x48(%rbx), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x13e1
leaq 0xc8f(%rip), %rdi       # 0x206b
callq 0x1040
leaq 0x10(%rsp), %rdi
callq 0x1503
testl %eax, %eax
je 0x13ff
leaq 0xc3b(%rip), %rdi       # 0x2031
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movq %r12, %rsp
xorl %eax, %eax
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xf9d0
leaq 0x1f3d1(%rip), %rsi     # 0x30050
leaq 0x312fa(%rip), %rdx     # 0x41f80
leaq 0x31353(%rip), %rcx     # 0x41fe0
pushq $0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %r8d
callq 0x10ce2
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xfa10
movq %rbx, %rdi
movl %ebp, %esi
callq 0x10dbc
pushq $0x3
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10270
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0xfa10
leaq 0x31341(%rip), %rsi     # 0x42010
movq %rbx, %rdi
movl %ebp, %edx
callq 0x102d0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, %ebp
movq %rcx, %r15
movq %rdx, (%rsp)
movq %rdi, %rbx
callq 0x10210
movl %ebp, %r12d
notl %r12d
xorl %r14d, %r14d
testl %ebp, %ebp
cmovgl %ebp, %r14d
movl %r14d, %r13d
movq %rbx, %rdi
subl $0x1, %r13d
jb 0x10d24
movl %r12d, %esi
callq 0xfa10
jmp 0x10d11
movq %r15, %rsi
movl %ebp, %edx
callq 0x102d0
movq (%rsp), %r13
leaq 0x8(%r13), %rax
pushq $-0x1
popq %rdx
incl %edx
cmpq $0x0, (%rax)
leaq 0x10(%rax), %rax
jne 0x10d39
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10270
pushq $-0x2
popq %r15
subl %ebp, %r15d
movl %r14d, %r12d
movq %rbx, %rdi
subl $0x1, %r12d
jb 0x10d6c
movl %r15d, %esi
callq 0xfa10
jmp 0x10d59
movq %r13, %rsi
movl %ebp, %edx
callq 0x102d0
leaq 0x1f3aa(%rip), %rdx     # 0x30127
pushq $-0x2
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0xf550
pushq $-0x1
popq %r15
subl $0x1, %r14d
jb 0x10dad
movq %rbx, %rdi
movl %ebp, %esi
movl %r15d, %edx
callq 0xf0e0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x106f0
jmp 0x10d8e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/cqueues.h
// Function: cqs_setmetaupvalue
static inline void cqs_setmetaupvalue(lua_State *L, int tindex, int n) {
	tindex = lua_absindex(L, tindex);

	lua_pushvalue(L, -1);
	cqs_setfuncsupvalue(L, tindex, n);

	lua_getfield(L, tindex, "__index");
	lua_pushvalue(L, -2);
	cqs_setfuncsupvalue(L, -2, n);
	lua_pop(L, 1); /* pop __index */

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
pushq $-0x2
popq %rbp
movl %ebp, %esi
callq 0xf290
movl %eax, %r15d
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xfa10
movq %rbx, %rdi
movl %r15d, %esi
movl %r14d, %edx
callq 0x1152c
leaq 0x1f331(%rip), %rdx     # 0x30127
movq %rbx, %rdi
movl %r15d, %esi
callq 0xf1f0
movq %rbx, %rdi
movl %ebp, %esi
callq 0xfa10
movq %rbx, %rdi
movl %ebp, %esi
movl %r14d, %edx
callq 0x1152c
movq %rbx, %rdi
movl %ebp, %esi
callq 0x106f0
movq %rbx, %rdi
movl %ebp, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x106f0
// File: /workspace/github_c_makefile_star2_O2/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 0x10e4f
movq %rbx, %rdi
callq 0x100a0
movl %ebp, %edi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %rbp
jmp 0xf360
// File: /workspace/github_c_makefile_star2_O2/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 0x1f656(%rip), %rdx     # 0x30500
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0xf080
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0x103f0
movq %rax, %r14
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x106f0
testq %r14, %r14
jne 0x10efa
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0xfb70
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
leaq 0x1f613(%rip), %rdx     # 0x30500
movq %rbx, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0xf170
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x1f074(%rip), %rdx     # 0x30157
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x104e0
pushq $-0x1
popq %rbp
movq %r15, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0xf1f0
pushq $-0x2
popq %r12
movq %r15, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0xf0e0
movq %r15, %rdi
movl %r12d, %esi
callq 0x106f0
movq %r15, %rdi
movl %ebp, %esi
callq 0xf270
testl %eax, %eax
je 0x11130
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x2
popq %rsi
movq %r15, %rdi
callq 0x106f0
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xfe40
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movsd 0x1ee9f(%rip), %xmm0    # 0x30000
movl $0x88, %esi
callq 0x105e0
pushq $0x2
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10270
leaq 0x34c51(%rip), %rsi     # 0x45dd0
movq %rbx, %rdi
xorl %edx, %edx
callq 0x102d0
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq %rbx, %rdi
callq 0xf960
leaq 0x1ef67(%rip), %rdx     # 0x30104
pushq $-0x2
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0xf550
movabsq $0x7fffffffffffffff, %rsi # imm = 0x7FFFFFFFFFFFFFFF
movq %rbx, %rdi
callq 0xf960
leaq 0x1ef49(%rip), %rdx     # 0x3010c
movq %rbx, %rdi
movl %ebp, %esi
callq 0xf550
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x1
popq %rbp
movl %ebp, %esi
callq 0x10680
leaq 0x1ef27(%rip), %rdx     # 0x30115
movq %rbx, %rdi
movl %ebp, %esi
callq 0xfe50
testl %eax, %eax
je 0x11235
pushq $0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
movl %ebp, %edx
callq 0xf0e0
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x106f0
leaq 0x2f(%rip), %r8         # 0x1124c
movq %rbx, %rdi
movl %ebp, %esi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0xf6b0
movq %rbx, %rdi
callq 0x1124c
jmp 0x11242
pushq $0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0xfd40
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x1eebb(%rip), %rdx     # 0x30115
pushq $0x1
popq %rsi
callq 0xfe50
testl %eax, %eax
je 0x112a3
pushq $0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0xf270
movq %rbx, %rdi
movl %eax, %esi
callq 0xfac0
movq %rax, %r14
movq %rbx, %rdi
movl %ebp, %esi
callq 0x10110
leaq 0x1ee8f(%rip), %rsi     # 0x30120
movq %rbx, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x10080
jmp 0x112b0
pushq $0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0xfd40
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
callq 0x113f3
movq 0x33c98(%rip), %rsi     # 0x44f60
movq %rbx, %rdi
callq 0x101e0
pushq $0x1
popq %rdx
movq %rbx, %rdi
movl %edx, %esi
callq 0xf0e0
movq %rbx, %rdi
callq 0xf970
movq %rbx, %rdi
movl %eax, %esi
xorl %edx, %edx
xorl %ecx, %ecx
popq %rbx
jmp 0xf0b0
// File: /workspace/github_c_makefile_star2_O2/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
callq 0x113f3
movq %rax, %r14
pushq $0x2
popq %rsi
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq %rbx, %rdi
callq 0xf420
movq %rax, %r15
xorl %r13d, %r13d
testl %r15d, %r15d
cmovlel %r13d, %r15d
cmpl %r13d, %r15d
je 0x11357
movq 0x8(%r14), %r12
testq %r12, %r12
je 0x11354
movq %r12, %rdi
callq 0x114c3
movq %r12, %rdi
callq *0x8(%r12)
testl %eax, %eax
jne 0x11366
incl %r13d
jmp 0x1132d
movl %r13d, %r15d
movl %r15d, %esi
movq %rbx, %rdi
callq 0xf960
pushq $0x1
jmp 0x113b9
movl %eax, %ebp
movq %rbx, %rdi
callq 0xf9d0
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 0xf260
movq %rbx, %rdi
movq %rax, %rsi
callq 0xfc50
movslq %ebp, %rsi
movq %rbx, %rdi
callq 0xf960
pushq $0x3
popq %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x1
popq %rdx
movl %edx, %esi
callq 0x1145f
testq %rax, %rax
je 0x1141a
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xf290
movl %eax, %ebp
movq %rbx, %rdi
movl %eax, %esi
callq 0xf270
movq %rbx, %rdi
movl %eax, %esi
callq 0xfac0
leaq 0x1ef10(%rip), %rsi     # 0x30352
movq %rbx, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x10080
movq %rbx, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0xf410
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/cqueues.h
// Function: cqs_testudata
static inline void *cqs_testudata(lua_State *L, int index, int upvalue) {
	void *ud = lua_touserdata(L, index);
	int eq;

	if (!ud || !lua_getmetatable(L, index))
		return NULL;

	eq = lua_rawequal(L, -1, lua_upvalueindex(upvalue));
	lua_pop(L, 1);

	return (eq)? ud : NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %r14
callq 0x103f0
testq %rax, %rax
je 0x114b3
movq %rax, %rbx
movq %r14, %rdi
movl %r15d, %esi
callq 0xf950
testl %eax, %eax
je 0x114b3
movl $0xfff0b9d8, %edx       # imm = 0xFFF0B9D8
subl %ebp, %edx
pushq $-0x1
popq %rsi
movq %r14, %rdi
callq 0xf6f0
movl %eax, %ebp
pushq $-0x2
popq %rsi
movq %r14, %rdi
callq 0x106f0
xorl %eax, %eax
testl %ebp, %ebp
cmoveq %rax, %rbx
jmp 0x114b5
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rdi, %rbx
callq 0xf290
movl %eax, %r14d
movq %rbx, %rdi
callq 0xf9d0
pushq $-0x1
popq %r15
pushq $-0x2
popq %r12
pushq $-0x3
popq %r13
movq %rbx, %rdi
movl %r14d, %esi
callq 0x10820
testl %eax, %eax
je 0x1159b
movq %rbx, %rdi
movl %r15d, %esi
callq 0xf130
testl %eax, %eax
je 0x1158e
movq %rbx, %rdi
movl %r13d, %esi
callq 0xfa10
movq %rbx, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0xf380
movq %rbx, %rdi
movl %r12d, %esi
callq 0x106f0
jmp 0x11558
pushq $-0x2
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x106f0
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rbp
movl %ebp, %esi
callq 0xf560
movl %eax, %r14d
pushq $0x18
popq %rsi
movq %rbx, %rdi
callq 0xfb70
testl %r14d, %r14d
setne (%rax)
leaq 0x8(%rax), %rcx
andq $0x0, 0x8(%rax)
movq %rcx, 0x10(%rax)
leaq 0x1ea63(%rip), %rsi     # 0x30050
movq %rbx, %rdi
callq 0x10280
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movq %rdi, %rbx
pushq $0x1
popq %rdx
movl %edx, %esi
callq 0x1145f
testq %rax, %rax
je 0x11620
leaq 0x1ea6c(%rip), %rsi     # 0x30082
movq %rbx, %rdi
callq 0xfc50
jmp 0x11628
movq %rbx, %rdi
callq 0xf9d0
pushq $0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/cqueues.h
// Function: cqs_interpose
static inline int cqs_interpose(lua_State *L, const char *mt) {
	lua_settop(L, 2);

	luaL_getmetatable(L, mt);
	lua_getfield(L, -1, "__index");

	lua_pushvalue(L, 1); /* push method name */
	lua_gettable(L, -2);  /* push old method */

	lua_pushvalue(L, 1); /* push method name */
	lua_pushvalue(L, 2); /* push new method */
	lua_settable(L, -4);  /* replace old method */

	return 1; /* return old method */
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x2
popq %rbp
movl %ebp, %esi
callq 0x106f0
movq %rbx, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
movq %r14, %rdx
callq 0xf1f0
leaq 0x1eabd(%rip), %rdx     # 0x30127
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0xf1f0
pushq $0x1
popq %r14
movq %rbx, %rdi
movl %r14d, %esi
callq 0xfa10
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x109b0
movq %rbx, %rdi
movl %r14d, %esi
callq 0xfa10
movq %rbx, %rdi
movl %ebp, %esi
callq 0xfa10
pushq $-0x4
popq %rsi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x102f0
// File: /workspace/github_c_makefile_star2_O2/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
callq 0x116f1
testq %rax, %rax
je 0x116e9
movq %rax, %r14
pushq $0x7
popq %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1171a
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x11775
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
addq $0x8, %r14
leaq 0x210(%rdi), %r12
xorl %ebp, %ebp
movq (%r14), %r14
testq %r14, %r14
je 0x1176a
testw %bx, 0x4(%r14)
je 0x1174b
movb $0x1, 0x10(%r14)
movq 0x18(%r14), %rdi
movq %r12, %rsi
callq 0x117eb
movq %r15, %rdi
callq 0x11825
testl %eax, %eax
cmovnel %eax, %ebp
addq $0x38, %r14
jmp 0x11737
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x11938
testl %eax, %eax
jne 0x117e3
movq 0x30(%rbx), %rdx
movq 0x38(%rbx), %rsi
testq %rdx, %rdx
je 0x117a4
movq %rsi, 0x38(%rdx)
leaq 0x30(%rbx), %rcx
movq %rdx, (%rsi)
cmpw $0x0, 0x4(%rbx)
je 0x117c2
movq 0x1a8(%r14), %rdx
addq $0x1a8, %r14            # imm = 0x1A8
jmp 0x117d0
movq 0x1b8(%r14), %rdx
addq $0x1b8, %r14            # imm = 0x1B8
movq %rdx, (%rcx)
testq %rdx, %rdx
je 0x117dc
movq %rcx, 0x38(%rdx)
movq %rbx, (%r14)
movq %r14, 0x38(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x11824
movq 0x28(%rdi), %rax
movq 0x30(%rdi), %rcx
testq %rax, %rax
je 0x11802
movq %rcx, 0x30(%rax)
movq %rax, (%rcx)
movq (%rsi), %rax
movq %rax, 0x28(%rdi)
testq %rax, %rax
je 0x11819
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_O2/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:
pushq %rbx
movq %rdi, %rbx
movq 0x230(%rdi), %rdi
movq %rbx, %rsi
callq 0x11850
testb %al, %al
je 0x1184a
cmpq $0x0, 0x210(%rbx)
je 0x1184a
xorl %eax, %eax
popq %rbx
retq
movq %rbx, %rdi
popq %rbx
jmp 0x1186c
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/cqueues.c
// Function: cstack_isrunning
static _Bool cstack_isrunning(const struct cstack *CS, const struct cqueue *Q) {
	struct stackinfo *info;

	for (info = CS->running; info; info = info->running) {
		if (info->Q == Q)
			return 1;
	}

	return 0;
}

// Assembly:
addq $0x8, %rdi
movq (%rdi), %rax
testq %rax, %rax
je 0x11865
leaq 0x20(%rax), %rdi
cmpq %rsi, (%rax)
jne 0x11854
testq %rax, %rax
setne %al
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x118cd
movq %rdi, %r14
callq 0x118e8
testl %eax, %eax
jne 0x118cb
leaq 0x1ec66(%rip), %r15     # 0x304f8
pushq $0x8
popq %r12
movl 0x190(%r14), %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0xf4c0
cmpq $-0x1, %rax
jne 0x118bf
callq 0xf0a0
movl (%rax), %eax
cmpl $0x4, %eax
je 0x11896
cmpl $0xb, %eax
jne 0x118cb
movq %r14, %rdi
callq 0x1191f
testl %eax, %eax
je 0x118db
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0x1, 0x19c(%r14)
jmp 0x118cd
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x2
popq %rbp
movl %ebp, %esi
callq 0x106f0
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x122cf
movq %rax, %r15
pushq $0x8
popq %rdx
movq %rbx, %rdi
movl %ebp, %esi
callq 0xf700
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x13edd
movq %r15, %rdi
callq 0x11825
testl %eax, %eax
je 0x11dbd
movl %eax, %ebp
movq %rbx, %rdi
callq 0xf9d0
xorps %xmm0, %xmm0
leaq 0x20(%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 0xf260
movq %rbx, %rdi
movq %rax, %rsi
callq 0xfc50
movslq %ebp, %rsi
movq %rbx, %rdi
callq 0xf960
pushq $0x3
popq %rbp
jmp 0x11dca
pushq $0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0xfa10
movl %ebp, %eax
addq $0xa8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xf970
movl %eax, %r12d
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x122cf
movq %rax, %r15
pushq $0x2
popq %r13
pushq $0x6
popq %rdx
movq %rbx, %rdi
movl %r13d, %esi
callq 0xf700
movq %rbx, %rdi
callq 0x10b20
movq %rax, %r14
pushq $0x1
popq %rbp
movq %rbx, %rdi
movl %r13d, %esi
movl %ebp, %edx
callq 0xf0e0
decl %r12d
leaq 0x1e322(%rip), %rdx     # 0x3015f
movq %r14, %rdi
movl %r12d, %esi
callq 0xfd30
movq %rbx, %rdi
movq %r14, %rsi
movl %r12d, %edx
callq 0x102c0
pushq $-0x1
popq %rcx
movq %rbx, %rdi
movq %r15, %rsi
leaq 0x8(%rsp), %rdx
callq 0x13edd
movq %r15, %rdi
callq 0x11825
testl %eax, %eax
je 0x11ecf
movl %eax, %r14d
movq %rbx, %rdi
callq 0xf9d0
xorps %xmm0, %xmm0
leaq 0x20(%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 %r14d, %edi
callq 0xf260
movq %rbx, %rdi
movq %rax, %rsi
callq 0xfc50
movslq %r14d, %rsi
movq %rbx, %rdi
callq 0xf960
pushq $0x3
popq %rbp
jmp 0x11ed9
movq %rbx, %rdi
movl %ebp, %esi
callq 0xfa10
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_O2/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 0x12701
movq %rax, %rdi
callq 0x1186c
testl %eax, %eax
je 0x11f60
movl %eax, %ebp
movq %rbx, %rdi
callq 0xf9d0
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 0xf260
movq %rbx, %rdi
movq %rax, %rsi
callq 0xfc50
movslq %ebp, %rsi
movq %rbx, %rdi
callq 0xf960
pushq $0x3
popq %rbp
jmp 0x11f6d
pushq $0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0xfa10
movl %ebp, %eax
addq $0x88, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
callq 0xf970
movl %eax, %ebp
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x122cf
movq %rax, %r15
pushq $0x2
popq %r12
cmpl %ebp, %r12d
jg 0x12007
movq %rbx, %rdi
movq %r14, %rsi
movl %r12d, %edx
callq 0x13fdf
movq %r15, %rdi
movl %eax, %esi
callq 0x116b3
incl %r12d
jmp 0x11fe5
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x12701
pushq $0x1
popq %rdx
movq %rax, %rdi
movl %edx, %esi
callq 0x14082
testl %eax, %eax
jne 0x12042
xorl %eax, %eax
addq $0x80, %rsp
popq %rbx
retq
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 %eax, %edi
callq 0xf260
leaq 0x1e3ca(%rip), %rsi     # 0x30444
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xfdf0
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/cqueues.c
// Function: cqueue_pause
static int cqueue_pause(lua_State *L) {
	struct cqueue *Q = cqueue_checkself(L, 1);
	sigset_t block;
	fd_set rfds;
	int index, error;

	if ((error = cqs_sigmask(SIG_SETMASK, NULL, &block)))
		goto error;

	for (index = 2; index <= lua_gettop(L); index++) {
		sigdelset(&block, luaL_checkint(L, index));
	}

	/* FD_SETSIZE unsigned on FreeBSD. */
	if (Q->kp.fd < 0 || Q->kp.fd >= (int)FD_SETSIZE)
		return luaL_error(L, "cqueue:pause: fd %d outside allowable range 0..%d", Q->kp.fd, (int)(FD_SETSIZE - 1));

	FD_ZERO(&rfds);
	FD_SET(Q->kp.fd, &rfds);

	if (-1 == cqs_pselect(Q->kp.fd + 1, &rfds, NULL, NULL, f2ts(cqueue_timeout_(Q)), &block, &error)) {
		if (error != EINTR)
			goto error;
	}

	return 0;
error:
	return luaL_error(L, "cqueue:pause: %s", cqs_strerror(error));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rdi, %rbx
callq 0x12701
movq %rax, %r14
pushq $0x2
popq %rbp
leaq 0x90(%rsp), %rdx
movl %ebp, %edi
xorl %esi, %esi
callq 0x105c0
testl %eax, %eax
jne 0x12173
leaq 0x90(%rsp), %r15
movq %rbx, %rdi
callq 0xf970
cmpl %eax, %ebp
jg 0x120e7
movq %rbx, %rdi
movl %ebp, %esi
callq 0x10b40
movq %r15, %rdi
movl %eax, %esi
callq 0x100f0
incl %ebp
jmp 0x120c3
movl (%r14), %ecx
cmpq $0x3ff, %rcx            # imm = 0x3FF
ja 0x121bd
xorl %eax, %eax
cmpq $0x10, %rax
je 0x1210a
andq $0x0, 0x10(%rsp,%rax,8)
incq %rax
jmp 0x120f9
pushq $0x1
popq %rax
shlq %cl, %rax
movl %ecx, %edx
shrl $0x6, %edx
orq %rax, 0x10(%rsp,%rdx,8)
leal 0x1(%rcx), %ebp
xorps %xmm0, %xmm0
movq %rsp, %r15
movaps %xmm0, (%r15)
movq %r14, %rdi
callq 0x12356
movq %r15, %rdi
callq 0x141da
leaq 0x10(%rsp), %rsi
leaq 0x90(%rsp), %r9
movl %ebp, %edi
xorl %edx, %edx
xorl %ecx, %ecx
movq %rax, %r8
callq 0xfeb0
cmpl $-0x1, %eax
jne 0x12163
callq 0xf0a0
movl (%rax), %eax
cmpl $0x4, %eax
jne 0x12173
xorl %eax, %eax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorps %xmm0, %xmm0
leaq 0x110(%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 %eax, %edi
callq 0xf260
leaq 0x1e2ed(%rip), %rsi     # 0x3049d
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xfdf0
leaq 0x1e2a7(%rip), %rsi     # 0x3046b
movq %rbx, %rdi
movl %ecx, %edx
movl $0x3ff, %ecx            # imm = 0x3FF
xorl %eax, %eax
callq 0xfdf0
// File: /workspace/github_c_makefile_star2_O2/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 0x12701
cmpq $0x0, 0x210(%rax)
je 0x12224
pxor %xmm0, %xmm0
jmp 0x1224f
movq %rax, %rdi
callq 0x12356
movq %xmm0, %rax
btrq $0x3f, %rax
movabsq $0x7fefffffffffffff, %rcx # imm = 0x7FEFFFFFFFFFFFFF
cmpq %rcx, %rax
jle 0x1224f
movq %rbx, %rdi
callq 0xf9d0
jmp 0x12257
movq %rbx, %rdi
callq 0xf2d0
pushq $0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x1de1f(%rip), %rsi     # 0x3008c
callq 0x113fc
movq %rax, %r14
movq 0x230(%rax), %rdi
testq %rdi, %rdi
je 0x1229f
movq %r14, %rsi
callq 0x11850
testb %al, %al
je 0x1229f
leaq 0x1e21a(%rip), %rdx     # 0x304ae
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xf410
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xf290
movq %rsp, %rdx
movl %eax, (%rdx)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rdx)
orl $-0x1, 0x14(%rdx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x142c0
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/cqueues.c
// Function: mintimeout
static inline double mintimeout(double a, double b) {
	if (islessequal(a, b) || !isfinite(b))
		return a;
	else if (islessequal(b, a) || !isfinite(a))
		return b;
	else
		return NAN;
}

// Assembly:
movq %xmm1, %rcx
ucomisd %xmm0, %xmm1
setae %dl
btrq $0x3f, %rcx
movabsq $0x7fefffffffffffff, %rax # imm = 0x7FEFFFFFFFFFFFFF
cmpq %rax, %rcx
setg %cl
orb %dl, %cl
je 0x1232e
movapd %xmm0, %xmm1
jmp 0x12351
ucomisd %xmm1, %xmm0
setae %cl
movq %xmm0, %rdx
btrq $0x3f, %rdx
cmpq %rax, %rdx
setg %al
orb %cl, %al
jne 0x12351
movsd 0x1dcb7(%rip), %xmm1    # 0x30008
movapd %xmm1, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movq 0x228(%rdi), %rdi
callq 0x1273e
testq %rax, %rax
je 0x1238b
movq %rax, %rbx
callq 0x12750
movapd %xmm0, %xmm1
movsd (%rbx), %xmm0
movapd %xmm0, %xmm2
subsd %xmm1, %xmm2
cmpnlesd %xmm1, %xmm0
andpd %xmm2, %xmm0
jmp 0x12393
movsd 0x1dc75(%rip), %xmm0    # 0x30008
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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:
subq $0xd8, %rsp
leaq 0x20(%rsp), %r10
movq %rcx, 0x18(%r10)
movq %r8, 0x20(%r10)
movq %r9, 0x28(%r10)
testb %al, %al
je 0x123e8
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, %rcx
movq %r10, 0x10(%rcx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%rcx)
callq 0x127d5
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/cqueues.c
// Function: cqueue_step_cont
static int cqueue_step_cont(lua_State *L) {
#endif
	int nargs = lua_gettop(L);
	struct callinfo I = CALLINFO_INITIALIZER;
	struct cqueue *Q = cqueue_checkself(L, 1);
	struct thread *T = Q->thread.current;
	if (!T) {
		luaL_error(L, "cqueue not yielded");
		NOTREACHED;
	}
	if (lua_islightuserdata(L, 2) && lua_touserdata(L, 2) == CQUEUE__POLL) {
		luaL_error(L, "cannot resume a coroutine passing internal cqueues._POLL value as first parameter");
		NOTREACHED;
	}
	/* move arguments onto resumed stack */
	lua_xmove(L, T->L, nargs-1);

	cqueue_enter(L, &I, 1);

	switch(cqueue_process_threads(L, Q, &I)) {
	case LUA_OK:
		break;
	case LUA_YIELD:
		/* clear everything off the stack except for cqueue object; `I` now invalid */
		lua_settop(L, 1);
#if LUA_VERSION_NUM >= 502
		/* move arguments onto 'main' stack to return them from this yield */
		nargs = lua_gettop(Q->thread.current->L);
		lua_xmove(Q->thread.current->L, L, nargs);
		return lua_yieldk(L, nargs, 0, cqueue_step_cont);
#else
		lua_pushliteral(L, "yielded");
		/* move arguments onto 'main' stack to return them from this yield */
		nargs = lua_gettop(Q->thread.current->L);
		lua_xmove(Q->thread.current->L, L, nargs);
		return nargs+1;
#endif
	default:
		goto oops;
	}

	lua_pushboolean(L, 1);

	return 1;
oops:
	Q->thread.current = NULL;
	lua_pushboolean(L, 0);
	return 1 + err_pushinfo(L, &I);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0xf970
movl %eax, %ebp
movups 0x1e065(%rip), %xmm0    # 0x30504
movaps %xmm0, (%rsp)
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
callq 0x12701
movq 0x218(%rax), %r15
testq %r15, %r15
je 0x125b3
movq %rax, %r14
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0xf270
cmpl $0x2, %eax
jne 0x124f5
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x103f0
cmpq 0x32a71(%rip), %rax     # 0x44f60
je 0x125bc
movq (%r15), %rsi
decl %ebp
movq %rbx, %rdi
movl %ebp, %edx
callq 0x102c0
movq %rsp, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x122cf
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x127fd
testl %eax, %eax
je 0x12576
cmpl $0x1, %eax
jne 0x12585
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x106f0
movq 0x218(%r14), %rax
movq (%rax), %rdi
callq 0xf970
movl %eax, %ebp
movq 0x218(%r14), %rax
movq (%rax), %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x102c0
leaq -0xdc(%rip), %rcx       # 0x12484
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xf0b0
pushq $0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x108d0
jmp 0x125a6
andq $0x0, 0x218(%r14)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x108d0
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x125cd
movl %eax, %ebp
incl %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1dddb(%rip), %rsi     # 0x30395
jmp 0x125c3
leaq 0x1dde5(%rip), %rsi     # 0x303a8
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfdf0
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/cqueues.c
// Function: err_pushinfo
static cqs_nargs_t err_pushinfo(lua_State *L, struct callinfo *I) {
	int nargs = 0;

	luaL_checkstack(L, 5, "too many arguments");

	err_pushvalue(L, I);
	nargs = 1;

	if (I->error.code) {
		lua_pushinteger(L, I->error.code);
		nargs = 2;
	}

	if (I->error.thread) {
		lua_settop(L, lua_gettop(L) + (2 - nargs));
		err_checktype(L, I->error.thread, LUA_TTHREAD);
		lua_pushvalue(L, I->error.thread);
		nargs = 3;
	}

	if (I->error.object) {
		lua_settop(L, lua_gettop(L) + (3 - nargs));
		if (lua_isnone(L, I->error.object))
			err_corrupt(L, I->error.object, "any");
		lua_pushvalue(L, I->error.object);
		nargs = 4;
	}

	if (I->error.fd != -1) {
		lua_settop(L, lua_gettop(L) + (4 - nargs));
		lua_pushinteger(L, I->error.fd);
		nargs = 5;
	}

	return nargs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x1db7e(%rip), %rdx     # 0x3015f
pushq $0x5
popq %rbp
movl %ebp, %esi
callq 0xfd30
movq %rbx, %rdi
movq %r14, %rsi
callq 0x13e76
movslq 0x8(%r14), %rsi
testq %rsi, %rsi
je 0x1260b
movq %rbx, %rdi
callq 0xf960
pushq $0x2
jmp 0x1260d
pushq $0x1
popq %r15
cmpl $0x0, 0xc(%r14)
je 0x12658
movq %rbx, %rdi
callq 0xf970
negl %r15d
leal (%rax,%r15), %esi
addl $0x2, %esi
movq %rbx, %rdi
callq 0x106f0
movl 0xc(%r14), %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0xf270
cmpl $0x8, %eax
jne 0x126d9
movl 0xc(%r14), %esi
movq %rbx, %rdi
callq 0xfa10
pushq $0x3
popq %r15
cmpl $0x0, 0x10(%r14)
je 0x1269a
movq %rbx, %rdi
callq 0xf970
negl %r15d
leal (%rax,%r15), %esi
addl $0x3, %esi
movq %rbx, %rdi
callq 0x106f0
movl 0x10(%r14), %esi
movq %rbx, %rdi
callq 0xf270
movl 0x10(%r14), %esi
cmpl $-0x1, %eax
je 0x126f2
movq %rbx, %rdi
callq 0xfa10
pushq $0x4
popq %r15
cmpl $-0x1, 0x14(%r14)
je 0x126c9
movq %rbx, %rdi
callq 0xf970
negl %r15d
leal (%rax,%r15), %esi
addl $0x4, %esi
movq %rbx, %rdi
callq 0x106f0
movslq 0x14(%r14), %rsi
movq %rbx, %rdi
callq 0xf960
jmp 0x126cc
movl %r15d, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0xfac0
movq %rbx, %rdi
movl %r15d, %esi
movq %rax, %rdx
callq 0x13ea8
leaq 0x1dd01(%rip), %rdx     # 0x303fa
movq %rbx, %rdi
callq 0x13ea8
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/cqueues.c
// Function: f2ms
static inline int f2ms(const double f) {
	double ms;

	switch (fpclassify(f)) {
	case FP_NORMAL:
		if (signbit(f))
			return 0;

		ms = ceil(f * 1000);

		return (ms > INT_MAX)? INT_MAX : ms;
	case FP_SUBNORMAL:
		return 1;
	case FP_ZERO:
		return 0;
	case FP_INFINITE:
	case FP_NAN:
	default:
		return -1;
	}
}

// Assembly:
pushq %rax
movsd %xmm0, (%rsp)
callq 0xf060
cmpl $0x2, %eax
je 0x127c8
cmpl $0x3, %eax
je 0x127cc
cmpl $0x4, %eax
jne 0x127d0
movq (%rsp), %xmm0
movq %xmm0, %rax
testq %rax, %rax
js 0x127c8
mulsd 0x1d867(%rip), %xmm0    # 0x30018
callq 0xf1d0
movsd 0x1d862(%rip), %xmm1    # 0x30020
minsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
jmp 0x127d3
xorl %eax, %eax
jmp 0x127d3
pushq $0x1
jmp 0x127d2
pushq $-0x1
popq %rax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/cqueues.c
// Function: event_del
static void event_del(struct cqueue *Q, struct event *event) {
	if (event->wakecb) {
		wakecb_del(event->wakecb);
		pool_put(&Q->pool.wakecb, event->wakecb);
	}

	if (event->fileno) {
		LIST_REMOVE(event->fileno, le);
		LIST_INSERT_HEAD(&Q->fileno.outstanding, event->fileno, le);

		LIST_REMOVE(event, fle);
	}

	TAILQ_REMOVE(&event->thread->events, event, tqe);
	assert(event->thread->count > 0);
	event->thread->count--;

	pool_put(&Q->pool.event, event);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x48(%rsi), %rdi
testq %rdi, %rdi
je 0x1329f
callq 0x114c3
movq 0x48(%rbx), %rax
movq 0x1d0(%r14), %rcx
movq %rcx, (%rax)
movq %rax, 0x1d0(%r14)
movq 0x30(%rbx), %rcx
testq %rcx, %rcx
je 0x132fa
movq 0x30(%rcx), %rax
movq 0x38(%rcx), %rcx
testq %rax, %rax
je 0x132b9
movq %rcx, 0x38(%rax)
movq %rax, (%rcx)
leaq 0x1b0(%r14), %rax
movq 0x1b0(%r14), %rdx
movq 0x30(%rbx), %rcx
movq %rdx, 0x30(%rcx)
testq %rdx, %rdx
je 0x132df
leaq 0x30(%rcx), %rsi
movq %rsi, 0x38(%rdx)
movq %rcx, (%rax)
movq %rax, 0x38(%rcx)
movq 0x38(%rbx), %rax
movq 0x40(%rbx), %rcx
testq %rax, %rax
je 0x132f7
movq %rcx, 0x40(%rax)
movq %rax, (%rcx)
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rcx
testq %rax, %rax
je 0x1330d
leaq 0x28(%rax), %rdx
jmp 0x13315
movq 0x18(%rbx), %rdx
addq $0x10, %rdx
movq %rcx, (%rdx)
movq %rax, (%rcx)
movq 0x18(%rbx), %rax
movl 0x18(%rax), %ecx
testl %ecx, %ecx
je 0x13344
decl %ecx
movl %ecx, 0x18(%rax)
movq 0x200(%r14), %rax
movq %rax, (%rbx)
movq %rbx, 0x200(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x1cf47(%rip), %rdi     # 0x30292
leaq 0x1cea8(%rip), %rsi     # 0x301fa
leaq 0x1cf52(%rip), %rcx     # 0x302ab
movl $0x720, %edx            # imm = 0x720
callq 0xf8e0