// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/cqueues.c
// Function: luaopen__cqueues
int luaopen__cqueues(lua_State *L) {
	/* initialize our dependencies used for fast metatable lookup */
	cqs_requiref(L, "_cqueues.socket", &luaopen__cqueues_socket, 0);
	cqs_requiref(L, "_cqueues.condition", &luaopen__cqueues_condition, 0);
	lua_pop(L, 2);

	/* push functions with shared upvalues for fast metatable lookup */
	cqs_pushnils(L, 3); /* initial upvalues */
	cqs_newmetatable(L, CQUEUE_CLASS, cqueue_methods, cqueue_metatable, 3);
	lua_pushvalue(L, -1); /* push self as replacement upvalue */
	cqs_setmetaupvalue(L, -2, 1); /* insert self as 1st upvalue */
	luaL_getmetatable(L, CQS_SOCKET);
	cqs_setmetaupvalue(L, -2, 2); /* insert socket as 2nd upvalue */
	luaL_getmetatable(L, CQS_CONDITION);
	cqs_setmetaupvalue(L, -2, 3); /* insert condition as 3rd upvalue */

	luaL_newlibtable(L, cqueues_globals);
	lua_pushvalue(L, -2); /* capture metatable as upvalue */
	luaL_getmetatable(L, CQS_SOCKET);
	luaL_getmetatable(L, CQS_CONDITION);
	luaL_setfuncs(L, cqueues_globals, 3);

	/* add magic value used to accomplish multilevel yielding */
	lua_pushlightuserdata(L, CQUEUE__POLL);
	lua_setfield(L, -2, "_POLL");

	/* add our version constants */
	lua_pushliteral(L, CQUEUES_VENDOR);
	lua_setfield(L, -2, "VENDOR");

	lua_pushinteger(L, CQUEUES_VERSION);
	lua_setfield(L, -2, "VERSION");

#if defined CQUEUES_COMMIT
	if (sizeof CQUEUES_COMMIT > 1) {
		lua_pushliteral(L, CQUEUES_COMMIT);
		lua_setfield(L, -2, "COMMIT");
	}
#endif

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x23e80(%rip), %rsi     # 0x35069
movq 0x35db0(%rip), %rdx     # 0x46fa0
callq 0x114dd
leaq 0x23e7d(%rip), %rsi     # 0x35079
movq 0x35db5(%rip), %rdx     # 0x46fb8
movq %rbx, %rdi
callq 0x114dd
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x10640
leaq 0x23f40(%rip), %rdx     # 0x3515f
movl $0x3, %ebp
movq %rbx, %rdi
movl $0x3, %esi
callq 0xfca0
movq %rbx, %rdi
callq 0xf980
decl %ebp
jne 0x11231
leaq 0x23e48(%rip), %rsi     # 0x3508c
leaq 0x32e15(%rip), %rdx     # 0x44060
leaq 0x32eee(%rip), %rcx     # 0x44140
movq %rbx, %rdi
movl $0x3, %r8d
callq 0x11005
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf9c0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf280
movl %eax, %ebp
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf9c0
movq %rbx, %rdi
movl %ebp, %esi
movl $0x1, %edx
callq 0x11927
leaq 0x23e88(%rip), %r15     # 0x35127
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0xf1e0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf9c0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl $0x1, %edx
callq 0x11927
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x10640
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x10640
leaq 0x23db3(%rip), %r14     # 0x3509f
movq %rbx, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
movq %r14, %rdx
callq 0xf1e0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf280
movl %eax, %ebp
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf9c0
movq %rbx, %rdi
movl %ebp, %esi
movl $0x2, %edx
callq 0x11927
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0xf1e0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf9c0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl $0x2, %edx
callq 0x11927
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x10640
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x10640
leaq 0x23cdc(%rip), %r12     # 0x35050
movq %rbx, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
movq %r12, %rdx
callq 0xf1e0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf280
movl %eax, %ebp
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf9c0
movq %rbx, %rdi
movl %ebp, %esi
movl $0x3, %edx
callq 0x11927
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0xf1e0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf9c0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl $0x3, %edx
callq 0x11927
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x10640
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x10640
movq %rbx, %rdi
xorl %esi, %esi
movl $0x7, %edx
callq 0x101e0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf9c0
movq %rbx, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
movq %r14, %rdx
callq 0xf1e0
movq %rbx, %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
movq %r12, %rdx
callq 0xf1e0
leaq 0x32d28(%rip), %rsi     # 0x44160
movq %rbx, %rdi
movl $0x3, %edx
callq 0x10240
movq 0x35b14(%rip), %rsi     # 0x46f60
movq %rbx, %rdi
callq 0x10150
leaq 0x23c4f(%rip), %rdx     # 0x350aa
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf530
leaq 0x23c41(%rip), %rsi     # 0x350b0
movq %rbx, %rdi
callq 0xfbd0
leaq 0x23c47(%rip), %rdx     # 0x350c5
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf530
movl $0x1343d16, %esi        # imm = 0x1343D16
movq %rbx, %rdi
callq 0xf910
leaq 0x23c2d(%rip), %rdx     # 0x350cc
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf530
leaq 0x23c21(%rip), %rsi     # 0x350d4
movq %rbx, %rdi
callq 0xfbd0
leaq 0x23c3b(%rip), %rdx     # 0x350fd
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf530
movl $0x1, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq