(A), and (2) by adding at the end the following new sentence: In the case of swap payments, the source of a swap payment is determined by reference to the location of the payor. . (b) Tax on swap payments received by foreign corporations Section 881(a) is amended— (1) by inserting swap payments (as identified in section 1256(b)(2)(B)), after annuities, in paragraph (1), and (2) by adding at the end the following new sentence: In the case of swap payments, the source of a swap payment is determined by reference to the location of the payor. . 105. Modifications to rules relating to inverted corporations (a) In general Subsection (b) of section 7874 is amended to read as follows: (b) Inverted corporations treated as domestic corporations (1) In general Notwithstanding section 7701(a)(4), a foreign corporation shall be treated for purposes of this title as a domestic corporation if— (A) such corporation would be a surrogate foreign corporation if subsection (a)(2) were applied by substituting 80 percent for 60 percent , or (B) such corporation is an inverted domestic corporation. (2) Inverted domestic corporation For purposes of this subsection, a foreign corporation shall be treated as an inverted domestic corporation if, pursuant to a plan (or a series of related transactions)— (A) the entity completes after December 22, 2017, the direct or indirect acquisition of— (i) substantially all of the properties held directly or indirectly by a domestic corporation, or (ii) substantially all of the assets of, or substantially all of the properties constituting a trade or business of, a domestic partnership, and (B) after the acquisition, either— (i) more than 50 percent of the stock (by vote or value) of the entity is held— (I) in the case of an acquisition with respect to a domestic corporation, by former shareholders of the domestic corporation by reason of holding stock in the domestic corporation, or (II) in the case of an acquisition with respect to a domestic partnership, by former partners of the domestic