// File: /workspace/github_c_makefile_star2_O3/wahern[P]cqueues/src/dns.c
// Function: res_stat
static int res_stat(lua_State *L) {
	struct dns_resolver *R = res_check(L, 1);
	const struct dns_stat *st = dns_res_stat(R);

	lua_newtable(L);

	lua_pushinteger(L, st->queries);
	lua_setfield(L, -2, "queries");

#define setboth(st, table) do { \
	lua_newtable(L); \
	lua_pushinteger(L, (st).count); \
	lua_setfield(L, -2, "count"); \
	lua_pushinteger(L, (st).bytes); \
	lua_setfield(L, -2, "bytes"); \
	lua_setfield(L, -2, table); \
} while (0)

	lua_newtable(L);
	setboth(st->udp.sent, "sent");
	setboth(st->udp.rcvd, "rcvd");
	lua_setfield(L, -2, "udp");

	lua_newtable(L);
	setboth(st->tcp.sent, "sent");
	setboth(st->tcp.rcvd, "rcvd");
	lua_setfield(L, -2, "tcp");

#undef setboth

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x13c20(%rip), %rdx     # 0x3623c
movl $0x1, %esi
callq 0xfcf0
movq (%rax), %rdi
testq %rdi, %rdi
jne 0x22648
movq %rax, %r14
leaq 0x13ecd(%rip), %rdx     # 0x36505
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf3f0
movq (%r14), %rdi
callq 0x100c0
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x101e0
movq (%r14), %rsi
movq %rbx, %rdi
callq 0xf910
leaq 0x13ea8(%rip), %rdx     # 0x36516
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf530
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x101e0
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x101e0
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0xf910
leaq 0x12ae3(%rip), %r15     # 0x35189
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r15, %rdx
callq 0xf530
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0xf910
leaq 0x14276(%rip), %r12     # 0x3693f
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r12, %rdx
callq 0xf530
leaq 0x13207(%rip), %r13     # 0x358e7
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r13, %rdx
callq 0xf530
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x101e0
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0xf910
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r15, %rdx
callq 0xf530
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0xf910
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r12, %rdx
callq 0xf530
leaq 0x131b1(%rip), %rbp     # 0x358ec
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %rbp, %rdx
callq 0xf530
leaq 0x13dcc(%rip), %rdx     # 0x3651e
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf530
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x101e0
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x101e0
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0xf910
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r15, %rdx
callq 0xf530
movq 0x30(%r14), %rsi
movq %rbx, %rdi
callq 0xf910
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r12, %rdx
callq 0xf530
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r13, %rdx
callq 0xf530
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x101e0
movq 0x38(%r14), %rsi
movq %rbx, %rdi
callq 0xf910
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r15, %rdx
callq 0xf530
movq 0x40(%r14), %rsi
movq %rbx, %rdi
callq 0xf910
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r12, %rdx
callq 0xf530
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %rbp, %rdx
callq 0xf530
leaq 0x1688c(%rip), %rdx     # 0x390a6
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf530
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq