Even before AI copyrighting software was questionable.
The guidance says its case by and case I can find no indication separation of elements is critical. Its more how closely you guide and correct the AI https://www.copyright.gov/ai/Copyright-and-Artificial-Intell...
You can go by US guidance if you only distribute the work in the US. Otherwise you need to he aware this varies elsewhere.
AI is a tool that may make copyright violations more likely, but whether the output violates copyright is a property of the output, not how it was produced.
If you copy and paste leaked closed source code or if your AI produces it verbatim, you're in trouble either way. Change it up a bit and you're fine in practice in both cases.