of such taxable event, and (ii) notwithstanding paragraph (1), built-in gain (if any) with respect to the underlying investment shall be treated as long-term or short-term capital gain if the built-in gain would have been so treated if the investment were sold or exchanged at its fair market value immediately before the time the built-in gain is determined under subparagraph (D). (B) Identification For purposes of this paragraph, the determination of which portions of an underlying investment have been deemed sold or exchanged in a taxable event shall be made in the same manner as if there had been an actual sale or exchange. (C) Built-in loss For purposes of this section, the term built-in loss means, with respect to any derivative or underlying investment in an investment hedging unit, any loss which would have been recognized and taken into account under subsection (a) if the derivative were terminated or transferred, or the underlying investment were sold or exchanged, at its fair market value as of the later of the time that the investment hedging unit was established or the time the derivative or the underlying investment became part of the investment hedging unit. (D) Built-in gain For purposes of this section, the term built-in gain means, with respect to any underlying investment in an investment hedging unit, any gain which would have been recognized and taken into account under subsection (a) if the underlying investment were sold or exchanged at its fair market value as of the later of the time that the investment hedging unit was established or the time the underlying investment became part of the investment hedging unit. (c) Taxable event For purposes of this part, the term taxable event means— (1) with respect to any derivative which is not part of an investment hedging unit— (A) the termination or transfer of such derivative, and (B) the close of any taxable year if the taxpayer has rights or obligations with respect to such derivative at such time, and (2) with respect to all derivatives and