(3) Purchase (A) In general The term “purchase” means any acquisition of stock, but only if— (i) the basis of the stock in the hands of the purchasing corporation is not determined (I) in whole or in part by reference to the adjusted basis of such stock in the hands of the person from whom acquired, or (II) under section 1014(a) (relating to property acquired from a decedent), (ii) the stock is not acquired in an exchange to which section 351, 354, 355, or 356 applies and is not acquired in any other transaction described in regulations in which the transferor does not recognize the entire amount of the gain or loss realized on the transaction, and (iii) the stock is not acquired from a person the ownership of whose stock would, under section 318(a) (other than paragraph (4) thereof), be attributed to the person acquiring such stock. (B) Deemed purchase under subsection (a) The term “purchase” includes any deemed purchase under subsection (a)(2). The acquisition date for a corporation which is deemed purchased under subsection (a)(2) shall be determined under regulations prescribed by the Secretary. (C) Certain stock acquisitions from related corporations (i) In general Clause (iii) of subparagraph (A) shall not apply to an acquisition of stock from a related corporation if at least 50 percent in value of the stock of such related corporation was acquired by purchase (within the meaning of subparagraphs (A) and (B)). (ii) Certain distributions Clause (i) of subparagraph (A) shall not apply to an acquisition of stock described in clause (i) of this subparagraph if the corporation acquiring such stock— (I) made a qualified stock purchase of stock of the related corporation, and (II) made an election under this section (or is treated under subsection (e) as having made such an election) with respect to such qualified stock purchase. (iii) Related corporation defined For purposes of this subparagraph, a corporation is a related corporation if stock owned by such corporation is treated (under section 318(a) other than paragraph (4) thereof) as owned by the corporation acquiring the stock.