Write a function to generate the mirror image of a binary tree.
Represent the tree as a nested list [value, left, right], where an empty child is null, and return the same representation after mirroring every node in place. The function must return null for an empty tree and support up to 10^4 nodes, with integer node values.
null or [value, left, right].def mirror_tree(root):