When someone sues over their rights of source-code-as-text (complaining about e.g. a GPL violation; or in such famous cases as https://en.wikipedia.org/wiki/Google_LLC_v._Oracle_America,_....), they're suing about copyright infringement. This is analogous to suing over copyright infringement about the prose text of a book or article. I think it's enlightening to consider the places where people do and don't sue for copyright infringement of prose text works, as a model for the places where you can and cannot do that for source code.

Copyright is about protecting the rights-holder's ability to determine where the exact copyrighted source material can be used. Copyright does not offer the rights-holder protection for all works with equivalent semantics (that'd be a patent.) For copyright to pertain, the work has to be "textually identical", or — if we want to apply considerations about "sampling" — has to have "textually identical" sections borrowed into the derivative work.

This means that, in both the "prose text" and "source code" cases, all you have to do to avoid copyright, is to retain all the same semantics, but replace all the individual words. Note that this falls under what academia would call "plagiarism" — but there's no law that protects an IP rights-holder from having their work plagiarized.

In prose, this process of plagiarizing a work by replacing all the words, is often euphemistically called "paraphrasing." As far as the law is concerned, it is no different than actual paraphrasing — of digesting the original into your mental model and then attempting to describe the same idea in your own words. Even though, very likely, the structure of the original has been retained in your plagiarized derivative.

90% of the news articles you read are this sort of plagiarized paraphrase of some other news article — the article that "breaks the story." There is nothing the original journalist who breaks the story can do about that, under the law, because the paraphrases aren't literal word-for-word renditions of their copyrighted text.

In code, this is called "renaming all the identifiers." Which is something that happens inherently in decompilation, because all the original names for the identifiers got thrown away when the original code was compiled.

---

Also, to be clear on two issues, because surprisingly nobody in the thread has clarified this yet:

1. In these decompiled game projects, the original game's copyrighted binary-asset representations — which you'd need to byte-for-byte reproduce the game, and which you can't really "rephrase" as above — are not stored in any encoded form in the decompilation's source-code repo. Nor are any representations of assets — characters, logos, etc — to which trademark applies. Rather, for both of these cases, the build framework for the decompiled project contains logic to extract these assets from an external ROM image of the original game that must be supplied at build time. Or you could just as well supply a different ROM image — your own "asset pack", per se — to get a compiled game that is free of such assets.

This means that the decompilation project forms the basis of a tool that can be used to create a work that is byte-for-byte identical to the original — provided you have... a ROM image of the original to feed into it. You know what else matches that description? A file copy utility. (The project can also produce binaries that are not identical to the original — and that's usually the goal of the project, making e.g. PC ports of the original game, which are for entirely different target ISAs and so entirely are different object code from the copyrighted released object code.)

2. The decompilation project never publishes anywhere, the thing that it builds when you run it. Doing so would violate copyright. Just like if Rifftrax actually combined their audio dub track with an original movie and distributed that, that'd be a copyright violation. But, in both cases, it's not a copyright violation to give the end-user a tool to create a derivative work from an original, and tell the user to apply the tool to the original themselves, to derive this combined work for their own private consumption.