// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x16c70(%rip), %rsi     # 0x30e5d
callq 0x10210
testl %eax, %eax
je 0x1a24c
leaq 0x28a03(%rip), %rsi     # 0x42c00
movq %rbx, %rdi
xorl %edx, %edx
callq 0x102d0
movsd 0x15df1(%rip), %xmm0    # 0x30000
movl $0x88, %esi
movq %rbx, %rdi
callq 0x105e0
pushq $0x6
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10270
leaq 0x289f0(%rip), %rsi     # 0x42c20
movq %rbx, %rdi
xorl %edx, %edx
callq 0x102d0
leaq 0x15ee6(%rip), %rdx     # 0x30127
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0xf550
movsd 0x15dac(%rip), %xmm0    # 0x30000
movl $0x88, %esi
movq %rbx, %rdi
callq 0x105e0
pushq $0xd
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10270
leaq 0x28a1b(%rip), %rsi     # 0x42c90
movq %rbx, %rdi
xorl %edx, %edx
callq 0x102d0
pushq $0x8
popq %r12
leaq 0x28886(%rip), %r13     # 0x42b10
pushq $-0x2
popq %rbp
cmpq $0xa8, %r12
je 0x1a2d5
movslq (%r12,%r13), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf960
movq -0x8(%r12,%r13), %r15
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0xf550
movq %rbx, %rdi
movq %r15, %rsi
callq 0xfc50
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0xfb90
addq $0x10, %r12
jmp 0x1a28d
pushq $0x8
popq %r12
leaq 0x288d0(%rip), %r13     # 0x42bb0
pushq $-0x2
popq %rbp
cmpq $0x58, %r12
je 0x1a328
movslq (%r12,%r13), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf960
movq -0x8(%r12,%r13), %r15
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0xf550
movq %rbx, %rdi
movq %r15, %rsi
callq 0xfc50
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0xfb90
addq $0x10, %r12
jmp 0x1a2e3
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0xf960
leaq 0x16b2e(%rip), %rdx     # 0x30e68
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0xf550
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq