; United States shareholder For purposes of this subsection— (A) Controlled foreign corporation The term controlled foreign corporation has the meaning given such term by section 957 (taking into account section 956(a)). (B) United States shareholder The term United States shareholder has the meaning given such term by section 951(b) (taking into account section 956(a)). (4) Separate application to items resourced under treaties (A) In general If— (i) without regard to any treaty obligation of the United States, any item of income would be treated as derived from sources within the United States, (ii) under a treaty obligation of the United States, such item would be treated as arising from sources outside the United States, and (iii) the taxpayer chooses the benefits of such treaty obligation, subsections (a), (b), and (c) of this section and sections 907 and 960 shall be applied separately with respect to each such item. (B) Coordination with other provisions This paragraph shall not apply to any item of income to which subsection (h)(10) or section 865(h) applies. (C) Regulations The Secretary may issue such regulations as may be necessary or appropriate to carry out the purposes of this paragraph, including regulations which provide that related items of income may be aggregated for purposes of this paragraph. (5) Regulations The Secretary shall prescribe such regulations as may be necessary or appropriate for the purposes of this subsection, including preventing the manipulation of the character of income the effect of which is to avoid the purposes of this subsection. . (b) Application of per country limitation Section 904 is amended by inserting after subsection (d) the following new subsection: (e) Limitations applied on a per country basis The provisions of subsections (a), (b), (c), and (d) and sections 907 and 960 shall be applied separately with respect to each foreign country or possession with respect to which taxes described in section 901(b) are paid or accrued. . (c) Effective date The amendment