analysis: split flag cost is added only if the depth is less than max depth

removes (some) CHECKED_BUILD errors.