taxable year of the partnership ending with or within the taxable year of the taxpayer— (1) there shall be included in the gross income of the taxpayer as ordinary income an amount equal to the aggregate of the deemed compensation amounts determined under subsection (c) with respect to such interests in all partnerships, and (2) the taxpayer shall be treated as having for such taxable year of the taxpayer a long-term capital loss equal to the aggregate of such deemed compensation amounts. (b) Applicable partnership interest For purposes of this section— (1) In general Except as provided in this subsection, the term applicable partnership interest means any interest in a partnership which— (A) is directly or indirectly transferred to (or held by) the taxpayer in connection with the performance of services by the taxpayer, or any other person, in any applicable trade or business, or (B) is held by a taxpayer who received an applicable loan. Such term shall not include any interest which is acquired pursuant to a sale or disposition to which subsection (c)(5) applies. (2) Determination of interest in a partnership (A) In general For purposes of paragraph (1), the term interest in a partnership includes— (i) any applicable financial instrument or contract, or (ii) to the extent provided by the Secretary, any interest in an entity other than a partnership if such interest would be treated as an applicable partnership interest if such entity were a partnership. (B) Applicable financial instrument or contract For purposes of this paragraph— (i) In general The term applicable financial instrument or contract means any financial instrument or contract the value of which is determined in whole or in part by reference to any partnership or partnership-related item (including the amount of partnership distributions, the value of partnership assets, or the results of partnership operations). (ii) Exception for non-convertible debt Such term shall not include a financial instrument or contract if such instrument or contract—