// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x36f46(%rip), %rsi     # 0x480dd
movq 0x4adfa(%rip), %rdx     # 0x5bf98
xorl %ecx, %ecx
callq 0x11370
movq -0x8(%rbp), %rdi
leaq 0x36f3d(%rip), %rsi     # 0x480ed
movq 0x4adf9(%rip), %rdx     # 0x5bfb0
xorl %ecx, %ecx
callq 0x11370
movq -0x8(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x107f0
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x11410
movq -0x8(%rbp), %rdi
leaq 0x36f1b(%rip), %rsi     # 0x48100
leaq 0x48094(%rip), %rdx     # 0x59280
leaq 0x4816d(%rip), %rcx     # 0x59360
movl $0x3, %r8d
callq 0x10e50
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xfa50
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl $0x1, %edx
callq 0x10f70
movq -0x8(%rbp), %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
leaq 0x36ee4(%rip), %rdx     # 0x48113
callq 0xf200
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl $0x2, %edx
callq 0x10f70
movq -0x8(%rbp), %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
leaq 0x36e6d(%rip), %rdx     # 0x480c4
callq 0xf200
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl $0x3, %edx
callq 0x10f70
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x7, %edx
callq 0x10330
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xfa50
movq -0x8(%rbp), %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
leaq 0x36e76(%rip), %rdx     # 0x48113
callq 0xf200
movq -0x8(%rbp), %rdi
movl $0xfff0b9d8, %esi       # imm = 0xFFF0B9D8
leaq 0x36e12(%rip), %rdx     # 0x480c4
callq 0xf200
movq -0x8(%rbp), %rdi
leaq 0x480be(%rip), %rsi     # 0x59380
movl $0x3, %edx
callq 0x10390
movq -0x8(%rbp), %rdi
movq 0x4ac81(%rip), %rsi     # 0x5bf58
callq 0x102a0
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x36e32(%rip), %rdx     # 0x4811e
callq 0xf580
movq -0x8(%rbp), %rdi
leaq 0x36e28(%rip), %rsi     # 0x48124
callq 0xfcc0
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x36e28(%rip), %rdx     # 0x48139
callq 0xf580
movq -0x8(%rbp), %rdi
movl $0x1343d16, %esi        # imm = 0x1343D16
callq 0xf9a0
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x36e0c(%rip), %rdx     # 0x48140
callq 0xf580
movq -0x8(%rbp), %rdi
leaq 0x36e04(%rip), %rsi     # 0x48148
callq 0xfcc0
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x36e18(%rip), %rdx     # 0x48171
callq 0xf580
movl $0x1, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)