I will never have the skills to maintain let alone write a compiler. However, in a situation like this, I would break up the condition into a set of sub-conditions, set intermediate booleans, and progressively build upon the condition tests so as to make the code more intelligible and maintainable. No need for additional functions.
(Amusing incongruity: "boolean" fails the spellchecker in an IT forum :o)
(Amusing incongruity: "boolean" fails the spellchecker in an IT forum :o)