I wonder if embeddings could be created from open source and library code and then used to convert back the code with all the correct variable and function names.
It's not AI but Ghidra has a cool feature called BSim which does something similar. Each function get's a "feature vector" which now that I think about it has some clear parallels to embeddings.
BSim is a hash machine, right? (BSim uses feature vectors, and locality-sensitive hashing.)
Embeddings could be derived from reconstituted hash.