shareholder is the excess (if any) of— (i) such taxpayer’s net income tax for the taxable year, over (ii) such taxpayer’s net income tax for such taxable year determined without regard to this section. (B) Net income tax The term net income tax means the net income tax (as defined in section 38(c)(1)) reduced by the credit allowed under section 38. (C) Regulations The Secretary shall prescribe such regulations as may be necessary for the determination under this subsection of the net tax liability under this section in the case of any pass-thru entity. (f) Regulations The Secretary shall promulgate such regulations as necessary to carry out the purposes of this section, including regulations for the application of this section to pass-through entities all or part of which are owned by 1 or more domestic corporations. . (b) Ordering rule for purposes of treatment of previously taxed income (1) In general Section 959 is amended by adding at the end the following new subsection: (g) Special ordering rule Notwithstanding subsection (c), for purposes of subsections (a) and (b), section 316(a) shall be applied by applying paragraph (2) thereof and then paragraph (1) thereof— (1) first to the deductible portion (as defined in section 966(c)(3)) of the increase in subpart F income described in section 966(a)(1) included in the gross income of United States shareholders under section 951(a)(1) (after application of section 966(a)(2)(A)), and (2) then to amounts described in paragraph (1), (2), or (3) of subsection (c). . (2) Conforming amendment Section 959(c) is amended by inserting except as provided in subsection (g), after subsections (a) and (b), . (c) Conforming amendments (1) Clause (vi) of section 56(g)(4)(C) is amended— (A) by inserting or section 966(a) after section 965 , and (B) by inserting and inclusions after certain distributions in the heading thereof. (2) Paragraph (3) of section 245(a) is amended— (A) by striking post-1986 in subparagraph (A), and (B) by striking total post-1986 in subparagraph (B).