(c) if the vendor or purchaser is a trust, the vendor or purchaser is deemed to be a corporation all the voting shares in the capital stock of whichi. in the case of a testamentary trust under which one or more beneficiaries are entitled to receive all of the income of the trust that arose before the date of death of one or the last surviving of those beneficiaries (in this paragraph referred to as the “distribution date”), and under which no other person can, before the distribution date, receive or otherwise obtain the enjoyment of any of the income or capital of the trust,(1) if such a beneficiary’s share of the income or capital of the trust depends on the exercise by any person of, or the failure by any person to exercise, a power to appoint, and if the particular time occurs before the distribution date, are owned at that time by the beneficiary, or
(2) if subparagraph 1 does not apply and the particular time occurs before the distribution date, are owned at that time by such a beneficiary in a proportion equal to the proportion that the fair market value of the beneficial interest in the trust of the beneficiary is of the fair market value of the beneficial interests in the trust of all the beneficiaries,
ii. if a beneficiary’s share of the accumulating income or capital of the trust depends on the exercise by any person of, or the failure by any person to exercise, a power to appoint, are owned at the particular time by the beneficiary, unless subparagraph i applies and that time occurs before the distribution date,
iii. in any case where subparagraph ii does not apply, are owned at the particular time by the beneficiary in a proportion equal to the proportion that the fair market value of the beneficial interest in the trust of the beneficiary is of the fair market value of all beneficial interests in the trust, unless subparagraph i applies and that time occurs before the distribution date, and
iv. in the case of a trust referred to in section 467, are owned at the particular time by the person referred to in that section from whom property of the trust or property for which it was substituted was directly or indirectly received.