These days, top uses the sysctls I mentioned, so if you want to see how top uses the sysctls, you just have to read the C code. I was looking on a 6.3-RELEASE i386 machine to try to get as near as possible to pfSense.
If I have missed anything from my answer or it's inaccurate, do correct it.