(1) such amounts are distributed to, or
(2) such amounts would, but for this subsection, be included under in the gross income of,
For purposes of , the earnings and profits of a controlled foreign corporation attributable to amounts which are, or have been, included in the gross income of a United States shareholder under , shall not, when distributed through a chain of ownership described under , be also included in the gross income of another controlled foreign corporation in such chain for purposes of the application of to such other controlled foreign corporation with respect to such United States shareholder (or to any other United States shareholder who acquires from any person any portion of the interest of such United States shareholder in the controlled foreign corporation, but only to the extent of such portion, and subject to such proof of identity of such interest as the Secretary may prescribe by regulations).
(1) first to the aggregate of—
first to the aggregate of—
(A) earnings and profits attributable to amounts included in gross income under (or which would have been included except for subsection (a)(2) of this section), and
(B) earnings and profits attributable to amounts included in gross income under (or which would have been included except for subsection (a)(3) of this section),
with any distribution being allocated between earnings and profits described in subparagraph (A) and earnings and profits described in subparagraph (B) proportionately on the basis of the respective amounts of such earnings and profits,
(2) then to earnings and profits attributable to amounts included in gross income under (but reduced by amounts not included under subparagraph (B) or (C) of because of the exclusions in paragraphs (2) and (3) of subsection (a) of this section), and
(3) then to other earnings and profits.
Any distribution excluded from gross income under subsection (a) shall be treated, for purposes of this chapter, as a distribution which is not a dividend; except that such distributions shall immediately reduce earnings and profits.
For purposes of this section and , any amount included in the gross income of any person as a dividend by reason of subsection (a) or (f) of section 1248 shall be treated as an amount included in the gross income of such person (or, in any case to which applies, of the domestic corporation referred to in ) under .
(1) In general
For purposes of this section, amounts that would be included under subparagraph (B) of (determined without regard to this section) shall be treated as attributable first to earnings described in subsection (c)(2), and then to earnings described in subsection (c)(3).
(2) Treatment of distributions
In applying this section, actual distributions shall be taken into account before amounts that would be included under (determined without regard to this section).