You are confusing the issues here:
The assets were sold at the entity level. Any gain or loss is determined at the entity level. The shareholder basis has nothing to do with this transaction.
...
See more...
You are confusing the issues here:
The assets were sold at the entity level. Any gain or loss is determined at the entity level. The shareholder basis has nothing to do with this transaction.
Based on your additional facts, since the intangible was purchased previously, you are able to use the $200,000 basis when determining your gain.
Based on bullet 2, the split in the gain noted previously still applies; so this addresses your $2 mil.
If you still have assets on the books after the transaction, then someone needs to determine what happens next; will the S corp remain and operate with those remaining assets or will the S corp be closed down?
Depending on the decision to bullet 4, that will require an additional set of adjustments as it is not part of your initial question regarding the sale transaction.
The piece that you are also probably missing is that the gain passes through to the shareholder, the shareholder pays tax, the shareholder should receive a distribution (current or liquidating depends on the response to bullet 4) to cover any tax AND the shareholder basis is increased by the gain passed through on the transaction.