Oh god, having to change core functionality at even an if/else level? No thanks. I was under the impression they just provided a suite of functionality that you had to add a variable or parameter to here and there. Sounds like you guys are completely changing the entirety of the functionality if you're even changing logic within. Why even use third party software at that point? Ugh.
Ok to explain it a bit more, think of it this way.
They provide us code that if you were to throw it on a BIOS chip it may or may not work. It will initialize a CPU correctly because it is built specifically for a CPU, let's say Broadwell-DE. If we wanted Skylake code we'd purchase another source from them. So the chip will come up correctly, most of the board will work, but some stuff won't. Let's pretend we make a 10GbE NIC ourselves - we need to insert initializations, PCI-e link training, set up the PCI-e config space, etc. - it all has to be done at the same time other devices are coming up (known as PCI enumeration), so we need to insert it.
Sometimes we find areas in their code where we say "well, this feature is ok, but I'd really like to tweak these numbers custom for us."
Or we'll find a bug that isn't really a bug in their code, but we need to alter their code to fix it (not their fault, but it happens).
These are just a few examples.
And like I said, the codebase is 22k files. Also this is common practice in the BIOS world. I know it seems weird, and it is...
This is why I'm investigating Coreboot.
Edit and if any of this sounds frightening.. just think, sometimes I have to edit ASSEMBLY