in the last sentence and inserting within . (3) Clerical amendment The table of sections for part II of subchapter B of chapter 1 is amended by adding at the end the following new item: Sec. 91. Certain foreign branch losses transferred to specified 10-percent owned foreign corporations. . (4) Effective date The amendments made by this subsection shall apply to transfers after December 31, 2017. 4004. Treatment of deferred foreign income upon transition to participation exemption system of taxation (a) In general Section 965 is amended to read as follows: 965. Treatment of deferred foreign income upon transition to participation exemption system of taxation (a) Treatment of deferred foreign income as subpart F income In the case of the last taxable year of a deferred foreign income corporation which begins before January 1, 2018, the subpart F income of such foreign corporation (as otherwise determined for such taxable year under section 952) shall be increased by the greater of— (1) the accumulated post-1986 deferred foreign income of such corporation determined as of November 2, 2017, or (2) the accumulated post-1986 deferred foreign income of such corporation determined as of December 31, 2017. (b) Reduction in amounts included in gross income of United States shareholders of specified foreign corporations with deficits in earnings and profits (1) In general In the case of a taxpayer which is a United States shareholder with respect to at least one deferred foreign income corporation and at least one E&P deficit foreign corporation, the amount which would (but for this subsection) be taken into account under section 951(a)(1) by reason of subsection (a) as such United States shareholder’s pro rata share of the subpart F income of each deferred foreign income corporation shall be reduced (but not below zero) by the amount of such United States shareholder’s aggregate foreign E&P deficit which is allocated under paragraph (2) to such deferred foreign income corporation. (2) Allocation of aggregate foreign E&P