// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x273ca(%rip), %rsi     # 0x49031
callq 0x102d0
cmpl $0x0, %eax
je 0x21cd0
movq -0x8(%rbp), %rdi
leaq 0x381b4(%rip), %rsi     # 0x59e30
xorl %edx, %edx
callq 0x10390
movq -0x8(%rbp), %rdi
movsd 0x26371(%rip), %xmm0    # 0x48000
movl $0x88, %esi
callq 0x106d0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x6, %edx
callq 0x10330
movq -0x8(%rbp), %rdi
leaq 0x3819c(%rip), %rsi     # 0x59e50
xorl %edx, %edx
callq 0x10390
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x264d0(%rip), %rdx     # 0x4819b
callq 0xf580
movq -0x8(%rbp), %rdi
movsd 0x26324(%rip), %xmm0    # 0x48000
movl $0x88, %esi
callq 0x106d0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0xd, %edx
callq 0x10330
movq -0x8(%rbp), %rdi
leaq 0x381bf(%rip), %rsi     # 0x59ec0
xorl %edx, %edx
callq 0x10390
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpq $0xa, %rax
jae 0x21db2
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x38014(%rip), %rax     # 0x59d40
shlq $0x4, %rcx
addq %rcx, %rax
movslq 0x8(%rax), %rsi
callq 0xf9a0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x37ff4(%rip), %rax     # 0x59d40
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf580
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x37fd0(%rip), %rax     # 0x59d40
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0xfcc0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x37fb1(%rip), %rax     # 0x59d40
shlq $0x4, %rcx
addq %rcx, %rax
movslq 0x8(%rax), %rdx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xfc00
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x21d0f
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpq $0x5, %rax
jae 0x21e5c
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x3800a(%rip), %rax     # 0x59de0
shlq $0x4, %rcx
addq %rcx, %rax
movslq 0x8(%rax), %rsi
callq 0xf9a0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x37fea(%rip), %rax     # 0x59de0
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf580
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x37fc6(%rip), %rax     # 0x59de0
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0xfcc0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x37fa7(%rip), %rax     # 0x59de0
shlq $0x4, %rcx
addq %rcx, %rax
movslq 0x8(%rax), %rdx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xfc00
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x21db9
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
callq 0x21ea0
movq -0x18(%rbp), %rdi
movslq %eax, %rsi
callq 0xf9a0
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x271b7(%rip), %rdx     # 0x4903c
callq 0xf580
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)