(d)Death or imprisonment for crimes against children.—
(1) In General.— Subject to paragraph (2) and notwithstanding any other provision of law, a person who is convicted of a federal offense that is a serious violent felony (as defined in subsection (c)) or a violation of section 2422, 2423, or 2251 shall, unless the sentence of death is imposed, be sentenced to imprisonment for life, if—
(A) the victim of the offense has not attained the age of 14 years;
(B) the victim dies as a result of the offense; and
(C) the defendant, in the course of the offense, engages in conduct described in section 3591(a)(2).
(2) Exception.— with respect to a person convicted of a federal Offense described in paragraph (1), the court may impose any lesser sentence that is authorized by law to take into account any substantial assistance provided by the defendant in the investigation or prosecution of another person who has committed an offense, in accordance with the federal sentencing guidelines and the policy statements of the federal sentencing commission pursuant to section 994(p) of title 28, or for other good cause.
(e) Mandatory life imprisonment for repeated sex offenses against children.— (1) In general.—A person who is convicted of a Federal sex offense in which a minor is the victim shall be sentenced to life imprisonment if the person has a prior sex conviction in which a minor was the victim, unless the sentence of death is imposed.
(2) Definitions.—For the purposes of this subsection—
(A) the term "Federal sex offense" means an offense under section 2241 (relating to aggravated sexual abuse), 2242 (relating to sexual abuse), 2244(a)(1) (relating to abusive sexual contact), 2245 (relating to sexual abuse resulting in death), 2251 (relating to sexual exploitation of children), 2251A (relating to selling or buying of children), 2422(b) (relating to coercion and enticement of a minor into prostitution), or 2423(a) (relating to transportation of minors);
(B) the term "State sex offense" means an offense under State law that is punishable by more than one year in prison and consists of conduct that would be a Federal sex offense if, to the extent or in the manner specified in the applicable provision of this title—
(i) the offense involved interstate or foreign commerce, or the use of the mails; or
(ii) the conduct occurred in any commonwealth, territory, or possession of the United States, within the special maritime and territorial jurisdiction of the United States, in a Federal prison, on any land or building owned by, leased to, or otherwise used by or under the control of the Government of the United States, or in the Indian country (as defined in section 1151);
(C) the term "prior sex conviction" means a conviction for which the sentence was imposed before the conduct occurred constituting the subsequent Federal sex offense, and which was for a Federal sex offense or a State sex offense;
(D) the term "minor" means an individual who has not attained the age of 17 years; and
(E) the term "state" has the meaning given that term in subsection (c)(2).
(3) Nonqualifying felonies. —An offense described in section 2422(b) or 2423(a) shall not serve as a basis for sentencing under this subsection if the defendant establishes by clear and convincing evidence that—
(A) the sexual act or activity was consensual and not for the purpose of commercial or pecuniary gain;
(B) the sexual act or activity would not be punishable by more than one year in prison under the law of the State in which it occurred; or
(C) no sexual act or activity occurred.
(f)(1) If a defendant who is convicted of a felony offense (other than offense of which an element is the false registration of a domain name) knowingly falsely registered a domain name and knowingly used