in the same manner as such section applies to subpart F income and shall be taken into account in the taxable year of the United States shareholder in which or with which the taxable year of the controlled foreign corporation ends. (2) Treatment as United States shareholder For purposes of paragraph (1), a person shall be treated as a United States shareholder of a controlled foreign corporation for any taxable year only if such person owns (within the meaning of section 958(a)) stock in such foreign corporation on the last day, in such year, on which such foreign corporation is a controlled foreign corporation. (3) Treatment as controlled foreign corporation A foreign corporation shall be treated as a controlled foreign corporation for any taxable year if such foreign corporation is a controlled foreign corporation at any time during such taxable year. (f) Treatment as subpart F income for certain purposes (1) In general (A) Application Except as provided in subparagraph (B), any global intangible low-taxed income included in gross income under subsection (a) shall be treated in the same manner as an amount included under section 951(a)(1)(A) for purposes of applying sections 168(h)(2)(B), 535(b)(10), 851(b), 904(h)(1), 959, 961, 962(c), 962(d), 993(a)(1)(E), 996(f)(1), 1248(b)(1), 1248(d)(1), 6501(e)(1)(C), 6654(d)(2)(D), and 6655(e)(4). (B) Exception The Secretary shall provide rules for the application of subparagraph (A) to other provisions of this title in any case in which the determination of subpart F income is required to be made at the level of the controlled foreign corporation. (2) Allocation of global intangible low-taxed income to controlled foreign corporations For purposes of the sections referred to in paragraph (1), with respect to any controlled foreign corporation any pro rata amount from which is taken into account in determining the global intangible low-taxed income included in gross income of a United States shareholder under subsection (a), the portion of such global intangible