// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/dns.c
// Function: luaopen__cqueues_dns_packet
int luaopen__cqueues_dns_packet(lua_State *L) {
	static const struct cqs_macro section[] = {
		{ "QUESTION", DNS_S_QD }, { "ANSWER", DNS_S_AN },
		{ "AUTHORITY", DNS_S_NS }, { "ADDITIONAL", DNS_S_AR },
	};
	static const struct cqs_macro shortsec[] = {
		{ "QD", DNS_S_QD }, { "AN", DNS_S_AN },
		{ "NS", DNS_S_NS }, { "AR", DNS_S_AR },
	};
	static const struct cqs_macro opcode[] = {
		{ "QUERY", DNS_OP_QUERY }, { "IQUERY", DNS_OP_IQUERY },
		{ "STATUS", DNS_OP_STATUS }, { "NOTIFY", DNS_OP_NOTIFY },
		{ "UPDATE", DNS_OP_UPDATE },
	};
	static const struct cqs_macro rcode[] = {
		{ "NOERROR", DNS_RC_NOERROR }, { "FORMERR", DNS_RC_FORMERR },
		{ "SERVFAIL", DNS_RC_SERVFAIL }, { "NXDOMAIN", DNS_RC_NXDOMAIN },
		{ "NOTIMP", DNS_RC_NOTIMP }, { "REFUSED", DNS_RC_REFUSED },
		{ "YXDOMAIN", DNS_RC_YXDOMAIN }, { "YXRRSET", DNS_RC_YXRRSET },
		{ "NXRRSET", DNS_RC_NXRRSET }, { "NOTAUTH", DNS_RC_NOTAUTH },
		{ "NOTZONE", DNS_RC_NOTZONE },
	};
	static const struct cqs_macro other[] = {
		{ "QBUFSIZ", DNS_P_QBUFSIZ },
	};

	cqs_newmetatable(L, PACKET_CLASS, pkt_methods, pkt_metatable, 0);

	luaL_newlib(L, pkt_globals);

	lua_newtable(L);
	cqs_setmacros(L, -1, section, countof(section), 1);
	cqs_setmacros(L, -1, shortsec, countof(shortsec), 0);
	lua_setfield(L, -2, "section");

	lua_newtable(L);
	cqs_setmacros(L, -1, opcode, countof(opcode), 1);
	lua_setfield(L, -2, "opcode");

	lua_newtable(L);
	cqs_setmacros(L, -1, rcode, countof(rcode), 1);
	lua_setfield(L, -2, "rcode");

	cqs_setmacros(L, -1, other, countof(other), 0);

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x172bb(%rip), %rsi     # 0x361af
callq 0x10180
leaq 0x26560(%rip), %rsi     # 0x45460
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10240
movq %rbx, %rdi
xorl %esi, %esi
movl $0x9, %edx
callq 0x101e0
leaq 0x2649d(%rip), %rsi     # 0x453c0
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10240
leaq 0x161f3(%rip), %rdx     # 0x35127
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf530
movsd 0x160b7(%rip), %xmm0    # 0x35000
movl $0x88, %esi
movq %rbx, %rdi
callq 0x10530
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x101e0
leaq 0x26514(%rip), %rsi     # 0x45480
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10240
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x101e0
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf280
movl %eax, %ebp
leaq 0x262a8(%rip), %r15     # 0x45240
movq (%r14,%r15), %rsi
movq %rbx, %rdi
callq 0xfbd0
movslq 0x8(%r14,%r15), %rsi
movq %rbx, %rdi
callq 0xf910
movq %rbx, %rdi
movl %ebp, %esi
callq 0xfa10
addq $0x10, %r14
cmpq $0x40, %r14
jne 0x1ef98
xorl %r14d, %r14d
movslq 0x8(%r14,%r15), %rsi
movq %rbx, %rdi
callq 0xf910
movq (%r14,%r15), %rsi
movq %rbx, %rdi
callq 0xfbd0
movq %rbx, %rdi
movl %ebp, %esi
callq 0xfa10
addq $0x10, %r14
cmpq $0x40, %r14
jne 0x1efc8
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf280
movl %eax, %ebp
xorl %r14d, %r14d
leaq 0x26272(%rip), %r15     # 0x45280
movq (%r14,%r15), %rsi
movq %rbx, %rdi
callq 0xfbd0
movslq 0x8(%r14,%r15), %rsi
movq %rbx, %rdi
callq 0xf910
movq %rbx, %rdi
movl %ebp, %esi
callq 0xfa10
addq $0x10, %r14
cmpq $0x40, %r14
jne 0x1f00e
leaq 0x17178(%rip), %rdx     # 0x361ba
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf530
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x101e0
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf280
movl %eax, %ebp
movl $0x8, %r15d
leaq 0x26249(%rip), %r14     # 0x452c0
movq -0x8(%r15,%r14), %rsi
movq %rbx, %rdi
callq 0xfbd0
movslq (%r15,%r14), %rsi
movq %rbx, %rdi
callq 0xf910
movq %rbx, %rdi
movl %ebp, %esi
callq 0xfa10
addq $0x10, %r15
cmpq $0x58, %r15
jne 0x1f077
movl $0x8, %r15d
movslq (%r15,%r14), %rsi
movq %rbx, %rdi
callq 0xf910
movq -0x8(%r15,%r14), %rsi
movq %rbx, %rdi
callq 0xfbd0
movq %rbx, %rdi
movl %ebp, %esi
callq 0xfa10
addq $0x10, %r15
cmpq $0x58, %r15
jne 0x1f0aa
leaq 0x170e4(%rip), %rdx     # 0x361c2
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf530
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x101e0
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf280
movl %eax, %ebp
movl $0x8, %r15d
leaq 0x261fd(%rip), %r14     # 0x45310
movq -0x8(%r15,%r14), %rsi
movq %rbx, %rdi
callq 0xfbd0
movslq (%r15,%r14), %rsi
movq %rbx, %rdi
callq 0xf910
movq %rbx, %rdi
movl %ebp, %esi
callq 0xfa10
addq $0x10, %r15
cmpq $0xb8, %r15
jne 0x1f113
movl $0x8, %r15d
movslq (%r15,%r14), %rsi
movq %rbx, %rdi
callq 0xf910
movq -0x8(%r15,%r14), %rsi
movq %rbx, %rdi
callq 0xfbd0
movq %rbx, %rdi
movl %ebp, %esi
callq 0xfa10
addq $0x10, %r15
cmpq $0xb8, %r15
jne 0x1f149
leaq 0x17049(%rip), %rdx     # 0x361c9
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf530
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf280
movl %eax, %ebp
leaq 0x17004(%rip), %rsi     # 0x361a7
movq %rbx, %rdi
callq 0xfbd0
movl $0x160, %esi            # imm = 0x160
movq %rbx, %rdi
callq 0xf910
movq %rbx, %rdi
movl %ebp, %esi
callq 0xfa10
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq