based on taxable units (1) In general The provisions of subsections (a), (b), (c), and (d) and sections 907 and 960 shall be applied separately with respect to each country and possession by taking into account the aggregate items properly attributable or otherwise allocable to a taxable unit of the taxpayer which is a tax resident of such country or possession. (2) Taxable units (A) In general Unless otherwise provided by the Secretary, to the extent an item may be properly attributable or otherwise allocable to more than one taxable unit under paragraph (1), such item shall be treated as properly attributable or otherwise allocable to the lowest-tier taxable unit of the taxpayer to which such item may be properly attributable or otherwise allocable. No item shall be attributable or otherwise allocable to more than one taxable unit of the taxpayer. (B) Determination of taxable units Except as otherwise provided by the Secretary, the taxable units of a taxpayer are as follows: (i) In general The general taxable unit of the taxpayer which is not otherwise described in a separate clause of this subparagraph. (ii) Foreign branches Each foreign branch the activities of which are carried on directly or indirectly (through one or more pass-through entities) by the taxpayer. (iii) Controlled foreign corporations Each controlled foreign corporation with respect to which the taxpayer is a United States shareholder. (iv) Branches of controlled foreign corporations Each branch the activities of which are carried on directly or indirectly (through one or more pass-through entities) by a controlled foreign corporation referred to in clause (iii). (v) Interests in pass-through entities (I) In general Each interest in a pass-through entity held directly or indirectly by the taxpayer or a controlled foreign corporation referred to in clause (iii) if such entity is a tax resident of a foreign country. (II) Certain interests held by controlled foreign corporations Each interest in a pass-through entity held directly or indirectly