Oh shit. You both need to get something straight. The brain is not a machine, a system. It is a collection of ad hoc solutions based properties of nervous tissue. Not much is really integrated since not much came about at the same time. There are likelihoods that one solution wold b e near another just because nervous tissue is involved. Random migration of snippets of code can be replicated. accidentally, in one mode or another and become part of that mode if the snippet ads value to how that mode performs.
The point is all thought about design needs be dismissed and replaced with what a tinker - there is no master tinker - might find at hand at this or that place or time. Yes structures that seem to have specific functions have evolved which have subsequently been reconfigured for other purposes just because.
But to think of the brain as a designed system is going to lead everyone astray of what is the poliglot nervous system and endocrine system combination driving our bodies around.
We have capabilities, capacities. That does not mean CNS-ES are designed systems (again)!
Gad. It as if Utopia were a realizable construct. Get real. Unless this is a philosophy forum - it isn't I checked - discussions of design need much rethinking.
However steve-bank is right. Most control solutions are feedback mechanisms requiring very little real estate and capability and CNS-ES can have a shitpot load of them.
I don't think anyone assumes the brain was designed in concert in it's entirety, but the term 'algorithm' is a good analogy for what the nervous system does and how one might think about describing it's function in laymans terms, rather than in bio-chemistry.
The 'program' is the body moving across space over time, responding to internal and external inputs, and producing outputs to achieve survival and reproduction. So how would thought, or if you want to go there, other components of the nervous system act to achieve that goal?
In terms of thought I must assume that there is a a hierarchy of significance as to what we're attuned to, something like: biological movement, things that are different from other things, things that are moving fast. The conscious and sub-conscious then formulates response using memory. If none of these criteria are relevant then we become aware of internal inputs, which I would again assume hierarchy of significance: For instance, our mind is much more likely to dwell on, say, significant people, than it is completely insignificant things.