(1) In general (A) Subpart F income limited to current earnings and profits For purposes of subsection (a), the subpart F income of any controlled foreign corporation for any taxable year shall not exceed the earnings and profits of such corporation for such taxable year. (B) Certain prior year deficits may be taken into account (i) In general The amount included in the gross income of any United States shareholder under section 951(a)(1)(A) for any taxable year and attributable to a qualified activity shall be reduced by the amount of such shareholder’s pro rata share of any qualified deficit. (ii) Qualified deficit The term “qualified deficit” means any deficit in earnings and profits of the controlled foreign corporation for any prior taxable year which began after December 31, 1986 , and for which the controlled foreign corporation was a controlled foreign corporation; but only to the extent such deficit— (I) is attributable to the same qualified activity as the activity giving rise to the income being offset, and (II) has not previously been taken into account under this subparagraph. In determining the deficit attributable to qualified activities described in subclause (II) or (III) of clause (iii), deficits in earnings and profits (to the extent not previously taken into account under this section) for taxable years beginning after 1962 and before 1987 also shall be taken into account. In the case of the qualified activity described in clause (iii)(I), (iii) Qualified activity For purposes of this paragraph, the term “qualified activity” means any activity giving rise to— (I) foreign base company sales income, (II) foreign base company services income, (III) in the case of a qualified insurance company, insurance income or foreign personal holding company income, or (IV) in the case of a qualified financial institution, foreign personal holding company income. (iv) Pro rata share For purposes of this paragraph, the shareholder’s pro rata share of any deficit for any prior taxable year shall be determined under rules similar to rules under section 951(a)(2) for whichever of the following yields the smaller share: (I) the close of the taxable year, or (II) the close of the taxable year in which the deficit arose. (v) Qualified insurance company For purposes of this subparagraph, the term “qualified insurance company” means any controlled foreign corporation predominantly engaged in the active conduct of an insurance business in the taxable year and in the prior taxable years in which the deficit arose. (vi) Qualified financial institution For purposes of this paragraph, the term “qualified financial institution” means any controlled foreign corporation predominantly engaged in the active conduct of a banking, financing, or similar business in the taxable year and in the prior taxable year in which the deficit arose. (vii) Special rules for insurance income (I) In general An election may be made under this clause to have section 953(a) applied for purposes of this title without regard to the same country exception under paragraph (1)(A) thereof. Such election, once made, may be revoked only with the consent of the Secretary. (II) Special rules for affiliated groups In the case of an affiliated group of corporations (within the meaning of section 1504 but without regard to section 1504(b)(3) and by substituting “more than 50 percent” for “at least 80 percent” each place it appears), no election may be made under subclause (I) for any controlled foreign corporation unless such election is made for all other controlled foreign corporations who are members of such group and who were created or organized under the laws of the same country as such controlled foreign corporation. For purposes of clause (v), in determining whether any controlled corporation described in the preceding sentence is a qualified insurance company, all such corporations shall be treated as 1 corporation. (C) Certain deficits of member of the same chain of corporations may be taken into account (i) In general A controlled foreign corporation may elect to reduce the amount of its subpart F income for any taxable year which is attributable to any qualified activity by the amount of any deficit in earnings and profits of a qualified chain member for a taxable year ending with (or within) the taxable year of such controlled foreign corporation to the extent such deficit is attributable to such activity. To the extent any deficit reduces subpart F income under the preceding sentence, such deficit shall not be taken into account under subparagraph (B). (ii) Qualified chain member For purposes of this subparagraph, the term “qualified chain member” means, with respect to any controlled foreign corporation, any other corporation which is created or organized under the laws of the same foreign country as the controlled foreign corporation but only if— (I) all the stock of such other corporation (other than directors’ qualifying shares) is owned at all times during the taxable year in which the deficit arose (directly or through 1 or more corporations other than the common parent) by such controlled foreign corporation, or (II) all the stock of such controlled foreign corporation (other than directors’ qualifying shares) is owned at all times during the taxable year in which the deficit arose (directly or through 1 or more corporations other than the common parent) by such other corporation. (iii) Coordination This subparagraph shall be applied after subparagraphs (A) and (B).