; proper adjustment Notwithstanding any other provision of this title, in the case of any sale under paragraph (1)(B) or (2)(A), any gain arising from such sale shall be taken into account for the taxable year of the sale. In the case of any sale under paragraph (1)(B), proper adjustment shall be made in the amount of any gain or loss subsequently realized for gain taken into account under the preceding sentence. (b) Foreign parent treated as domestic corporation Notwithstanding section 7701(a)(4)— (1) Application to corporate inversions In the case of a corporate inversion, the foreign corporation making the acquisition described in subsection (c)(1) shall be treated for purposes of this title as a domestic corporation. (2) Elective application to corporate expatriations If the common parent of the expanded affiliated group which includes the foreign corporation making the acquisition in a corporate expatriation elects the application of this paragraph and enters into an agreement with the Secretary providing the Secretary such assurances as the Secretary may require that the application of paragraph (1) will be administrable and enforceable with respect to such corporation— (A) such foreign corporation shall be treated for purposes of this title as a domestic corporation, and (B) subsection (a) shall not apply with respect to such corporate expatriation. (c) Corporate inversion