// File: /workspace/github_c_makefile_star2_O1/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 0x13b1b(%rip), %rdx     # 0x36274
movl $0x1, %esi
callq 0xfcf0
movq %rax, %r14
cmpq $0x0, (%rax)
jne 0x22780
leaq 0x13dca(%rip), %rdx     # 0x3653d
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 0x13da5(%rip), %rdx     # 0x3654e
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 0x129a8(%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 0x1416b(%rip), %r12     # 0x3696f
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r12, %rdx
callq 0xf530
leaq 0x130f4(%rip), %r13     # 0x3590f
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 0x1309e(%rip), %rbp     # 0x35914
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %rbp, %rdx
callq 0xf530
leaq 0x13cc9(%rip), %rdx     # 0x36556
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 0x16791(%rip), %rdx     # 0x390e6
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