I don't. I have an accountant who does that. I just pay.
FYI, I happen to believe one should never make trading decisions based on the tax implications. Obviously, I suppose, many financial advisors would blanch at that statement, and there are certainly millions of examples of why I might be wrong, but I think thinking about taxes gets in the way of getting oneself into the top tax bracket and staying there.
Besides one should be pleased to be helping to support a great country instead of constantly tearing it down with tax avoidance.