Can we find the area of the quadrilateral in terms of the length $AB$? Let's denote the length $AB$ as the variable $x$.

I tried to use the triangle similarity to compare triangle $CEF$ and $CBA$ but I am stuck here. What other tools do I need to use to find the area of quadrilateral $BDEF$ in terms of the length $AB$?
How do we prove that the area is $$f(x)=6 - \frac 8x - \frac{x^2} 4$$
Let $BC=y$.
Thus, since $$\frac{EF}{AB}=\frac{CE}{BC},$$ we obtain: $$\frac{EF}{x}=\frac{2}{y},$$ which gives $$EF=\frac{2x}{y}$$ and $$S_{BEFD}=\frac{\left(\frac{2x}{y}+2-x\right)(y-2)}{2}.$$ We see that the area depends on $y$.