determination with respect to the treatment of distributions described in clause (ii) shall be made after the application of this paragraph to the earnings and profits described in the matter preceding clause (i). (C) Undistributed U.S. earnings The term undistributed U.S. earnings has the meaning given the term post-1986 undistributed U.S. earnings in paragraph (5) of section 245(a), determined— (i) as of the close of the taxable year described in subparagraph (A) of this paragraph, and (ii) without regard to post-1986 each place it appears in the matter before subparagraph (A) of such paragraph (5). (2) Applicable controlled foreign corporation The term applicable controlled foreign corporation means, with respect to any expatriated entity, any controlled foreign corporation with respect to which such entity was a United States shareholder at any time during the 5-year period ending on the acquisition date. (3) Expatriated entity The term expatriated entity means— (A) the corporation or partnership referred to in the matter preceding subparagraph (A) of subsection (c)(1) (including with respect to the application of such subsection pursuant to subsection (c)(2)), and (B) any United States person who is related (within the meaning of section 267(b) or 707(b)(1)) to a corporation or partnership described in subparagraph (A). (4) Acquisition date The term acquisition date means the date on which the acquisition described in paragraph (1) or (2) of subsection (c), as the case may be, is completed. (5) Expanded affiliated group The term expanded affiliated group means an affiliated group as defined in section 1504(a) but without regard to section 1504(b)(3), except that section 1504(a) shall be applied by substituting more than 50 percent for at least 80 percent each place it appears. (e) Special rules (1) Credits not allowed against tax on unrepatriated earnings and unrecognized gains In the case of any expatriated entity and any United States shareholder of an applicable controlled foreign corporation, credits