(6) A semicircular iron sheet with a radius of 8 is cut into an isosceles trapezoid $ABCD$, where the lower base $AB$ is the diameter of the semicircle, and the endpoints of the upper base $CD$ are on the circumference. Then the perimeter $y$ as a function of the leg length $x$ is $\qquad$
$\qquad$
$\begin{array}{l}\text { 6. } y=-\frac{x^{2}}{8} \\ +2 x+32(0<x<8 \sqrt{2})\end{array}$