(1) was exempt (or was determined by the Secretary to be exempt) from taxation under by reason of being an organization described in , and
(2) is not an organization described in section 501(c)(3)—
is not an organization described in section 501(c)(3)—
(A) by reason of carrying on propaganda, or otherwise attempting, to influence legislation, or
(B) by reason of participating in, or intervening in, any political campaign on behalf of (or in opposition to) any candidate for public office,
The Secretary shall prescribe such regulations as may be necessary or appropriate to prevent the avoidance of subsection (a), including regulations relating to a direct or indirect transfer of all or part of the assets of an organization to an organization controlled (directly or indirectly) by the same person or persons who control the transferor organization.
Subsection (a) shall not apply to any organization which is a disqualified organization within the meaning of (relating to churches, etc.) for the taxable year immediately preceding the first taxable year for which such organization is described in paragraph (2) of subsection (a).