// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x2b4a0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10210
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x10330
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0xf9a0
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x1e4f6(%rip), %rdx     # 0x496fe
callq 0xf580
movq -0x8(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x10330
movq -0x8(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x10330
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0xf9a0
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x1cfb5(%rip), %rdx     # 0x481fd
callq 0xf580
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0xf9a0
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x1ea85(%rip), %rdx     # 0x49cf3
callq 0xf580
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x1d838(%rip), %rdx     # 0x48abb
callq 0xf580
jmp 0x2b28a
movq -0x8(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x10330
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0xf9a0
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x1cf45(%rip), %rdx     # 0x481fd
callq 0xf580
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0xf9a0
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x1ea15(%rip), %rdx     # 0x49cf3
callq 0xf580
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x1d7cd(%rip), %rdx     # 0x48ac0
callq 0xf580
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x1e3fe(%rip), %rdx     # 0x49706
callq 0xf580
movq -0x8(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x10330
movq -0x8(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x10330
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0xf9a0
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x1ceb5(%rip), %rdx     # 0x481fd
callq 0xf580
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0xf9a0
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x1e985(%rip), %rdx     # 0x49cf3
callq 0xf580
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x1d738(%rip), %rdx     # 0x48abb
callq 0xf580
jmp 0x2b38a
movq -0x8(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x10330
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0xf9a0
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x1ce45(%rip), %rdx     # 0x481fd
callq 0xf580
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0xf9a0
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x1e915(%rip), %rdx     # 0x49cf3
callq 0xf580
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x1d6cd(%rip), %rdx     # 0x48ac0
callq 0xf580
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x221fe(%rip), %rdx     # 0x4d606
callq 0xf580
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)