> How do you prove that you did the work and just happened with the same code because that's just the most straightforward way to do it?
This was a factor in Intel's case with NEC over the microcode of their 8086 clone, and the judge ruled in NEC's favour, finding that similarities dictated by functional constraints were (subjectively) not creative expressions i.e. copyright did not apply.⁽¹⁾
Note this relates to copyright, does not extinguish patents, and actually relying on this precedent may require bottomless legal resources.
⁽¹⁾ NEC v. Intel: Breaking New Ground in the Law of Copyright. Contreras, Handley, & Yang; Harvard Journal of Law & Technology vol. 3, page 213 (1990). http://jolt.law.harvard.edu/articles/pdf/v03/03HarvJLTech209...