LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 0xf920
movl %eax, %ebp
movups 0x22985(%rip), %xmm0    # 0x35504
movaps %xmm0, (%rsp)
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
callq 0x12e12
movq 0x218(%rax), %r15
testq %r15, %r15
je 0x12cb8
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0xf260
cmpl $0x2, %eax
jne 0x12bd9
movq %rbx, %rdi
movl $0x2, %esi
callq 0x10350
cmpq 0x3438d(%rip), %rax     # 0x46f60
je 0x12cc1
movq (%r15), %rsi
decl %ebp
movq %rbx, %rdi
movl %ebp, %edx
callq 0x10230
movq %rbx, %rdi
callq 0x12e12
movl $0x1, %ebp
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 0x12e51
testl %eax, %eax
je 0x12c78
cmpl $0x1, %eax
jne 0x12c87
movq %rbx, %rdi
movl $0x1, %esi
callq 0x10640
movq 0x218(%r14), %rax
movq (%rax), %rdi
callq 0xf920
movl %eax, %ebp
movq 0x218(%r14), %rax
movq (%rax), %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x10230
leaq -0xfe(%rip), %rcx       # 0x12b64
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xf0b0
movq %rbx, %rdi
movl $0x1, %esi
callq 0x10800
jmp 0x12cab
movq $0x0, 0x218(%r14)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10800
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x12cd2
movl %eax, %ebp
incl %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x226d6(%rip), %rsi     # 0x35395
jmp 0x12cc8
leaq 0x226e0(%rip), %rsi     # 0x353a8
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfd60
// File: /workspace/github_c_makefile_star2_O1/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 0x22479(%rip), %rdx     # 0x3515f
movl $0x5, %esi
callq 0xfca0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x14b6e
movslq 0x8(%r14), %rsi
testq %rsi, %rsi
je 0x12d14
movq %rbx, %rdi
callq 0xf910
movl $0x2, %r15d
jmp 0x12d1a
movl $0x1, %r15d
cmpl $0x0, 0xc(%r14)
je 0x12d64
movq %rbx, %rdi
callq 0xf920
negl %r15d
leal (%rax,%r15), %esi
addl $0x2, %esi
movq %rbx, %rdi
callq 0x10640
movl 0xc(%r14), %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0xf260
cmpl $0x8, %eax
jne 0x12de9
movl 0xc(%r14), %esi
movq %rbx, %rdi
callq 0xf9c0
movl $0x3, %r15d
cmpl $0x0, 0x10(%r14)
je 0x12da8
movq %rbx, %rdi
callq 0xf920
negl %r15d
leal (%rax,%r15), %esi
addl $0x3, %esi
movq %rbx, %rdi
callq 0x10640
movl 0x10(%r14), %esi
movq %rbx, %rdi
callq 0xf260
movl 0x10(%r14), %esi
cmpl $-0x1, %eax
je 0x12e03
movq %rbx, %rdi
callq 0xf9c0
movl $0x4, %r15d
cmpl $-0x1, 0x14(%r14)
je 0x12ddb
movq %rbx, %rdi
callq 0xf920
negl %r15d
leal (%rax,%r15), %esi
addl $0x4, %esi
movq %rbx, %rdi
callq 0x10640
movslq 0x14(%r14), %rsi
movq %rbx, %rdi
callq 0xf910
movl $0x5, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movl $0x8, %esi
callq 0xfa50
movq %rbx, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x14ba2
leaq 0x225f0(%rip), %rdx     # 0x353fa
movq %rbx, %rdi
callq 0x14ba2
// File: /workspace/github_c_makefile_star2_O1/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:
movq 0x48(%rsi), %rax
testq %rax, %rax
je 0x13e31
movq (%rax), %rcx
testq %rcx, %rcx
je 0x13e1c
movq 0x28(%rax), %rdx
movq 0x30(%rax), %r8
addq $0x10, %rcx
leaq 0x30(%rdx), %r9
testq %rdx, %rdx
cmoveq %rcx, %r9
movq %r8, (%r9)
movq 0x30(%rax), %rcx
movq %rdx, (%rcx)
movq $0x0, (%rax)
movq 0x48(%rsi), %rax
movq 0x1d0(%rdi), %rcx
movq %rcx, (%rax)
movq %rax, 0x1d0(%rdi)
movq 0x30(%rsi), %rax
testq %rax, %rax
je 0x13e94
movq 0x30(%rax), %rcx
testq %rcx, %rcx
je 0x13e4b
movq 0x38(%rax), %rdx
movq %rdx, 0x38(%rcx)
movq 0x38(%rax), %rax
movq %rcx, (%rax)
leaq 0x1b0(%rdi), %rax
movq 0x1b0(%rdi), %rdx
movq 0x30(%rsi), %rcx
movq %rdx, 0x30(%rcx)
testq %rdx, %rdx
je 0x13e75
leaq 0x30(%rcx), %r8
movq %r8, 0x38(%rdx)
movq %rcx, (%rax)
movq %rax, 0x38(%rcx)
movq 0x38(%rsi), %rax
testq %rax, %rax
je 0x13e8d
movq 0x40(%rsi), %rcx
movq %rcx, 0x40(%rax)
movq 0x40(%rsi), %rcx
movq %rax, (%rcx)
movq 0x20(%rsi), %rax
movq 0x28(%rsi), %rcx
testq %rax, %rax
je 0x13ea7
leaq 0x28(%rax), %rdx
jmp 0x13eaf
movq 0x18(%rsi), %rdx
addq $0x10, %rdx
movq %rcx, (%rdx)
movq 0x28(%rsi), %rcx
movq %rax, (%rcx)
movq 0x18(%rsi), %rax
movl 0x18(%rax), %ecx
testl %ecx, %ecx
je 0x13edb
decl %ecx
movl %ecx, 0x18(%rax)
movq 0x200(%rdi), %rax
movq %rax, (%rsi)
movq %rsi, 0x200(%rdi)
retq
pushq %rax
leaq 0x213af(%rip), %rdi     # 0x35292
leaq 0x21310(%rip), %rsi     # 0x351fa
leaq 0x213ba(%rip), %rcx     # 0x352ab
movl $0x720, %edx            # imm = 0x720
callq 0xf890
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: cqueue_update
static cqs_status_t cqueue_update(lua_State *L, struct cqueue *Q, struct callinfo *I, struct thread *T) {
	struct fileno *fileno, *next;
	struct event *event;
	int error;

	for (fileno = LIST_FIRST(&Q->fileno.outstanding); fileno; fileno = next) {
		next = LIST_NEXT(fileno, le);

		if ((error = fileno_update(Q, fileno)))
			goto error;
	}

	return LUA_OK;
error:
	LIST_FOREACH(event, &fileno->events, fle) {
		if (event->thread != T)
			continue;

		lua_pushvalue(T->L, event->index);
		lua_xmove(T->L, L, 1);
		err_setobject(L, I, lua_gettop(L));

		break;
	}

	err_setfd(L, I, fileno->fd);
	err_setinfo(L, I, error, T, 0, "unable to update event disposition: %s (fd:%d)", cqs_strerror(error), fileno->fd);

	return LUA_ERRRUN;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rcx, %rbx
movq %rdx, 0x8(%rsp)
movq %rsi, %r13
movq %rdi, %r14
movq 0x1b0(%rsi), %r12
testq %r12, %r12
je 0x1459d
movq %r12, %r15
movq 0x8(%r12), %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0x14563
orw 0x4(%rcx), %ax
movq 0x38(%rcx), %rcx
jmp 0x14554
movq 0x30(%r15), %r12
movswl %ax, %edx
movq %r13, %rdi
movq %r15, %rsi
callq 0x11b95
testl %eax, %eax
je 0x14545
movl %eax, %ebp
movq 0x8(%r15), %rax
testq %rax, %rax
movq %r14, %r12
movq 0x8(%rsp), %r14
je 0x145d9
cmpq %rbx, 0x18(%rax)
je 0x145a4
movq 0x38(%rax), %rax
testq %rax, %rax
jne 0x1458c
jmp 0x145d9
xorl %eax, %eax
jmp 0x14642
movq (%rbx), %rdi
movl 0x14(%rax), %esi
callq 0xf9c0
movq (%rbx), %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x10230
movq %r12, %rdi
callq 0xf920
testl %eax, %eax
je 0x145d9
movq %r12, %rdi
movl %eax, %esi
callq 0xf280
movl %eax, 0x10(%r14)
movl (%r15), %eax
movl %eax, 0x14(%r14)
xorps %xmm0, %xmm0
leaq 0x10(%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 %rax, %r10
movl (%r15), %r11d
leaq 0x20d46(%rip), %r9      # 0x35366
movq %r12, %rdi
movq %r14, %rsi
movl %ebp, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x14757
addq $0x10, %rsp
movl $0x2, %eax
addq $0x98, %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: thread_del
static void thread_del(lua_State *L, struct cqueue *Q, struct callinfo *I, struct thread *T) {
	struct event *event;

	while ((event = TAILQ_FIRST(&T->events))) {
		event_del(Q, event);
	}
	timer_destroy(Q, &T->timer);
	LIST_REMOVE(T, le);
	Q->thread.count--;

	/*
	 * XXX: These lua operations are documented as able to longjmp on
	 * OOM. However, inspection of the lua source suggests that when used
	 * as below they won't throw.
	 *   - In lua5.1 pushing a lightuserdata doesn't allocate (they're
	 *     stack allocated)
	 *   - rawset doesn't allocate if the key already exists in the table
	 *     (which it always does for this function)
	 */
	cqs_getuservalue(L, I->self);

	/* set thread's uservalue (it's thread) to nil */
	lua_rawgetp(L, -1, CQS_UNIQUE_LIGHTUSERDATA_MASK(T));
	lua_pushnil(L);
	cqs_setuservalue(L, -2);
	lua_pop(L, 1);
	T->L = NULL;

	/* remove thread from cqueues's thread table */
	lua_pushnil(L);
	lua_rawsetp(L, -2, CQS_UNIQUE_LIGHTUSERDATA_MASK(T));
	lua_pop(L, 1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq 0x8(%rcx), %rsi
testq %rsi, %rsi
je 0x1467f
movq %r12, %rdi
callq 0x13de3
movq 0x8(%r14), %rsi
jmp 0x1466c
leaq 0x40(%r14), %rsi
movq %r12, %rdi
callq 0x13efb
movq 0x28(%r14), %rax
testq %rax, %rax
je 0x1469c
movq 0x30(%r14), %rcx
movq %rcx, 0x30(%rax)
movq 0x30(%r14), %rcx
movq %rax, (%rcx)
decl 0x220(%r12)
movl (%r15), %esi
movq %rbx, %rdi
callq 0x10330
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r14, %rdx
callq 0xf080
movq %rbx, %rdi
callq 0xf980
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf630
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x10640
movq $0x0, (%r14)
movq %rbx, %rdi
callq 0xf980
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r14, %rdx
callq 0xf160
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x10640
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: err_setinfo
static void err_setinfo(lua_State *L, struct callinfo *I, int code, struct thread *T, int object, const char *fmt, ...) {
	/* set object first in case it's a relative index */
	if (object)
		err_setobject(L, I, object);

	if (T)
		err_setthread(L, I, T);

	if (fmt) {
		va_list ap;

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

	/*
	 * set code after we set any string so we don't unnecessarily
	 * instantiate a string description
	 */
	if (code)
		err_setcode(L, I, code);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd0, %rsp
movq %r9, %r12
movq %rcx, %r13
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
testb %al, %al
je 0x147b0
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)
testl %r8d, %r8d
je 0x147c4
movq %r15, %rdi
movl %r8d, %esi
callq 0xf280
movl %eax, 0x10(%r14)
testq %r13, %r13
je 0x147d7
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x1471f
testq %r12, %r12
je 0x14818
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000030, %rax     # imm = 0x3000000030
movq %rax, (%rdx)
movq %r15, %rdi
movq %r12, %rsi
callq 0x10600
movq %r15, %rdi
callq 0xf920
movl %eax, 0x4(%r14)
testl %ebx, %ebx
je 0x14829
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x12af5
addq $0xd0, %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: pool_get
static void *pool_get(struct pool *P, int *_error) {
	void *p;
	int error;

	if (!(p = P->head)) {
		error = pool_grow(P, MAX(1, P->count));

		if (!(p = P->head)) {
			*_error = error;

			return NULL;
		}
	}

	P->head = *(void **)p;

	return p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rax
testq %rax, %rax
jne 0x148b3
movq %rsi, %r14
movq 0x8(%rbx), %r12
cmpq $0x1, %r12
movq %r12, %r13
adcq $0x0, %r13
incq %r12
testq %r12, %r12
je 0x148a5
movq (%rbx), %rdi
callq 0x10110
movq %rax, %r15
testq %rax, %rax
jne 0x14882
callq 0xf0a0
movl (%rax), %ebp
testq %r15, %r15
je 0x148aa
decq %r13
movq %r12, 0x8(%rbx)
movq 0x10(%rbx), %rax
movq %rax, (%r15)
movq %r15, 0x10(%rbx)
incq %r12
testq %r13, %r13
jne 0x14866
xorl %ebp, %ebp
jmp 0x148aa
movl $0xc, %ebp
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x148c9
movq (%rax), %rcx
movq %rcx, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, (%r14)
xorl %eax, %eax
jmp 0x148ba
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: object_getcv
static int object_getcv(lua_State *L, struct cqueue *Q, struct callinfo *I, struct thread *T, int index, struct event *event) {
	struct condition *cv = lua_touserdata(L, index);
	int error;

	if (!(event->wakecb = pool_get(&Q->pool.wakecb, &error))) {
		err_setinfo(L, I, error, T, index, "unable to wait on conditional variable: %s", cqs_strerror(error));

		return LUA_ERRRUN;
	}

	wakecb_init(event->wakecb, &wakecb_wakeup, Q, event);
	wakecb_add(event->wakecb, cv);

	return LUA_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r8, %r13
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %rbp
movq %rdi, %r12
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x10350
movq %rax, %r14
leaq 0x1c0(%rbp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x1483a
movq %rax, 0x48(%r13)
testq %rax, %rax
je 0x14972
movq $0x0, (%rax)
leaq 0x223(%rip), %rcx       # 0x14b48
movq %rcx, 0x8(%rax)
movq %rbp, 0x10(%rax)
movq 0x48(%r13), %rax
movq %r13, 0x18(%rax)
movq 0x48(%r13), %rax
cmpb $0x1, (%r14)
jne 0x149d3
leaq 0x8(%r14), %rcx
movq 0x8(%r14), %rdx
leaq 0x28(%rax), %rsi
movq %r14, %rdi
addq $0x10, %rdi
leaq 0x30(%rdx), %r8
testq %rdx, %rdx
cmoveq %rdi, %r8
movq %rdx, 0x28(%rax)
movq %rsi, (%r8)
movq %rax, 0x8(%r14)
movq %rcx, 0x30(%rax)
jmp 0x149ee
movl 0xc(%rsp), %ebp
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
movaps %xmm0, (%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x70(%rsi)
movl $0x80, %edx
movl %ebp, %edi
callq 0xf250
movq %rax, (%rsp)
leaq 0x2093f(%rip), %r9      # 0x352f3
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movq %rbx, %rcx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x14757
movl $0x2, %eax
jmp 0x149f3
leaq 0x28(%rax), %rcx
movq $0x0, 0x28(%rax)
movq 0x10(%r14), %rdx
movq %rdx, 0x30(%rax)
movq %rax, (%rdx)
movq %rcx, 0x10(%r14)
movq %r14, (%rax)
xorl %eax, %eax
addq $0x98, %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: object_pcall
static cqs_status_t (object_pcall)(lua_State *L, struct callinfo *I, struct thread *T, int index, const char *field, int rtype[], int n) {
	int type, i, status;

	index = lua_absindex(L, index);
	lua_getfield(L, index, field);

	if (lua_isfunction(L, -1)) {
		lua_pushvalue(L, index);

		if (LUA_OK != (status = lua_pcall(L, 1, 1, 0))) {
			err_setinfo(L, I, 0, T, index, "error calling method %s: %s", field, lua_tostring(L, -1));

			return status;
		}
	}

	type = lua_type(L, -1);

	for (i = 0; i < n; i++) {
		if (type == rtype[i])
			return LUA_OK;
	}

	err_setinfo(L, I, 0, T, index, "error loading field %s: %s expected, got %s", field, lua_typename(L, rtype[0]), luaL_typename(L, -1));

	return LUA_ERRRUN;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r13
movq %r8, %rbx
movq %rdx, (%rsp)
movq %rsi, %r15
movq %rdi, %r12
movl %ecx, %esi
callq 0xf280
movl %eax, %ebp
movq %r12, %rdi
movl %eax, %esi
movq %rbx, %rdx
callq 0xf1e0
movq %r12, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf260
cmpl $0x6, %eax
jne 0x14aae
movq %r12, %rdi
movl %ebp, %esi
callq 0xf9c0
movq %r12, %rdi
movl $0x1, %esi
movl $0x1, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xf990
testl %eax, %eax
je 0x14aae
movl %eax, %r14d
movq %r12, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0xf110
movq %rax, %r10
leaq 0x20892(%rip), %r9      # 0x3531e
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq (%rsp), %rcx
movl %ebp, %r8d
xorl %eax, %eax
pushq %r10
pushq %rbx
callq 0x14757
addq $0x10, %rsp
jmp 0x14b36
movl 0x40(%rsp), %r14d
movq %r12, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf260
testl %r14d, %r14d
jle 0x14adc
movl %r14d, %ecx
xorl %r14d, %r14d
xorl %edx, %edx
cmpl (%r13,%rdx,4), %eax
je 0x14b36
incq %rdx
cmpq %rdx, %rcx
jne 0x14acd
movl (%r13), %esi
movq %r12, %rdi
callq 0xfa50
movq %rax, %r14
movq %r12, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf260
movq %r12, %rdi
movl %eax, %esi
callq 0xfa50
movq %rax, %r10
subq $0x8, %rsp
leaq 0x2082a(%rip), %r9      # 0x3533a
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq 0x8(%rsp), %rcx
movl %ebp, %r8d
xorl %eax, %eax
pushq %r10
pushq %r14
pushq %rbx
callq 0x14757
addq $0x20, %rsp
movl $0x2, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: wakecb_wakeup
static cqs_error_t wakecb_wakeup(struct wakecb *cb) {
	struct cqueue *Q = cb->arg[0];
	struct event *event = cb->arg[1];

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

	return cqueue_tryalert(Q);
}

// Assembly:
pushq %rbx
movq 0x10(%rdi), %rbx
movq 0x18(%rdi), %rax
movb $0x1, 0x10(%rax)
movq 0x18(%rax), %rdi
leaq 0x210(%rbx), %rsi
callq 0x11c11
movq %rbx, %rdi
popq %rbx
jmp 0x11c4f
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: err_pushvalue
static const char *err_pushvalue(lua_State *L, struct callinfo *I) {
	if (I->error.value) {
		lua_pushvalue(L, I->error.value);
	} else {
		lua_pushstring(L, "no error message");
	}

	return lua_tostring(L, -1);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x4(%rsi), %esi
testl %esi, %esi
je 0x14b83
movq %rbx, %rdi
callq 0xf9c0
jmp 0x14b92
leaq 0x20874(%rip), %rsi     # 0x353fe
movq %rbx, %rdi
callq 0xfbd0
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
popq %rbx
jmp 0xf110
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: thread_add
static void thread_add(lua_State *L, struct cqueue *Q, struct callinfo *I, int index) {
	struct thread *T;

	index = lua_absindex(L, index);

	T = lua_newuserdata(L, sizeof *T);
	memset(T, 0, sizeof *T);
	TAILQ_INIT(&T->events);
	timer_init(&T->timer);

	/* anchor new lua_State to our thread context */
	lua_pushvalue(L, index);
	cqs_setuservalue(L, -2);
	T->L = lua_tothread(L, index);

	/* anchor thread context to cqueue object */
	cqs_getuservalue(L, I->self);
	lua_pushvalue(L, -2);
	lua_rawsetp(L, -2, CQS_UNIQUE_LIGHTUSERDATA_MASK(T));
	lua_pop(L, 2);

	LIST_INSERT_HEAD(&Q->thread.pending, T, le);
	T->threads = &Q->thread.pending;
	Q->thread.count++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r15
movl %ecx, %esi
callq 0xf280
movl %eax, %ebp
movl $0x68, %esi
movq %r15, %rdi
callq 0xfb00
movq %rax, %r14
addq $0x8, %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movups %xmm0, 0x40(%r14)
movups %xmm0, (%r14)
movups %xmm0, 0x20(%r14)
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x50(%r14)
movq $0x0, 0x60(%r14)
movq %rax, 0x10(%r14)
movabsq $0x7ff8000000000000, %rax # imm = 0x7FF8000000000000
movq %rax, 0x40(%r14)
movq %r15, %rdi
movl %ebp, %esi
callq 0xf9c0
movq %r15, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf630
movq %r15, %rdi
movl %ebp, %esi
callq 0xf460
movq %rax, (%r14)
movl (%r12), %esi
movq %r15, %rdi
callq 0x10330
movq %r15, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf9c0
movq %r15, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r14, %rdx
callq 0xf160
movq %r15, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x10640
leaq 0x210(%rbx), %rax
movq 0x210(%rbx), %rcx
movq %rcx, 0x28(%r14)
testq %rcx, %rcx
je 0x14cbb
movq %r14, %rdx
addq $0x28, %rdx
movq %rdx, 0x30(%rcx)
movq %r14, 0x210(%rbx)
movq %rax, 0x30(%r14)
movq %rax, 0x20(%r14)
incl 0x220(%rbx)
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: cqueue_checkfd
static int cqueue_checkfd(lua_State *L, struct callinfo *I, int index) {
	int fd;

	if (!lua_isnil(L, index) && !lua_isnumber(L, index)) {
		if (LUA_OK != object_pcall(L, I, NULL, index, "pollfd", LUA_TNUMBER))
			err_error(L, I);

		fd = luaL_optint(L, -1, -1);
		lua_pop(L, 1);
	} else {
		fd = luaL_optint(L, index, -1);
	}

	return fd;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl %edx, %esi
callq 0xf260
testl %eax, %eax
je 0x14d02
movq %rbx, %rdi
movl %ebp, %esi
callq 0xfb80
testl %eax, %eax
je 0x14d18
movq %rbx, %rdi
movl %ebp, %esi
movq $-0x1, %rdx
callq 0xf400
movq %rax, %r14
jmp 0x14d7c
leaq 0xc(%rsp), %r9
movl $0x3, (%r9)
movl $0x1, (%rsp)
leaq 0x203fd(%rip), %r8      # 0x3512f
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
movl %ebp, %ecx
callq 0x14a05
testl %eax, %eax
je 0x14d58
movq %rbx, %rdi
movq %r14, %rsi
callq 0x14b6e
movq %rbx, %rdi
callq 0xf690
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq $-0x1, %rdx
callq 0xf400
movq %rax, %r14
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x10640
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: cqueue_reboot
static cqs_error_t cqueue_reboot(struct cqueue *Q, _Bool stop, _Bool restart) {
	if (stop) {
		struct fileno *fileno;
		struct thread *thread;

		while ((fileno = LIST_FIRST(&Q->fileno.polling))) {
			LIST_REMOVE(fileno, le);
			LIST_INSERT_HEAD(&Q->fileno.outstanding, fileno, le);
		}

		LIST_FOREACH(fileno, &Q->fileno.outstanding, le) {
			fileno->state = 0;
		}

		while ((thread = LIST_FIRST(&Q->thread.polling))) {
			thread_move(thread, &Q->thread.pending);
		}

		kpoll_destroy(&Q->kp, &cstack_onclosefd, Q->cstack);
	}

	if (restart) {
		int error;

		if ((error = kpoll_init(&Q->kp)))
			return error;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rdi, %rbx
testl %esi, %esi
je 0x14e3d
movq 0x1a8(%rbx), %rax
testq %rax, %rax
je 0x14def
leaq 0x1b0(%rbx), %rcx
movq 0x30(%rax), %rdx
testq %rdx, %rdx
je 0x14dbd
movq 0x38(%rax), %rsi
movq %rsi, 0x38(%rdx)
movq 0x38(%rax), %rsi
movq %rdx, (%rsi)
movq (%rcx), %rdx
movq %rdx, 0x30(%rax)
testq %rdx, %rdx
je 0x14dd8
leaq 0x30(%rax), %rsi
movq %rsi, 0x38(%rdx)
movq %rax, 0x1b0(%rbx)
movq %rcx, 0x38(%rax)
movq 0x1a8(%rbx), %rax
testq %rax, %rax
jne 0x14dac
movq 0x1b0(%rbx), %rax
testq %rax, %rax
je 0x14e07
movw $0x0, 0x4(%rax)
movq 0x30(%rax), %rax
jmp 0x14df6
movq 0x208(%rbx), %rdi
testq %rdi, %rdi
je 0x14e2e
leaq 0x210(%rbx), %r14
movq %r14, %rsi
callq 0x11c11
movq 0x208(%rbx), %rdi
testq %rdi, %rdi
jne 0x14e1a
movq 0x230(%rbx), %rsi
movq %rbx, %rdi
callq 0x14e55
testb %bpl, %bpl
je 0x14e4e
movq %rbx, %rdi
callq 0x14f04
testl %eax, %eax
jne 0x14e50
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: pool_destroy
static void pool_destroy(struct pool *P) {
	void *p;

	while ((p = P->head)) {
		P->head = *(void **)p;
		free(p);
		P->count--;
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x1566a
movq (%rdi), %rax
movq %rax, 0x10(%rbx)
callq 0xff30
decq 0x8(%rbx)
movq 0x10(%rbx), %rdi
jmp 0x1564f
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: cqueue__gc
static int cqueue__gc(lua_State *L) {
	struct cqueue *Q = cqs_checkudata(L, 1, 1, CQUEUE_CLASS);
	struct callinfo I;

	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 0x1fa0f(%rip), %rsi     # 0x3508c
callq 0x11835
movq %rax, %r14
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_create
static int cqueue_create(lua_State *L) {
	struct cqueue *Q;
	int error;

	Q = lua_newuserdata(L, sizeof *Q);

	cqueue_preinit(Q);

	luaL_getmetatable(L, CQUEUE_CLASS);
	lua_setmetatable(L, -2);

	if ((error = cqueue_init(L, Q, -1)))
		goto error;

	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 $0x88, %rsp
movq %rdi, %rbx
movl $0x248, %esi            # imm = 0x248
callq 0xfb00
movq %rax, %r14
xorl %r15d, %r15d
movl $0x248, %edx            # imm = 0x248
movq %rax, %rdi
xorl %esi, %esi
callq 0xf750
movl $0xffffffff, (%r14)     # imm = 0xFFFFFFFF
movq %r15, 0x188(%r14)
movq $-0x1, 0x190(%r14)
movw $0x0, 0x198(%r14)
movl $0x0, 0x19c(%r14)
movq %r15, 0x218(%r14)
movq $0x38, 0x1c0(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x1c8(%r14)
movq $0x40, 0x1d8(%r14)
movups %xmm0, 0x1e0(%r14)
movq $0x50, 0x1f0(%r14)
movups %xmm0, 0x1f8(%r14)
leaq 0x1f92b(%rip), %rdx     # 0x3508c
movq %rbx, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0xf1e0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x10910
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf280
movl %eax, %r15d
movq %r14, %rdi
callq 0x14f04
movl %eax, %ebp
testl %eax, %eax
jne 0x157eb
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x101e0
movq %rbx, %rdi
movl %r15d, %esi
callq 0xf630
movq %rbx, %rdi
callq 0x11143
movq %rax, 0x230(%r14)
movq (%rax), %rcx
movq %rcx, 0x238(%r14)
testq %rcx, %rcx
je 0x157e1
movq %r14, %rdx
addq $0x238, %rdx            # imm = 0x238
movq %rdx, 0x240(%rcx)
movq %r14, (%rax)
movq %rax, 0x240(%r14)
testl %ebp, %ebp
je 0x15845
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, %eax
jmp 0x1584a
movl $0x1, %eax
addq $0x88, %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_type
static int cqueue_type(lua_State *L) {
	struct cqueue *Q;

	if ((Q = cqs_testudata(L, 1, 1))) {
		if (Q->cstack) {
			lua_pushstring(L, "controller");
		} else {
			lua_pushstring(L, "closed controller");
		}
	} else {
		lua_pushnil(L);
	}

	return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x1, %esi
callq 0x10350
testq %rax, %rax
je 0x158ad
movq %rax, %r14
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf900
testl %eax, %eax
je 0x158ad
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
xorl %eax, %eax
testl %ebp, %ebp
cmoveq %rax, %r14
jmp 0x158b0
xorl %r14d, %r14d
testq %r14, %r14
je 0x158c8
cmpq $0x0, 0x230(%r14)
je 0x158d2
leaq 0x1fc0e(%rip), %rsi     # 0x354d4
jmp 0x158d9
movq %rbx, %rdi
callq 0xf980
jmp 0x158e1
leaq 0x1fbf4(%rip), %rsi     # 0x354cd
movq %rbx, %rdi
callq 0xfbd0
movl $0x1, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: cstack_cancel
static int cstack_cancel(lua_State *L) {
	struct callinfo I = CALLINFO_INITIALIZER;
	struct cstack *CS = cstack_self(L);
	int index, fd;

	for (index = 1; index <= lua_gettop(L); index++) {
		fd = cqueue_checkfd(L, &I, index);
		cstack_cancelfd(CS, fd);
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movups 0x1fb3b(%rip), %xmm0    # 0x35504
movaps %xmm0, (%rsp)
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rax, 0x10(%rsp)
callq 0x11143
movq %rax, %r14
movq %rbx, %rdi
callq 0xf920
testl %eax, %eax
jle 0x15a3c
movl $0x1, %r12d
movq %rsp, %r15
movq %rbx, %rdi
movq %r15, %rsi
movl %r12d, %edx
callq 0x14cd9
movq (%r14), %r13
testq %r13, %r13
je 0x15a27
movl %eax, %ebp
movq %r13, %rdi
movl %ebp, %esi
callq 0x11acc
movq 0x238(%r13), %r13
testq %r13, %r13
jne 0x15a11
leal 0x1(%r12), %ebp
movq %rbx, %rdi
callq 0xf920
cmpl %eax, %r12d
movl %ebp, %r12d
jl 0x159f9
xorl %eax, %eax
addq $0x18, %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: cstack_reset
static int cstack_reset(lua_State *L) {
	struct cstack *CS = cstack_self(L);
	struct cqueue *Q;
	int error;

	LIST_FOREACH(Q, &CS->cqueues, le) {
		cqueue_reboot(Q, 1, 0);
	}

	LIST_FOREACH(Q, &CS->cqueues, le) {
		if ((error = cqueue_reboot(Q, 0, 1)))
			return luaL_error(L, "unable to reset continuation queue: %s", cqs_strerror(error));
	}

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
callq 0x11143
movq %rax, %r14
movq (%rax), %r15
testq %r15, %r15
je 0x15a84
movq %r15, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x14d88
movq 0x238(%r15), %r15
jmp 0x15a67
movq (%r14), %r14
testq %r14, %r14
je 0x15aa1
movq %r14, %rdi
callq 0x14f04
testl %eax, %eax
jne 0x15ab0
movq 0x238(%r14), %r14
jmp 0x15a87
xorl %eax, %eax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rsp, %rdi
movl %eax, %esi
movq %rbx, %rdx
callq 0x10b27
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: cstack_running
static int cstack_running(lua_State *L) {
	struct cstack *CS = cstack_self(L);

	if (CS->running) {
		lua_pushvalue(CS->running->L, CS->running->self);
		lua_xmove(CS->running->L, L, 1);
		lua_pushboolean(L, CS->running->T == L);
	} else {
		lua_pushnil(L);
		lua_pushboolean(L, 0);
	}

	return 2;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x11143
movq %rax, %r14
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x15b06
movq 0x8(%rax), %rdi
movl 0x10(%rax), %esi
callq 0xf9c0
movq 0x8(%r14), %rax
movq 0x8(%rax), %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x10230
movq 0x8(%r14), %rax
xorl %esi, %esi
cmpq %rbx, 0x18(%rax)
sete %sil
jmp 0x15b10
movq %rbx, %rdi
callq 0xf980
xorl %esi, %esi
movq %rbx, %rdi
callq 0x10800
movl $0x2, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: dbg_f2ms
static int dbg_f2ms(lua_State *L) {
	int ms = f2ms(luaL_checknumber(L, 1));

	lua_pushinteger(L, ms);
	lua_pushboolean(L, ms == INT_MAX);

	return 2;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl $0x1, %ebp
movl $0x1, %esi
callq 0x10920
movsd %xmm0, 0x8(%rsp)
callq 0xf060
cmpl $0x2, %eax
je 0x15b88
cmpl $0x3, %eax
je 0x15b91
cmpl $0x4, %eax
jne 0x15b8c
movq 0x8(%rsp), %xmm0
movq %xmm0, %rax
testq %rax, %rax
js 0x15b88
mulsd 0x1f49f(%rip), %xmm0    # 0x35010
callq 0xf1c0
movsd 0x1f49a(%rip), %xmm1    # 0x35018
minsd %xmm0, %xmm1
cvttsd2si %xmm1, %ebp
jmp 0x15b91
xorl %ebp, %ebp
jmp 0x15b91
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movslq %ebp, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf910
xorl %esi, %esi
cmpl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
sete %sil
movq %rbx, %rdi
callq 0x10800
movl $0x2, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/cqueues.c
// Function: dbg_f2ts
static int dbg_f2ts(lua_State *L) {
	struct timespec *ts = f2ts(luaL_checknumber(L, 1));

	if (!ts)
		return 0;

	lua_createtable(L, 0, 2);
	lua_pushinteger(L, ts->tv_sec);
	lua_setfield(L, -2, "tv_sec");
	lua_pushinteger(L, ts->tv_nsec);
	lua_setfield(L, -2, "tv_nsec");

	lua_pushboolean(L, ts->tv_sec == LONG_MAX);

	return 2;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
xorpd %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movapd %xmm0, (%r14)
movl $0x1, %esi
callq 0x10920
movsd %xmm0, 0x28(%rsp)
callq 0xf060
cmpl $0x2, %eax
je 0x15cab
cmpl $0x3, %eax
je 0x15c7a
cmpl $0x4, %eax
jne 0x15c8e
movq 0x28(%rsp), %xmm0
movq %xmm0, %rax
testq %rax, %rax
js 0x15cab
leaq 0x8(%rsp), %rdi
callq 0x10830
mulsd 0x1f3f3(%rip), %xmm0    # 0x35020
callq 0xf1c0
ucomisd 0x1f3e6(%rip), %xmm0    # 0x35020
jb 0x15c54
movsd 0x8(%rsp), %xmm0
addsd 0x1f3de(%rip), %xmm0    # 0x35028
movsd %xmm0, 0x8(%rsp)
xorpd %xmm0, %xmm0
movsd 0x8(%rsp), %xmm1
ucomisd 0x1f3ce(%rip), %xmm1    # 0x35030
jae 0x15c93
cvttsd2si %xmm1, %rax
movq %rax, 0x10(%rsp)
cvttsd2si %xmm0, %rax
movq %rax, 0x18(%rsp)
jmp 0x15cab
movq $0x0, 0x10(%rsp)
movq $0x1, 0x18(%rsp)
jmp 0x15cab
xorl %r14d, %r14d
jmp 0x15cab
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
testq %r14, %r14
je 0x15d20
movl $0x2, %ebp
movq %rbx, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x101e0
movq (%r14), %rsi
movq %rbx, %rdi
callq 0xf910
leaq 0x1f813(%rip), %rdx     # 0x354e9
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf530
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0xf910
leaq 0x1f7fa(%rip), %rdx     # 0x354f0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf530
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
xorl %esi, %esi
cmpq %rax, (%r14)
sete %sil
movq %rbx, %rdi
callq 0x10800
jmp 0x15d22
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/socket.c
// Function: cqs_socket_fdopen
lso_error_t cqs_socket_fdopen(lua_State *L, int fd, const struct so_options *_opts) {
	struct so_options opts = *((_opts)? _opts : so_opts());
	struct luasocket *S;
	int type = SOCK_STREAM, error;

	if (0 != getsockopt(fd, SOL_SOCKET, SO_TYPE, &type, &(socklen_t){ sizeof type })) {
		switch (errno) {
		case ENOTSOCK:
		case EOPNOTSUPP:
			break;
		default:
			goto syerr;
		}
	}

	S = lso_newsocket(L, type);

	if ((error = lso_prepsocket(S)))
		goto error;

	opts.fd_close.arg = S;
	opts.fd_close.cb = &lso_closefd;

	if (!(S->socket = so_fdopen(fd, &opts, &error)))
		goto error;

	return 0;
syerr:
	error = errno;
error:
	lua_pop(L, 1);

	return error;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0xb0, %rsp
movl %esi, %ebp
movq %rdi, %rbx
testq %rdx, %rdx
jne 0x15d80
xorps %xmm0, %xmm0
leaq 0x60(%rsp), %rdx
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, 0x40(%rdx)
movaps %xmm0, 0x30(%rdx)
movaps %xmm0, 0x20(%rdx)
movaps %xmm0, (%rdx)
movb $0x1, %al
movb %al, 0x11(%rdx)
movl $0x0, 0x18(%rdx)
movw $0x101, 0x1c(%rdx)      # imm = 0x101
movb %al, 0x1e(%rdx)
movq $0x1, 0x40(%rdx)
movb %al, 0x48(%rdx)
leaq 0x10(%rsp), %rdi
movl $0xa, %ecx
movq %rdx, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x8(%rsp), %rcx
movl $0x1, (%rcx)
leaq 0xc(%rsp), %r8
movl $0x4, (%r8)
movl %ebp, %edi
movl $0x1, %esi
movl $0x3, %edx
callq 0xf9a0
testl %eax, %eax
je 0x15dcd
callq 0xf0a0
movl (%rax), %eax
cmpl $0x5f, %eax
je 0x15dcd
cmpl $0x58, %eax
jne 0x15e1f
movl 0x8(%rsp), %esi
movq %rbx, %rdi
callq 0x15e40
movq %rax, %r14
movq %rax, %rdi
callq 0x1636e
movl %eax, 0x4(%rsp)
testl %eax, %eax
jne 0x15e23
leaq 0x10(%rsp), %rsi
movq %r14, 0x28(%rsi)
leaq 0x15b(%rip), %rax       # 0x15f57
movq %rax, 0x30(%rsi)
leaq 0x4(%rsp), %rdx
movl %ebp, %edi
callq 0xf2f0
movq %rax, %rcx
movq %rax, 0x128(%r14)
xorl %eax, %eax
testq %rcx, %rcx
jne 0x15e34
jmp 0x15e23
movl %eax, 0x4(%rsp)
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x10640
movl 0x4(%rsp), %eax
addq $0xb0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/socket.c
// Function: lso_newsocket
static struct luasocket *lso_newsocket(lua_State *L, int type) {
	struct luasocket *S;

	S = lua_newuserdata(L, sizeof *S);
	*S = *lso_prototype(L);

	S->type = type;

	fifo_init(&S->ibuf.fifo);
	fifo_init(&S->obuf.fifo);

	if (S->onerror != LUA_NOREF && S->onerror != LUA_REFNIL) {
		cqs_getref(L, S->onerror);
		S->onerror = LUA_NOREF;
		cqs_ref(L, &S->onerror);
	}

#if defined LUA_RIDX_MAINTHREAD
	lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_MAINTHREAD);
	S->mainthread = lua_tothread(L, -1);
	lua_pop(L, 1);
#endif

	luaL_getmetatable(L, LSO_CLASS);
	lua_setmetatable(L, -2);

	return S;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movl $0x148, %esi            # imm = 0x148
callq 0xfb00
movq %rax, %r14
leaq 0x1f72f(%rip), %rsi     # 0x3558c
leaq 0x3230c(%rip), %rdx     # 0x48170
movl $0x148, %ecx            # imm = 0x148
movq %rbx, %rdi
callq 0x162e0
movl $0x148, %edx            # imm = 0x148
movq %r14, %rdi
movq %rax, %rsi
callq 0xfa60
movl %ebp, 0x120(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x58(%r14)
movups %xmm0, 0x68(%r14)
movups %xmm0, 0x78(%r14)
xorl %eax, %eax
movl %eax, 0x88(%r14)
movups %xmm0, 0xc0(%r14)
movups %xmm0, 0xd0(%r14)
movups %xmm0, 0xe0(%r14)
movl %eax, 0xf0(%r14)
movslq 0x130(%r14), %rdx
cmpq $-0x3, %rdx
ja 0x15efb
movq %rbx, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0xf450
movl $0xfffffffe, 0x130(%r14) # imm = 0xFFFFFFFE
movq %rbx, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0x10930
movl %eax, 0x130(%r14)
movl $0x1, %edx
movq %rbx, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0xf450
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf460
movq %rax, 0x138(%r14)
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x10640
leaq 0x1f16a(%rip), %rdx     # 0x3509f
movq %rbx, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
callq 0xf1e0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x10910
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/socket.c
// Function: lso_closefd
static int lso_closefd(int *fd, void *arg) {
	struct luasocket *S = arg;

	if (S->mainthread) {
		cqs_cancelfd(S->mainthread, *fd);
		cqs_closefd(fd);
	}

	return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x138(%rsi), %rdi
testq %rdi, %rdi
je 0x15f80
movl (%rbx), %esi
callq 0xfc10
movl (%rbx), %edi
cmpl $-0x1, %edi
je 0x15f80
callq 0x10a10
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/socket.c
// Function: lso_singleton
static void *lso_singleton(lua_State *L, const void *key, const void *init, size_t len) {
	void *p;

	lua_rawgetp(L, LUA_REGISTRYINDEX, key);
	p = lua_touserdata(L, -1);
	lua_pop(L, 1);

	if (p)
		return p;

	p = lua_newuserdata(L, len);
	if (init)
		memcpy(p, init, len);
	else
		memset(p, 0, len);
	lua_rawsetp(L, LUA_REGISTRYINDEX, key);

	return p;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r14
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
movq %rbx, %rdx
callq 0xf080
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x10350
movq %rax, %r12
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x10640
testq %r12, %r12
jne 0x16361
movq %r14, %rdi
movq %r15, %rsi
callq 0xfb00
movq %rax, %r12
movq %rax, %rdi
testq %r13, %r13
je 0x16347
movq %r13, %rsi
movq %r15, %rdx
callq 0xfa60
jmp 0x16351
xorl %esi, %esi
movq %r15, %rdx
callq 0xf750
movq %r14, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
movq %rbx, %rdx
callq 0xf160
movq %r12, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/socket.c
// Function: lso_adjbufs
static lso_error_t lso_adjbufs(struct luasocket *S) {
	int error;

	if ((error = lso_adjbuf(&S->ibuf.fifo, S->ibuf.bufsiz)))
		return error;

	if ((error = lso_adjbuf(&S->obuf.fifo, S->obuf.bufsiz)))
		return error;

	return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x50(%rdi), %rsi
cmpq $-0x1, %rsi
je 0x16387
leaq 0x58(%rbx), %rdi
callq 0x163ad
jmp 0x16389
xorl %eax, %eax
testl %eax, %eax
je 0x1638f
popq %rbx
retq
movq 0xb8(%rbx), %rsi
cmpq $-0x1, %rsi
je 0x163a9
addq $0xc0, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0x163ad
xorl %eax, %eax
jmp 0x1638d
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/fifo.h
// Function: fifo_realloc
static int fifo_realloc(struct fifo *fifo, size_t size) {
	void *tmp;

	if (fifo->size >= size)
		return 0;
	if (fifo_type(fifo) == FIFO_STATIC)
		return ENOMEM;

	fifo_realign(fifo);

	size = fifo_roundup(size);

	if (!(tmp = realloc(fifo->base, size)))
		return errno;

	fifo->base = tmp;
	fifo->size = size;

	return 0;
}

// Assembly:
xorl %eax, %eax
cmpq %rsi, 0x18(%rdi)
jae 0x1645b
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0xc, %eax
cmpq $0x0, (%rdi)
jne 0x16456
movq %rsi, %r14
movq %rbx, %rdi
callq 0x1645c
movq $-0x1, %r15
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
cmpq %rax, %r14
ja 0x16432
decq %r14
movq %r14, %rax
shrq %rax
orq %r14, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x10, %rax
orq %rcx, %rax
movq %rax, %r15
shrq $0x20, %r15
orq %rax, %r15
incq %r15
movq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x10620
testq %rax, %rax
je 0x1644f
movq %rax, 0x10(%rbx)
movq %r15, 0x18(%rbx)
xorl %eax, %eax
jmp 0x16456
callq 0xf0a0
movl (%rax), %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/fifo.h
// Function: fifo_realign
static void fifo_realign(struct fifo *fifo) {
	if (fifo->size - fifo->head >= fifo->count) {
		memmove(fifo->base, &fifo->base[fifo->head], fifo->count);
		fifo->head = 0;
	} else {
		unsigned char tmp[FIFO_TMPBUFSIZ];
		unsigned n, m;

		while (fifo->head != 0) {
			n = FIFO_MIN(fifo->head, sizeof tmp);
			m = fifo->size - n;

			memcpy(tmp, fifo->base, n);
			memmove(fifo->base, &fifo->base[n], m);
			memcpy(&fifo->base[m], tmp, n);
			fifo->head -= n;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x808, %rsp            # imm = 0x808
movq %rdi, %rbx
movq 0x18(%rdi), %rax
movq 0x20(%rdi), %rsi
subq %rsi, %rax
movq 0x28(%rdi), %rdx
cmpq %rdx, %rax
jae 0x164e8
movq 0x20(%rbx), %r14
testq %r14, %r14
je 0x164fc
movl $0x800, %ebp            # imm = 0x800
movq %rsp, %r15
cmpq %rbp, %r14
cmovaeq %rbp, %r14
movl 0x18(%rbx), %r12d
subl %r14d, %r12d
movq 0x10(%rbx), %r13
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0xfa60
leaq (%r14,%r13), %rsi
movq %r13, %rdi
movq %r12, %rdx
callq 0x105f0
addq 0x10(%rbx), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xfa60
movq 0x20(%rbx), %rax
subq %r14, %rax
movq %rax, 0x20(%rbx)
movq %rax, %r14
jne 0x16495
jmp 0x164fc
movq 0x10(%rbx), %rdi
addq %rdi, %rsi
callq 0x105f0
movq $0x0, 0x20(%rbx)
addq $0x808, %rsp            # imm = 0x808
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/socket.c
// Function: lso_connect1
static lso_nargs_t lso_connect1(lua_State *L) {
	struct luasocket *S = lso_checkself(L, 1);
	int error;

	so_clear(S->socket);

	if (!(error = so_connect(S->socket))) {
		lua_pushvalue(L, 1);

		return 1;
	} else {
		lua_pushnil(L);
		lua_pushinteger(L, error);

		return 2;
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x18609
movq %rax, %r14
movq 0x128(%rax), %rdi
callq 0xf840
movq 0x128(%r14), %rdi
callq 0xf7e0
testl %eax, %eax
je 0x16555
movl %eax, %ebp
movq %rbx, %rdi
callq 0xf980
movslq %ebp, %rsi
movq %rbx, %rdi
callq 0xf910
movl $0x2, %ebp
jmp 0x16567
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf9c0
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/socket.c
// Function: lso_listen1
static lso_nargs_t lso_listen1(lua_State *L) {
	struct luasocket *S = lso_checkself(L, 1);
	int error;

	so_clear(S->socket);

	if (!(error = so_listen(S->socket))) {
		lua_pushvalue(L, 1);

		return 1;
	} else {
		lua_pushnil(L);
		lua_pushinteger(L, error);

		return 2;
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x18609
movq %rax, %r14
movq 0x128(%rax), %rdi
callq 0xf840
movq 0x128(%r14), %rdi
callq 0xffc0
testl %eax, %eax
je 0x165b5
movl %eax, %ebp
movq %rbx, %rdi
callq 0xf980
movslq %ebp, %rsi
movq %rbx, %rdi
callq 0xf910
movl $0x2, %ebp
jmp 0x165c7
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf9c0
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq