That would be a derivative work, and still be subject to the license terms and conditions, at best.

There are standard ways to approach this called clean room engineering.

https://en.m.wikipedia.org/wiki/Clean-room_design

One person reads the code and produces a detailed technical specification. Someone reviews it to ensure that there is nothing in there that could be classified as copyrighted material, then a third person (who has never seen the original code) implements the spec.

You could use an LLM at both stages, but you'd have to be able to prove that the LLM that does the implementation had no prior knowledge of the code in question... Which given how LLMs have been trained seems to me to be very dubious territory for now until that legal situation gets resolved.