egl/entrypoint-check: split sort-check into a function