// File: /workspace/github_c_makefile_star2_O1/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 0x171af(%rip), %rsi     # 0x361e7
callq 0x10180
leaq 0x2641c(%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 0x26359(%rip), %rsi     # 0x453c0
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10240
leaq 0x160af(%rip), %rdx     # 0x35127
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf530
movsd 0x15f73(%rip), %xmm0    # 0x35000
movl $0x88, %esi
movq %rbx, %rdi
callq 0x10530
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x101e0
leaq 0x263d0(%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 0x26164(%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 0x1f0dc
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 0x1f10c
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf280
movl %eax, %ebp
xorl %r14d, %r14d
leaq 0x2612e(%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 0x1f152
leaq 0x1706c(%rip), %rdx     # 0x361f2
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 0x26105(%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 0x1f1bb
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 0x1f1ee
leaq 0x16fd8(%rip), %rdx     # 0x361fa
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 0x260b9(%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 0x1f257
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 0x1f28d
leaq 0x16f3d(%rip), %rdx     # 0x36201
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf530
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xf280
movl %eax, %ebp
leaq 0x16ef8(%rip), %rsi     # 0x361df
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