As you might imagine, Facebook's initial public offering is going to amount to a pretty hefty tax bill for the company's main stakeholders, but don't you worry, they have lawyers who are helping them avoid paying as much of it as possible.

The biggest tax burden, unsurprisingly, falls to the senior-most Facebook employees and biggest shareholders who will be collectively saddled with a bill from Uncle Sam to the tune of about $200 million. However six of these folks -- Mark Zuckerberg, Dustin Moskovitz, Sean Parker, Sheryl Sandberg, Reid Hoffman and his wife Michelle Yee -- will take advantage of a somewhat arcane and totally legal tax trick by putting large portions of their shares in grantor-retained annuity trusts (GRATs). According to The Wall Street Journal's Laura Saunders, "these trusts transfer asset appreciation from one taxpayer to others, virtually tax-free." (Of course, founder Eduardo Saverin is an altogether different category: He won't have to pay any capital gains taxes since he fled the country and moved to Singapore.)

The process is relatively simple. When Facebook goes public, 22 million shares from the above six insiders will go into these annuity trusts which are set up for fixed terms of two years or more. During that time, the trust will pay out an annual sum plus interest and minus a 1.6 percent tax -- that's much smaller than the 55 or so percent in estate taxes they would've paid without the trust -- and when the term is up, the assets would go into another trust for the beneficiaries. Ideally, they would've also appreciated quite a bit in the meantime. It's not a problem that folks like Zuckerberg and Moskovitz don't have kids, because they can legally assign unborn children as beneficiaries to the account. Lucky little unborn devils!

Other Facebook employees won't be so fortunate. For most companies, employees with stock options would be taxed over time as their shares are vested, but Facebook uses a unique kind of employee equity called restricted stock units (RSUs) that are essentially symbolic until an event like an IPO. Per CNN Money's Stacy Cowley, this allowed Facebook to give its employees stock options without the legal shareholder number going too high for them to remain a privately held company. Unfortunately for the employees, the Internal Revenue Service taxes RSU's just like regular income when they become stock. So whether the employees cash in the shares or save them, they have to pay the taxes on them. (Ouch!) All of this will add up to approximately $1.5 billion in tax revenue for the state of California when all is said and done. And, boy, oh, boy does California need it.