branch is located and in which such branch is licensed, authorized, or regulated by the applicable insurance regulatory body to sell insurance, reinsurance, or annuity contracts to persons other than related persons (as defined in section 954(b)) in such country. (7) Anti-abuse rules For purposes of applying this subsection and section 954(d)— (A) the rules of section 954(c)(7) (other than subparagraph (B) thereof) shall apply, (B) there shall be disregarded any item of income, gain, loss, or deduction of, or derived from, an entity which is not engaged in regular and continuous transactions with persons which are not related persons, (C) there shall be disregarded any change in the method of computing reserves a principal purpose of which is the acceleration or deferral of any item in order to claim the benefits of this subsection or section 954(d), (D) a contract of insurance or reinsurance shall not be treated as an exempt contract (and premiums from such contract shall not be taken into account for purposes of paragraph (2)(B) or (3)) if— (i) any policyholder, insured, annuitant, or beneficiary is a resident of the United States and such contract was marketed to such resident and was written to cover a risk outside the United States, or (ii) the contract covers risks located within and without the United States and the qualifying insurance company or qualifying insurance company branch does not maintain such contemporaneous records, and file such reports, with respect to such contract as the Secretary may require, (E) the Secretary may prescribe rules for the allocation of contracts (and income from contracts) among 2 or more qualifying insurance company branches of a qualifying insurance company in order to clearly reflect the income of such branches, and (F) premiums from a contract shall not be taken into account for purposes of paragraph (2)(B) or (3) if such contract reinsures a contract issued or reinsured by a related person (as defined in section 954(b)). (8) Coordination with section 956(a) (A) In