26 USC 732 - Basis of distributed property other than money

(a) Distributions other than in liquidation of a partner’s interest 

(1) General rule 
The basis of property (other than money) distributed by a partnership to a partner other than in liquidation of the partners interest shall, except as provided in paragraph (2), be its adjusted basis to the partnership immediately before such distribution.
(2) Limitation 
The basis to the distributee partner of property to which paragraph (1) is applicable shall not exceed the adjusted basis of such partners interest in the partnership reduced by any money distributed in the same transaction.
(b) Distributions in liquidation 
The basis of property (other than money) distributed by a partnership to a partner in liquidation of the partners interest shall be an amount equal to the adjusted basis of such partners interest in the partnership reduced by any money distributed in the same transaction.
(c) Allocation of basis 

(1) In general 
The basis of distributed properties to which subsection (a)(2) or (b) is applicable shall be allocated
(A) 
(i) first to any unrealized receivables (as defined in section 751 (c)) and inventory items (as defined in section 751 (d)) in an amount equal to the adjusted basis of each such property to the partnership, and
(ii) if the basis to be allocated is less than the sum of the adjusted bases of such properties to the partnership, then, to the extent any decrease is required in order to have the adjusted bases of such properties equal the basis to be allocated, in the manner provided in paragraph (3), and
(B) to the extent of any basis remaining after the allocation under subparagraph (A), to other distributed properties
(i) first by assigning to each such other property such other propertys adjusted basis to the partnership, and
(ii) then, to the extent any increase or decrease in basis is required in order to have the adjusted bases of such other distributed properties equal such remaining basis, in the manner provided in paragraph (2) or (3), whichever is appropriate.
(2) Method of allocating increase 
Any increase required under paragraph (1)(B) shall be allocated among the properties
(A) first to properties with unrealized appreciation in proportion to their respective amounts of unrealized appreciation before such increase (but only to the extent of each propertys unrealized appreciation), and
(B) then, to the extent such increase is not allocated under subparagraph (A), in proportion to their respective fair market values.
(3) Method of allocating decrease 
Any decrease required under paragraph (1)(A) or (1)(B) shall be allocated
(A) first to properties with unrealized depreciation in proportion to their respective amounts of unrealized depreciation before such decrease (but only to the extent of each propertys unrealized depreciation), and
(B) then, to the extent such decrease is not allocated under subparagraph (A), in proportion to their respective adjusted bases (as adjusted under subparagraph (A)).
(d) Special partnership basis to transferee 
For purposes of subsections (a), (b), and (c), a partner who acquired all or a part of his interest by a transfer with respect to which the election provided in section 754 is not in effect, and to whom a distribution of property (other than money) is made with respect to the transferred interest within 2 years after such transfer, may elect, under regulations prescribed by the Secretary, to treat as the adjusted partnership basis of such property the adjusted basis such property would have if the adjustment provided in section 743 (b) were in effect with respect to the partnership property. The Secretary may by regulations require the application of this subsection in the case of a distribution to a transferee partner, whether or not made within 2 years after the transfer, if at the time of the transfer the fair market value of the partnership property (other than money) exceeded 110 percent of its adjusted basis to the partnership.
(e) Exception 
This section shall not apply to the extent that a distribution is treated as a sale or exchange of property under section 751 (b) (relating to unrealized receivables and inventory items).
(f) Corresponding adjustment to basis of assets of a distributed corporation controlled by a corporate partner 

(1) In general 
If
(A) a corporation (hereafter in this subsection referred to as the corporate partner) receives a distribution from a partnership of stock in another corporation (hereafter in this subsection referred to as the distributed corporation),
(B) the corporate partner has control of the distributed corporation immediately after the distribution or at any time thereafter, and
(C) the partnerships adjusted basis in such stock immediately before the distribution exceeded the corporate partners adjusted basis in such stock immediately after the distribution,

then an amount equal to such excess shall be applied to reduce (in accordance with subsection (c)) the basis of property held by the distributed corporation at such time (or, if the corporate partner does not control the distributed corporation at such time, at the time the corporate partner first has such control).

(2) Exception for certain distributions before control acquired 
Paragraph (1) shall not apply to any distribution of stock in the distributed corporation if
(A) the corporate partner does not have control of such corporation immediately after such distribution, and
(B) the corporate partner establishes to the satisfaction of the Secretary that such distribution was not part of a plan or arrangement to acquire control of the distributed corporation.
(3) Limitations on basis reduction 

(A) In general 
The amount of the reduction under paragraph (1) shall not exceed the amount by which the sum of the aggregate adjusted bases of the property and the amount of money of the distributed corporation exceeds the corporate partners adjusted basis in the stock of the distributed corporation.
(B) Reduction not to exceed adjusted basis of property 
No reduction under paragraph (1) in the basis of any property shall exceed the adjusted basis of such property (determined without regard to such reduction).
(4) Gain recognition where reduction limited 
If the amount of any reduction under paragraph (1) (determined after the application of paragraph (3)(A)) exceeds the aggregate adjusted bases of the property of the distributed corporation
(A) such excess shall be recognized by the corporate partner as long-term capital gain, and
(B) the corporate partners adjusted basis in the stock of the distributed corporation shall be increased by such excess.
(5) Control 
For purposes of this subsection, the term control means ownership of stock meeting the requirements of section 1504 (a)(2).
(6) Indirect distributions 
For purposes of paragraph (1), if a corporation acquires (other than in a distribution from a partnership) stock the basis of which is determined (by reason of being distributed from a partnership) in whole or in part by reference to subsection (a)(2) or (b), the corporation shall be treated as receiving a distribution of such stock from a partnership.
(7) Special rule for stock in controlled corporation 
If the property held by a distributed corporation is stock in a corporation which the distributed corporation controls, this subsection shall be applied to reduce the basis of the property of such controlled corporation. This subsection shall be reapplied to any property of any controlled corporation which is stock in a corporation which it controls.
(8) Regulations 
The Secretary shall prescribe such regulations as may be necessary to carry out the purposes of this subsection, including regulations to avoid double counting and to prevent the abuse of such purposes.