Doesn't the concept of what is trivial shift with what is possible with LLMs?
"for(int j=0; j<ARRAY_SIZE(a); j++) total += a[j];" - you could copy paste this and more out of leaked Windows source code and it still wouldn't be a copyright violation. But beware that a sum of a large number of trivialities can be not trivial.
All completely unsettled law at this point. And, as a general guiding principle, you do NOT want to be one of the people who pays millions in legal fees and court costs to find out, whether you are right or wrong.