It's not rocket science but this seems like a decent enough implementation of it. The number of data points rarely goes beyond thousands so compression doesn't have much value.
https://github.com/zeldaret/oot/blob/4d2bc68bacdff06261f7a89...
I am tired of people assigning pseudo-magical properties to "decompilations" while at the same doublethinking them as a way to launder copyrighted works.
For most games I've worked on the most senior game designer will control the game specific flags and then levels will be "owned" by individual designers and they will control the level flags.
Someone, usually the most senior game designer, decides how many flags the game gets and thus the max number of flags each level can have.
If this seems a bit uncontrolled to you.. then yeah it is and yes that's why a lot of games are full of bugs :)
This has become less of an issue as runtime memory has expanded and save games can be HUGE. In the N64 days the constraints were more real and a bloated save game could double the cost cartridge manufacturing and destroy any profit the game made (Nintendo charged a lot more for cartridges with larger battery backed memory).
These days storage bandwidth is the main limiter, so now compression makes sense. When storage size is the main limiter, compression is ironically not very helpful.