of S corporation property (1) In general If the electing S corporation disposes of any property which was taken into account under subsection (b)(2), then the deduction allowed under subsection (a) with respect to any stock, for the taxable year of the shareholder in which or with which the taxable year of the S corporation which includes the date of such disposition ends, shall (except as otherwise provided in this section) not be less than the lesser of— (A) the pro rata share of the gain recognized on such disposition, or (B) the amount determined under subsection (b)(2) by only taking into account such property. (2) Overall allowance not increased No deduction shall be allowed under subsection (a) with respect to any stock for any taxable year to the extent that such deduction (when added to the deductions so allowed for all prior taxable years) exceeds the S corporation built-in gain amount with respect to such stock. (f) Recharacterization of gains as ordinary income to extent of deduction If— (1) stock of an S corporation with respect to which a deduction was allowed under this section, or (2) property which was taken into account under subsection (b)(2) with respect to such stock, is disposed of at a gain (determined without regard to whether or not such gain is recognized and reduced by any amount of gain which is treated as ordinary income under any other provision of this subtitle), the amount of such gain (or the shareholder’s pro rata share of such gain in the case of property described in paragraph (2)) shall be treated as gain which is ordinary income (and shall be recognized notwithstanding any other provision of this subtitle) to the extent of the excess of the aggregate deductions allowable under this section with respect to such stock for the taxable year of such disposition and all prior taxable years over the amounts taken into account under this subsection for all prior taxable years. (g) Termination of amortization No deduction shall be allowed under subsection (a) with respect to any