Partial fix for #5555. Improved pure/const attributes handling
Library: I had misunderstood const/pure a little so I corrected cfg and code
ValueFlow: Refactor the for-loop handling. Use abstract interpretation.