how did they train it ?
Make the AI trace control flow.
Then learnt language syntax or teach language syntax,
They build a model for all control flows and label it.
When user prompts for a code, it does NLP, then find the matching label and returns the control flow
A wild guess - trace the control flow