Subject to subparagraph (C), if the claimant is determined to be entitled to past-due benefits under this subchapter and the person representing the claimant is an attorney, the Commissioner of Social Security shall pay out of such past-due benefits to such attorney an amount equal to the lesser of—
(i)#
so much of the maximum fee as does not exceed 25 percent of such past-due benefits (as determined before any applicable reduction under subsection (g) and reduced by the amount of any reduction in benefits under this subchapter or subchapter II pursuant to section 1320a–6(a) of this title ), or
(ii)#
the amount of past-due benefits available after any applicable reductions under subsection (g) and section 1320a–6(a) of this title .