// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/signal.c
// Function: luaopen__cqueues_signal
int luaopen__cqueues_signal(lua_State *L) {
	static const struct {
		const char *name;
		int value;
	} siglist[] = {
		{ "SIGALRM", SIGALRM },
		{ "SIGCHLD", SIGCHLD },
		{ "SIGHUP",  SIGHUP  },
		{ "SIGINT",  SIGINT  },
		{ "SIGKILL", SIGKILL },
		{ "SIGPIPE", SIGPIPE },
		{ "SIGQUIT", SIGQUIT },
		{ "SIGTERM", SIGTERM },
		{ "SIGUSR1", SIGUSR1 },
		{ "SIGUSR2", SIGUSR2 },
	}, flag[] = {
		{ "SIGNALFD",      SIGNAL_SIGNALFD },
		{ "EVFILT_SIGNAL", SIGNAL_EVFILT_SIGNAL },
		{ "SIGTIMEDWAIT",  SIGNAL_SIGTIMEDWAIT },
		{ "KQUEUE",        SIGNAL_KQUEUE },
		{ "KQUEUE1",       SIGNAL_KQUEUE1 },
	};
	unsigned i;

	if (luaL_newmetatable(L, LSL_CLASS)) {
		luaL_setfuncs(L, lsl_metatable, 0);

		luaL_newlib(L, lsl_methods);
		lua_setfield(L, -2, "__index");
	}

	luaL_newlib(L, ls_globals);

	for (i = 0; i < sizeof siglist / sizeof *siglist; i++) {
		lua_pushinteger(L, siglist[i].value);
		lua_setfield(L, -2, siglist[i].name);

		lua_pushstring(L, siglist[i].name);
		lua_rawseti(L, -2, siglist[i].value);
	}

	for (i = 0; i < sizeof flag / sizeof *flag; i++) {
		lua_pushinteger(L, flag[i].value);
		lua_setfield(L, -2, flag[i].name);

		lua_pushstring(L, flag[i].name);
		lua_rawseti(L, -2, flag[i].value);
	}

	lua_pushinteger(L, signal_features());
	lua_setfield(L, -2, "FEATURES");

	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x1a16a(%rip), %rsi     # 0x35e85
callq 0x10180
testl %eax, %eax
je 0x1bd7e
leaq 0x28ee5(%rip), %rsi     # 0x44c10
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10240
movsd 0x192c3(%rip), %xmm0    # 0x35000
movl $0x88, %esi
movq %rbx, %rdi
callq 0x10530
movq %rbx, %rdi
xorl %esi, %esi
movl $0x6, %edx
callq 0x101e0
leaq 0x28ed0(%rip), %rsi     # 0x44c30
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10240
leaq 0x193b6(%rip), %rdx     # 0x35127
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf530
movsd 0x1927a(%rip), %xmm0    # 0x35000
movl $0x88, %esi
movq %rbx, %rdi
callq 0x10530
movq %rbx, %rdi
xorl %esi, %esi
movl $0xd, %edx
callq 0x101e0
leaq 0x28ef7(%rip), %rsi     # 0x44ca0
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10240
movl $0x8, %r12d
leaq 0x28d60(%rip), %r13     # 0x44b20
movslq (%r12,%r13), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf910
movq -0x8(%r12,%r13), %r15
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r15, %rdx
callq 0xf530
movq %rbx, %rdi
movq %r15, %rsi
callq 0xfbd0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r14, %rdx
callq 0xfb20
addq $0x10, %r12
cmpq $0xa8, %r12
jne 0x1bdc0
movl $0x8, %r12d
leaq 0x28da7(%rip), %r13     # 0x44bc0
movslq (%r12,%r13), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf910
movq -0x8(%r12,%r13), %r15
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r15, %rdx
callq 0xf530
movq %rbx, %rdi
movq %r15, %rsi
callq 0xfbd0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r14, %rdx
callq 0xfb20
addq $0x10, %r12
cmpq $0x58, %r12
jne 0x1be19
movl $0x5, %esi
movq %rbx, %rdi
callq 0xf910
leaq 0x1a01a(%rip), %rdx     # 0x35e90
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf530
movl $0x1, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq