Except as provided in section 312(k)(4), for purposes of this subpart, the earnings and profits of any foreign corporation, and the deficit in earnings and profits of any foreign corporation, for any taxable year shall be determined according to rules substantially similar to those applicable to domestic corporations, under regulations prescribed by the Secretary. In determining such earnings and profits, or the deficit in such earnings and profits, the amount of any illegal bribe, kickback, or other payment (within the meaning of section 162(c)) shall not be taken into account to decrease such earnings and profits or to increase such deficit. The payments referred to in the preceding sentence are payments which would be unlawful under the Foreign Corrupt Practices Act of 1977 if the payor were a United States person.
Under regulations prescribed by the Secretary, no part of the earnings and profits of a controlled foreign corporation for any taxable year shall be included in earnings and profits for purposes of sections 952 and 956, if it is established to the satisfaction of the Secretary that such part could not have been distributed by the controlled foreign corporation to United States shareholders who own (within the meaning of section 958(a)) stock of such controlled foreign corporation because of currency or other restrictions or limitations imposed under the laws of any foreign country.
The Secretary may by regulations require each person who is, or has been, a United States shareholder of a controlled foreign corporation to maintain such records and accounts as may be prescribed by such regulations as necessary to carry out the provisions of this subpart and subpart G.
Where, but for this paragraph, two or more United States persons would be required to maintain or furnish the same records and accounts as may by regulations be required under paragraph (1) with respect to the same controlled foreign corporation for the same period, the Secretary may by regulations provide that the maintenance or furnishing of such records and accounts by only one such person shall satisfy the requirements of paragraph (1) for such other persons.
If a controlled foreign corporation sells or exchanges stock in any other foreign corporation, gain recognized on such sale or exchange shall be included in the gross income of such controlled foreign corporation as a dividend to the same extent that it would have been so included under section 1248(a) if such controlled foreign corporation were a United States person. For purposes of determining the amount which would have been so includible, the determination of whether such other foreign corporation was a controlled foreign corporation shall be made without regard to the preceding sentence.
Clause (i) of section 954(c)(3)(A) shall not apply to any amount treated as a dividend by reason of paragraph (1).
For purposes of this subsection, a controlled foreign corporation shall be treated as having sold or exchanged any stock if, under any provision of this subtitle, such controlled foreign corporation is treated as having gain from the sale or exchange of such stock.
For purposes of this title, in the case of a sale or exchange by a controlled foreign corporation of stock in another foreign corporation in a taxable year of the selling controlled foreign corporation beginning after December 31, 2017, rules similar to the rules of section 961(d) shall apply.