ReactOS actually got sued by Microsoft for stealing code and one of their proofs was a piece of code (can’t remember exactly what it did) that basically matched the same function Windows code with a few things changed.
It was ASM code I think, and their defense was that there was basically one way to write a function that does this.