Solve for the angle x?

enter image description here

Unfortunately, some case analyses and contradiction things must be done and I wasn't able to come up with any nice and clean way.

First create triangle $ACG$ congruent to $ABC$ and label $F$ as shown in the picture. Mirror $D$ along axis $AC$ to point $P$. Connect necessary points as shown in the picture.

In trapezoid $ADCG$, triangles $ACG$ and $DGC$ are symmetric so congruent as well. So $DGC$ is also a triangle congruent to $ABC$ where angle $\angle DGC=x$

At the same time, $PA = AD = EC, AG = CD, \angle PAG = 90 - {x\over 2} - x = \angle ECD \implies \triangle PAG \cong \triangle ECD$.

Furthermore it's easy to see $DE=PG$ and $\triangle DEG \cong \triangle GPC$.

Now let $\angle GDE = \angle CGP = a$.

With some angle tracing (with the known congruences every single angle can be expressed in terms of x), $a = 40 - {x\over 2}$, and $\angle DEP = 280 - 3x$.

Case $1$: $EP$ is not parallel to $DG$ and intersect $DG$ on the extension ray from $D$ to $G$. Then this means $\angle GDE + \angle DEP < 180$ which means $320 - {7x\over 2} < 180$ so $x > 40$ and $a < 20$.

Therefore $\angle DGP = x - a > 20 > a = \angle GDE$. However since $DE = PG$ and $\angle DGP > \angle GDE$, $P$ would have a further distance to $DG$ and $E$ and $PE$ would intersect $GD$ on the extension ray from $G$ to $D$. contradiction.

Case $2$: $EP$ is not parallel to $DG$ and intersect $GD$ on the extension ray from $G$ to $D$. Then this means $\angle GDE + \angle DEP > 180$ which means $320 - {7x\over 2} > 180$ so $x < 40$ and $a > 20$. All similar thing and we can conclude $\angle GDE > \angle DGP$ so $EP$ must intersect $DG$ on the extension from $D$ to $G$. contradiction.

So $EP$ must be parallel to $DG$ and $320 - {7x\over 2} = 180$ and $x=40$.